Skip to content

Commit

Permalink
Fixed async_forward_entry_setup warning
Browse files Browse the repository at this point in the history
  • Loading branch information
cloneofghosts committed Aug 10, 2024
1 parent 2bb2017 commit 7d33c29
Showing 1 changed file with 2 additions and 11 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

0 comments on commit 7d33c29

Please sign in to comment.