Skip to content

Commit

Permalink
Merge pull request #280 from Pirate-Weather/setup-fix
Browse files Browse the repository at this point in the history
Fixed async_forward_entry_setup warning
  • Loading branch information
cloneofghosts committed Aug 11, 2024
2 parents 2bb2017 + 67cb9b6 commit 639d8c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
13 changes: 2 additions & 11 deletions custom_components/pirateweather/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
CONF_SCAN_INTERVAL: pw_scan_Int,
}

# If both platforms
if (PW_PLATFORMS[0] in pw_entity_platform) and (
PW_PLATFORMS[1] in pw_entity_platform
):
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
# If only sensor
elif PW_PLATFORMS[0] in pw_entity_platform:
await hass.config_entries.async_forward_entry_setup(entry, PLATFORMS[0])
# If only weather
elif PW_PLATFORMS[1] in pw_entity_platform:
await hass.config_entries.async_forward_entry_setup(entry, PLATFORMS[1])
# Setup platforms
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)

update_listener = entry.add_update_listener(async_update_options)
hass.data[DOMAIN][entry.entry_id][UPDATE_LISTENER] = update_listener
Expand Down
2 changes: 1 addition & 1 deletion custom_components/pirateweather/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"requirements": [
"python-forecastio==1.4.0"
],
"version": "1.5.3"
"version": "1.5.4"
}

0 comments on commit 639d8c5

Please sign in to comment.