We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1069d30 + 47f887e commit bf252c0Copy full SHA for bf252c0
custom_components/plugwise-beta/__init__.py
@@ -101,6 +101,17 @@ async def async_update_data():
101
102
_LOGGER.debug("Async update interval %s", update_interval)
103
104
+ # Migrate to new unique_id's when needed
105
+ if api.smile_version[0] == "2.5.9":
106
+ if entry.unique_id is None:
107
+ hass.config_entries.async_update_entry(
108
+ entry, unique_id=entry.data[api.gateway_id]
109
+ )
110
+ elif entry.unique_id == api.gateway_id:
111
112
+ entry, unique_id=entry.data[api.hostname]
113
114
+
115
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = {
116
"api": api,
117
"coordinator": coordinator,
0 commit comments