Add update listener type hints to coinbase (#65414)

Co-authored-by: epenet <epenet@users.noreply.github.com>
pull/64137/merge
epenet 2022-02-03 01:25:51 +01:00 committed by GitHub
parent 256ad084c5
commit 340146e5fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -99,7 +99,7 @@ def create_and_update_instance(entry: ConfigEntry) -> CoinbaseData:
return instance
async def update_listener(hass, config_entry):
async def update_listener(hass: HomeAssistant, config_entry: ConfigEntry) -> None:
"""Handle options update."""
await hass.config_entries.async_reload(config_entry.entry_id)
@ -113,11 +113,11 @@ async def update_listener(hass, config_entry):
for entity in entities:
currency = entity.unique_id.split("-")[-1]
if "xe" in entity.unique_id and currency not in config_entry.options.get(
CONF_EXCHANGE_RATES
CONF_EXCHANGE_RATES, []
):
registry.async_remove(entity.entity_id)
elif "wallet" in entity.unique_id and currency not in config_entry.options.get(
CONF_CURRENCIES
CONF_CURRENCIES, []
):
registry.async_remove(entity.entity_id)