Introduced abort in config flow if all entities are deselected when editing a device
This commit is contained in:
@@ -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])
|
||||
|
@@ -33,7 +33,8 @@
|
||||
"options": {
|
||||
"abort": {
|
||||
"already_configured": "Device has already been configured.",
|
||||
"device_success": "Device {dev_name} successfully {action}."
|
||||
"device_success": "Device {dev_name} successfully {action}.",
|
||||
"no_entities": "Cannot remove all entities from a device.\nIf you want to delete a device, enter it in the Devices menu, click the 3 dots in the 'Device info' frame, and press the Delete button."
|
||||
},
|
||||
"error": {
|
||||
"authentication_failed": "Failed to authenticate.\n{msg}",
|
||||
|
Reference in New Issue
Block a user