diff --git a/homeassistant/components/toon/__init__.py b/homeassistant/components/toon/__init__.py index 9b35909409..bdfe8e35c7 100644 --- a/homeassistant/components/toon/__init__.py +++ b/homeassistant/components/toon/__init__.py @@ -146,14 +146,17 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: await hass.data[DOMAIN][entry.entry_id].unregister_webhook() # Unload entities for this entry/device. - await asyncio.gather( - *( - hass.config_entries.async_forward_entry_unload(entry, component) - for component in ENTITY_COMPONENTS + unload_ok = all( + await asyncio.gather( + *( + hass.config_entries.async_forward_entry_unload(entry, component) + for component in ENTITY_COMPONENTS + ) ) ) # Cleanup - del hass.data[DOMAIN][entry.entry_id] + if unload_ok: + del hass.data[DOMAIN][entry.entry_id] - return True + return unload_ok diff --git a/homeassistant/components/toon/strings.json b/homeassistant/components/toon/strings.json index 897c398af9..05eef817d2 100644 --- a/homeassistant/components/toon/strings.json +++ b/homeassistant/components/toon/strings.json @@ -1,33 +1,23 @@ { "config": { "step": { - "authenticate": { - "title": "Link your Toon account", - "description": "Authenticate with your Eneco Toon account (not the developer account).", - "data": { - "username": "[%key:common::config_flow::data::username%]", - "password": "[%key:common::config_flow::data::password%]", - "tenant": "Tenant" - } + "pick_implementation": { + "title": "Choose your tenant to authenticate with" }, - "display": { - "title": "Select display", - "description": "Select the Toon display to connect with.", + "agreement": { + "title": "Select your agreement", + "description": "Select the agreement address you want to add.", "data": { - "display": "Choose display" + "agreement": "Agreement" } } }, - "error": { - "credentials": "The provided credentials are invalid.", - "display_exists": "The selected display is already configured." - }, "abort": { - "client_id": "The client ID from the configuration is invalid.", - "client_secret": "The client secret from the configuration is invalid.", - "unknown_auth_fail": "Unexpected error occurred, while authenticating.", - "no_agreements": "This account has no Toon displays.", - "no_app": "You need to configure Toon before being able to authenticate with it. [Please read the instructions](https://www.home-assistant.io/components/toon/)." + "already_configured": "The selected agreement is already configured.", + "authorize_url_fail": "Unknown error generating an authorize url.", + "authorize_url_timeout": "[%key:common::config_flow::abort::oauth2_authorize_url_timeout%]", + "missing_configuration": "[%key:common::config_flow::abort::oauth2_missing_configuration%]", + "no_agreements": "This account has no Toon displays." } } -} \ No newline at end of file +} diff --git a/homeassistant/components/toon/switch.py b/homeassistant/components/toon/switch.py index 9ea75466ce..22bdd6b100 100644 --- a/homeassistant/components/toon/switch.py +++ b/homeassistant/components/toon/switch.py @@ -59,9 +59,7 @@ class ToonSwitch(ToonEntity, SwitchEntity): def unique_id(self) -> str: """Return the unique ID for this binary sensor.""" agreement_id = self.coordinator.data.agreement.agreement_id - # This unique ID is a bit ugly and contains unneeded information. - # It is here for legacy / backward compatible reasons. - return f"{DOMAIN}_{agreement_id}_switch_{self.key}" + return f"{agreement_id}_{self.key}" @property def is_on(self) -> bool: