Skip to content

Commit f61fed3

Browse files
author
niceboy
committed
Only when th configuration option is empty, update from data
1 parent 6a9ef1f commit f61fed3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

custom_components/aqara_gateway/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
4545
"""Support Aqara Gateway."""
4646

4747
# migrate data (also after first setup) to options
48-
if entry.data:
49-
hass.config_entries.async_update_entry(entry, data={},
48+
if (len(entry.options) == 0):
49+
if entry.data:
50+
hass.config_entries.async_update_entry(entry, data={},
5051
options=entry.data)
5152

5253
if "model" not in entry.options or "password" not in entry.options:

0 commit comments

Comments
 (0)