Introduced abort in config flow if all entities are deselected when editing a device

This commit is contained in:
rospogrigio
2023-01-10 12:54:39 +01:00
committed by rospogrigio
parent 0f3160f178
commit c379645ea1
2 changed files with 7 additions and 1 deletions

View File

@@ -570,6 +570,11 @@ class LocalTuyaOptionsFlowHandler(config_entries.OptionsFlow):
CONF_ENTITIES: [],
}
)
if len(user_input[CONF_ENTITIES]) == 0:
return self.async_abort(
reason="no_entities",
description_placeholders={},
)
if user_input[CONF_ENTITIES]:
entity_ids = [
int(entity.split(":")[0])