Skip to content

Commit b79b084

Browse files
author
niceboy
committed
check the options of entry before setup.
If the some options of the entry are missing, it causes the halt of HA.
1 parent 4d5e94c commit b79b084

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

custom_components/aqara_gateway/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
4747
hass.config_entries.async_update_entry(entry, data={},
4848
options=entry.data)
4949

50+
if "model" not in entry.options or "password" not in entry.options:
51+
raise ConfigEntryNotReady
52+
5053
await _setup_logger(hass)
5154

5255
config = hass.data[DOMAIN]['config']

0 commit comments

Comments
 (0)