Use config_entry.unique_id in Linky (#31051)

* Use config_entry.unique_id in Linky

* Reviews

* _show_setup_form not async
This commit is contained in:
Quentame authored and Paulus Schoutsen committed 2020-01-27 08:57:36 -08:00
1 parent d3ac3e48a3
commit a73a1a4489
5 files changed
+131 -131

No files matched your search

@@ -47,6 +47,12 @@ async def async_setup(hass, config):
async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry):
"""Set up Linky sensors."""
# For backwards compat
if entry.unique_id is None:
hass.config_entries.async_update_entry(
entry, unique_id=entry.data[CONF_USERNAME]
)
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(entry, "sensor")
)