diff --git a/tests/data/devices/awox-tlsr82xx.json b/tests/data/devices/awox-tlsr82xx.json index 686133fdf..1212ac88e 100644 --- a/tests/data/devices/awox-tlsr82xx.json +++ b/tests/data/devices/awox-tlsr82xx.json @@ -199,6 +199,131 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "a4:c1:38:01:9c:d6:df:d1-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "a4:c1:38:01:9c:d6:df:d1:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "a4:c1:38:01:9c:d6:df:d1", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "a4:c1:38:01:9c:d6:df:d1-1-768", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "ColorEvent", + "translation_key": "color", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "ColorClientClusterHandler", + "generic_id": "cluster_handler_0x0300_client", + "endpoint_id": 1, + "cluster": { + "id": 768, + "name": "Color Control", + "type": "client" + }, + "id": "1:0x0300_client", + "unique_id": "a4:c1:38:01:9c:d6:df:d1:1:0x0300_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "a4:c1:38:01:9c:d6:df:d1", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "ColorEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "a4:c1:38:01:9c:d6:df:d1-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "a4:c1:38:01:9c:d6:df:d1:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "a4:c1:38:01:9c:d6:df:d1", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/ewelink-snzb-01p.json b/tests/data/devices/ewelink-snzb-01p.json index 7b1d2b021..583564c3e 100644 --- a/tests/data/devices/ewelink-snzb-01p.json +++ b/tests/data/devices/ewelink-snzb-01p.json @@ -188,6 +188,49 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "84:ba:20:ff:fe:d2:41:fe-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": true, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "84:ba:20:ff:fe:d2:41:fe:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "84:ba:20:ff:fe:d2:41:fe", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/ewelink-wb01.json b/tests/data/devices/ewelink-wb01.json index b0fdc92aa..dc4660e9f 100644 --- a/tests/data/devices/ewelink-wb01.json +++ b/tests/data/devices/ewelink-wb01.json @@ -159,6 +159,49 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "00:12:4b:00:25:12:e0:f9-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": true, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "00:12:4b:00:25:12:e0:f9:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:12:4b:00:25:12:e0:f9", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/hobeian-zg-101zl.json b/tests/data/devices/hobeian-zg-101zl.json index 032d3df28..e0c5631ca 100644 --- a/tests/data/devices/hobeian-zg-101zl.json +++ b/tests/data/devices/hobeian-zg-101zl.json @@ -390,6 +390,90 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:41:15:95:9c-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "ab:cd:ef:12:41:15:95:9c:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:41:15:95:9c", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:41:15:95:9c-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "ab:cd:ef:12:41:15:95:9c:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:41:15:95:9c", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "select": [ { "info_object": { @@ -596,7 +680,7 @@ "entity_category": null, "entity_registry_enabled_default": true, "enabled": true, - "primary": true, + "primary": false, "cluster_handlers": [ { "class_name": "OnOffClusterHandler", diff --git a/tests/data/devices/ikea-of-sweden-parasoll-door-window-sensor.json b/tests/data/devices/ikea-of-sweden-parasoll-door-window-sensor.json index 2fbd108f9..7af15b81c 100644 --- a/tests/data/devices/ikea-of-sweden-parasoll-door-window-sensor.json +++ b/tests/data/devices/ikea-of-sweden-parasoll-door-window-sensor.json @@ -235,7 +235,7 @@ "entity_category": null, "entity_registry_enabled_default": true, "enabled": true, - "primary": true, + "primary": false, "cluster_handlers": [ { "class_name": "IASZoneClusterHandler", @@ -313,6 +313,49 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "04:87:27:ff:fe:4a:b3:25-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": true, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "04:87:27:ff:fe:4a:b3:25:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "04:87:27:ff:fe:4a:b3:25", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/ikea-of-sweden-remote-control-n2.json b/tests/data/devices/ikea-of-sweden-remote-control-n2.json index f936d5f78..d789cfac8 100644 --- a/tests/data/devices/ikea-of-sweden-remote-control-n2.json +++ b/tests/data/devices/ikea-of-sweden-remote-control-n2.json @@ -194,6 +194,90 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:6b:e7:d0:70-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "ab:cd:ef:12:6b:e7:d0:70:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:6b:e7:d0:70", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:6b:e7:d0:70-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "ab:cd:ef:12:6b:e7:d0:70:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:6b:e7:d0:70", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/ikea-of-sweden-rodret-dimmer.json b/tests/data/devices/ikea-of-sweden-rodret-dimmer.json index 078a11f25..f622d29d1 100644 --- a/tests/data/devices/ikea-of-sweden-rodret-dimmer.json +++ b/tests/data/devices/ikea-of-sweden-rodret-dimmer.json @@ -243,6 +243,90 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "5c:c7:c1:ff:fe:cc:19:d9-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "5c:c7:c1:ff:fe:cc:19:d9:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "5c:c7:c1:ff:fe:cc:19:d9", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "5c:c7:c1:ff:fe:cc:19:d9-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "5c:c7:c1:ff:fe:cc:19:d9:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "5c:c7:c1:ff:fe:cc:19:d9", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/ikea-of-sweden-rodret-wireless-dimmer.json b/tests/data/devices/ikea-of-sweden-rodret-wireless-dimmer.json index f36a4e708..33aff2ae8 100644 --- a/tests/data/devices/ikea-of-sweden-rodret-wireless-dimmer.json +++ b/tests/data/devices/ikea-of-sweden-rodret-wireless-dimmer.json @@ -260,6 +260,90 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:07:f8:aa:b7-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "ab:cd:ef:12:07:f8:aa:b7:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:07:f8:aa:b7", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:07:f8:aa:b7-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "ab:cd:ef:12:07:f8:aa:b7:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:07:f8:aa:b7", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/ikea-of-sweden-somrig-shortcut-button.json b/tests/data/devices/ikea-of-sweden-somrig-shortcut-button.json index 08224cbff..7a91668ba 100644 --- a/tests/data/devices/ikea-of-sweden-somrig-shortcut-button.json +++ b/tests/data/devices/ikea-of-sweden-somrig-shortcut-button.json @@ -321,6 +321,172 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:6d:e6:02:47-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "ab:cd:ef:12:6d:e6:02:47:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:6d:e6:02:47", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:6d:e6:02:47-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "ab:cd:ef:12:6d:e6:02:47:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:6d:e6:02:47", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:6d:e6:02:47-2-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 2, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "2:0x0006_client", + "unique_id": "ab:cd:ef:12:6d:e6:02:47:2:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:6d:e6:02:47", + "endpoint_id": 2, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:6d:e6:02:47-2-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 2, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "2:0x0008_client", + "unique_id": "ab:cd:ef:12:6d:e6:02:47:2:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:6d:e6:02:47", + "endpoint_id": 2, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/ikea-of-sweden-symfonisk-sound-remote-gen2.json b/tests/data/devices/ikea-of-sweden-symfonisk-sound-remote-gen2.json index 8b315d2f5..b4597f2f5 100644 --- a/tests/data/devices/ikea-of-sweden-symfonisk-sound-remote-gen2.json +++ b/tests/data/devices/ikea-of-sweden-symfonisk-sound-remote-gen2.json @@ -236,6 +236,90 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:52:61:2b:43-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "ab:cd:ef:12:52:61:2b:43:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:52:61:2b:43", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:52:61:2b:43-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "ab:cd:ef:12:52:61:2b:43:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:52:61:2b:43", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/ikea-of-sweden-tradfri-on-off-switch.json b/tests/data/devices/ikea-of-sweden-tradfri-on-off-switch.json index 231f16ccd..f8660549e 100644 --- a/tests/data/devices/ikea-of-sweden-tradfri-on-off-switch.json +++ b/tests/data/devices/ikea-of-sweden-tradfri-on-off-switch.json @@ -241,6 +241,90 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "14:b4:57:ff:fe:53:65:d7-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "14:b4:57:ff:fe:53:65:d7:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "14:b4:57:ff:fe:53:65:d7", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "14:b4:57:ff:fe:53:65:d7-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "14:b4:57:ff:fe:53:65:d7:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "14:b4:57:ff:fe:53:65:d7", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/ikea-of-sweden-tradfri-remote-control.json b/tests/data/devices/ikea-of-sweden-tradfri-remote-control.json index b98e3bb6b..8e25890b4 100644 --- a/tests/data/devices/ikea-of-sweden-tradfri-remote-control.json +++ b/tests/data/devices/ikea-of-sweden-tradfri-remote-control.json @@ -241,6 +241,90 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "90:fd:9f:ff:fe:fe:d8:a1-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "90:fd:9f:ff:fe:fe:d8:a1:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "90:fd:9f:ff:fe:fe:d8:a1", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "90:fd:9f:ff:fe:fe:d8:a1-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "90:fd:9f:ff:fe:fe:d8:a1:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "90:fd:9f:ff:fe:fe:d8:a1", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/ikea-of-sweden-tradfri-wireless-dimmer.json b/tests/data/devices/ikea-of-sweden-tradfri-wireless-dimmer.json index c8516a151..6a4986f86 100644 --- a/tests/data/devices/ikea-of-sweden-tradfri-wireless-dimmer.json +++ b/tests/data/devices/ikea-of-sweden-tradfri-wireless-dimmer.json @@ -248,6 +248,90 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "00:0b:57:ff:fe:2b:cf:1f-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "00:0b:57:ff:fe:2b:cf:1f:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:0b:57:ff:fe:2b:cf:1f", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:0b:57:ff:fe:2b:cf:1f-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "00:0b:57:ff:fe:2b:cf:1f:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:0b:57:ff:fe:2b:cf:1f", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/inovelli-vzm30-sn.json b/tests/data/devices/inovelli-vzm30-sn.json index ffc11c4b1..83d2babb7 100644 --- a/tests/data/devices/inovelli-vzm30-sn.json +++ b/tests/data/devices/inovelli-vzm30-sn.json @@ -720,6 +720,172 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:9a:d6:cb:e7-2-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 2, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "2:0x0006_client", + "unique_id": "ab:cd:ef:12:9a:d6:cb:e7:2:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:9a:d6:cb:e7", + "endpoint_id": 2, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:9a:d6:cb:e7-2-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 2, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "2:0x0008_client", + "unique_id": "ab:cd:ef:12:9a:d6:cb:e7:2:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:9a:d6:cb:e7", + "endpoint_id": 2, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:9a:d6:cb:e7-3-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 3, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "3:0x0006_client", + "unique_id": "ab:cd:ef:12:9a:d6:cb:e7:3:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:9a:d6:cb:e7", + "endpoint_id": 3, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:9a:d6:cb:e7-3-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 3, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "3:0x0008_client", + "unique_id": "ab:cd:ef:12:9a:d6:cb:e7:3:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:9a:d6:cb:e7", + "endpoint_id": 3, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "light": [ { "info_object": { @@ -735,7 +901,7 @@ "entity_category": null, "entity_registry_enabled_default": true, "enabled": true, - "primary": true, + "primary": false, "cluster_handlers": [ { "class_name": "OnOffClusterHandler", diff --git a/tests/data/devices/inovelli-vzm31-sn.json b/tests/data/devices/inovelli-vzm31-sn.json index 75edb5b5d..89f639c36 100644 --- a/tests/data/devices/inovelli-vzm31-sn.json +++ b/tests/data/devices/inovelli-vzm31-sn.json @@ -877,6 +877,90 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:dc:41:3c:40-2-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 2, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "2:0x0006_client", + "unique_id": "ab:cd:ef:12:dc:41:3c:40:2:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:dc:41:3c:40", + "endpoint_id": 2, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:dc:41:3c:40-2-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 2, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "2:0x0008_client", + "unique_id": "ab:cd:ef:12:dc:41:3c:40:2:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:dc:41:3c:40", + "endpoint_id": 2, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "light": [ { "info_object": { @@ -892,7 +976,7 @@ "entity_category": null, "entity_registry_enabled_default": true, "enabled": true, - "primary": true, + "primary": false, "cluster_handlers": [ { "class_name": "OnOffClusterHandler", diff --git a/tests/data/devices/inovelli-vzm35-sn.json b/tests/data/devices/inovelli-vzm35-sn.json index 18fa6f0e4..f642c3a2d 100644 --- a/tests/data/devices/inovelli-vzm35-sn.json +++ b/tests/data/devices/inovelli-vzm35-sn.json @@ -532,6 +532,90 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:03:3d:90:21-2-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 2, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "2:0x0006_client", + "unique_id": "ab:cd:ef:12:03:3d:90:21:2:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:03:3d:90:21", + "endpoint_id": 2, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:03:3d:90:21-2-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 2, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "2:0x0008_client", + "unique_id": "ab:cd:ef:12:03:3d:90:21:2:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:03:3d:90:21", + "endpoint_id": 2, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "light": [ { "info_object": { @@ -547,7 +631,7 @@ "entity_category": null, "entity_registry_enabled_default": true, "enabled": true, - "primary": true, + "primary": false, "cluster_handlers": [ { "class_name": "OnOffClusterHandler", diff --git a/tests/data/devices/jasco-products-45856.json b/tests/data/devices/jasco-products-45856.json index 6e1a7d62d..a695848e9 100644 --- a/tests/data/devices/jasco-products-45856.json +++ b/tests/data/devices/jasco-products-45856.json @@ -319,6 +319,49 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "00:22:a3:00:00:26:d3:61-2-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 2, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "2:0x0006_client", + "unique_id": "00:22:a3:00:00:26:d3:61:2:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:22:a3:00:00:26:d3:61", + "endpoint_id": 2, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + } + ], "light": [ { "info_object": { @@ -334,7 +377,7 @@ "entity_category": null, "entity_registry_enabled_default": true, "enabled": true, - "primary": true, + "primary": false, "cluster_handlers": [ { "class_name": "OnOffClusterHandler", diff --git a/tests/data/devices/jasco-products-45857.json b/tests/data/devices/jasco-products-45857.json index 8c958eaff..4054578fa 100644 --- a/tests/data/devices/jasco-products-45857.json +++ b/tests/data/devices/jasco-products-45857.json @@ -372,6 +372,90 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "00:22:a3:00:00:25:2c:24-2-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 2, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "2:0x0006_client", + "unique_id": "00:22:a3:00:00:25:2c:24:2:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:22:a3:00:00:25:2c:24", + "endpoint_id": 2, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:22:a3:00:00:25:2c:24-2-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 2, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "2:0x0008_client", + "unique_id": "00:22:a3:00:00:25:2c:24:2:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:22:a3:00:00:25:2c:24", + "endpoint_id": 2, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "light": [ { "info_object": { @@ -387,7 +471,7 @@ "entity_category": null, "entity_registry_enabled_default": true, "enabled": true, - "primary": true, + "primary": false, "cluster_handlers": [ { "class_name": "OnOffClusterHandler", diff --git a/tests/data/devices/lds-zbt-cctswitch-d0001.json b/tests/data/devices/lds-zbt-cctswitch-d0001.json index 27a91956b..b3e572c45 100644 --- a/tests/data/devices/lds-zbt-cctswitch-d0001.json +++ b/tests/data/devices/lds-zbt-cctswitch-d0001.json @@ -236,6 +236,131 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "14:b4:57:ff:fe:81:56:33-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "14:b4:57:ff:fe:81:56:33:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "14:b4:57:ff:fe:81:56:33", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "14:b4:57:ff:fe:81:56:33-1-768", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "ColorEvent", + "translation_key": "color", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "ColorClientClusterHandler", + "generic_id": "cluster_handler_0x0300_client", + "endpoint_id": 1, + "cluster": { + "id": 768, + "name": "Color Control", + "type": "client" + }, + "id": "1:0x0300_client", + "unique_id": "14:b4:57:ff:fe:81:56:33:1:0x0300_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "14:b4:57:ff:fe:81:56:33", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "ColorEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "14:b4:57:ff:fe:81:56:33-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "14:b4:57:ff:fe:81:56:33:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "14:b4:57:ff:fe:81:56:33", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/legrand-double-gangs-remote-switch.json b/tests/data/devices/legrand-double-gangs-remote-switch.json index 4729ceab5..dcafbde89 100644 --- a/tests/data/devices/legrand-double-gangs-remote-switch.json +++ b/tests/data/devices/legrand-double-gangs-remote-switch.json @@ -303,6 +303,172 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:b6:14:95:c6-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "ab:cd:ef:12:b6:14:95:c6:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:b6:14:95:c6", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:b6:14:95:c6-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "ab:cd:ef:12:b6:14:95:c6:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:b6:14:95:c6", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:b6:14:95:c6-2-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 2, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "2:0x0006_client", + "unique_id": "ab:cd:ef:12:b6:14:95:c6:2:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:b6:14:95:c6", + "endpoint_id": 2, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:b6:14:95:c6-2-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 2, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "2:0x0008_client", + "unique_id": "ab:cd:ef:12:b6:14:95:c6:2:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:b6:14:95:c6", + "endpoint_id": 2, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/lk-zbt-dimswitch-d0001.json b/tests/data/devices/lk-zbt-dimswitch-d0001.json index e2bcc2934..495cfea67 100644 --- a/tests/data/devices/lk-zbt-dimswitch-d0001.json +++ b/tests/data/devices/lk-zbt-dimswitch-d0001.json @@ -206,6 +206,90 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "5c:02:72:ff:fe:3f:8c:a4-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "5c:02:72:ff:fe:3f:8c:a4:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "5c:02:72:ff:fe:3f:8c:a4", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "5c:02:72:ff:fe:3f:8c:a4-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "5c:02:72:ff:fe:3f:8c:a4:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "5c:02:72:ff:fe:3f:8c:a4", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/lumi-lumi-remote-b286opcn01.json b/tests/data/devices/lumi-lumi-remote-b286opcn01.json index b47ff2a23..6b02dcd49 100644 --- a/tests/data/devices/lumi-lumi-remote-b286opcn01.json +++ b/tests/data/devices/lumi-lumi-remote-b286opcn01.json @@ -426,6 +426,336 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "04:cf:8c:df:3c:75:c1:67-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "04:cf:8c:df:3c:75:c1:67:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "04:cf:8c:df:3c:75:c1:67", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "04:cf:8c:df:3c:75:c1:67-1-768", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "ColorEvent", + "translation_key": "color", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "ColorClientClusterHandler", + "generic_id": "cluster_handler_0x0300_client", + "endpoint_id": 1, + "cluster": { + "id": 768, + "name": "Color Control", + "type": "client" + }, + "id": "1:0x0300_client", + "unique_id": "04:cf:8c:df:3c:75:c1:67:1:0x0300_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "04:cf:8c:df:3c:75:c1:67", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "ColorEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "04:cf:8c:df:3c:75:c1:67-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "04:cf:8c:df:3c:75:c1:67:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "04:cf:8c:df:3c:75:c1:67", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "04:cf:8c:df:3c:75:c1:67-2-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 2, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "2:0x0006_client", + "unique_id": "04:cf:8c:df:3c:75:c1:67:2:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "04:cf:8c:df:3c:75:c1:67", + "endpoint_id": 2, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "04:cf:8c:df:3c:75:c1:67-3-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 3, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "3:0x0006_client", + "unique_id": "04:cf:8c:df:3c:75:c1:67:3:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "04:cf:8c:df:3c:75:c1:67", + "endpoint_id": 3, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "04:cf:8c:df:3c:75:c1:67-4-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 4, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "4:0x0006_client", + "unique_id": "04:cf:8c:df:3c:75:c1:67:4:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "04:cf:8c:df:3c:75:c1:67", + "endpoint_id": 4, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "04:cf:8c:df:3c:75:c1:67-5-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 5, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "5:0x0006_client", + "unique_id": "04:cf:8c:df:3c:75:c1:67:5:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "04:cf:8c:df:3c:75:c1:67", + "endpoint_id": 5, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "04:cf:8c:df:3c:75:c1:67-6-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 6, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "6:0x0006_client", + "unique_id": "04:cf:8c:df:3c:75:c1:67:6:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "04:cf:8c:df:3c:75:c1:67", + "endpoint_id": 6, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/lumi-lumi-remote-b486opcn01.json b/tests/data/devices/lumi-lumi-remote-b486opcn01.json index 9d48aeca3..59f91214f 100755 --- a/tests/data/devices/lumi-lumi-remote-b486opcn01.json +++ b/tests/data/devices/lumi-lumi-remote-b486opcn01.json @@ -292,6 +292,172 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "04:cf:8c:df:3c:75:c1:7b-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "04:cf:8c:df:3c:75:c1:7b:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "04:cf:8c:df:3c:75:c1:7b", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "04:cf:8c:df:3c:75:c1:7b-1-768", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "ColorEvent", + "translation_key": "color", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "ColorClientClusterHandler", + "generic_id": "cluster_handler_0x0300_client", + "endpoint_id": 1, + "cluster": { + "id": 768, + "name": "Color Control", + "type": "client" + }, + "id": "1:0x0300_client", + "unique_id": "04:cf:8c:df:3c:75:c1:7b:1:0x0300_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "04:cf:8c:df:3c:75:c1:7b", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "ColorEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "04:cf:8c:df:3c:75:c1:7b-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "04:cf:8c:df:3c:75:c1:7b:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "04:cf:8c:df:3c:75:c1:7b", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "04:cf:8c:df:3c:75:c1:7b-2-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 2, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "2:0x0006_client", + "unique_id": "04:cf:8c:df:3c:75:c1:7b:2:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "04:cf:8c:df:3c:75:c1:7b", + "endpoint_id": 2, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/lumi-lumi-remote-b686opcn01.json b/tests/data/devices/lumi-lumi-remote-b686opcn01.json index 35811c9f5..d37c28bfe 100644 --- a/tests/data/devices/lumi-lumi-remote-b686opcn01.json +++ b/tests/data/devices/lumi-lumi-remote-b686opcn01.json @@ -400,6 +400,336 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "04:cf:8c:df:3c:79:47:76-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "04:cf:8c:df:3c:79:47:76:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "04:cf:8c:df:3c:79:47:76", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "04:cf:8c:df:3c:79:47:76-1-768", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "ColorEvent", + "translation_key": "color", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "ColorClientClusterHandler", + "generic_id": "cluster_handler_0x0300_client", + "endpoint_id": 1, + "cluster": { + "id": 768, + "name": "Color Control", + "type": "client" + }, + "id": "1:0x0300_client", + "unique_id": "04:cf:8c:df:3c:79:47:76:1:0x0300_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "04:cf:8c:df:3c:79:47:76", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "ColorEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "04:cf:8c:df:3c:79:47:76-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "04:cf:8c:df:3c:79:47:76:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "04:cf:8c:df:3c:79:47:76", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "04:cf:8c:df:3c:79:47:76-2-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 2, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "2:0x0006_client", + "unique_id": "04:cf:8c:df:3c:79:47:76:2:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "04:cf:8c:df:3c:79:47:76", + "endpoint_id": 2, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "04:cf:8c:df:3c:79:47:76-3-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 3, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "3:0x0006_client", + "unique_id": "04:cf:8c:df:3c:79:47:76:3:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "04:cf:8c:df:3c:79:47:76", + "endpoint_id": 3, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "04:cf:8c:df:3c:79:47:76-4-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 4, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "4:0x0006_client", + "unique_id": "04:cf:8c:df:3c:79:47:76:4:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "04:cf:8c:df:3c:79:47:76", + "endpoint_id": 4, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "04:cf:8c:df:3c:79:47:76-5-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 5, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "5:0x0006_client", + "unique_id": "04:cf:8c:df:3c:79:47:76:5:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "04:cf:8c:df:3c:79:47:76", + "endpoint_id": 5, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "04:cf:8c:df:3c:79:47:76-6-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 6, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "6:0x0006_client", + "unique_id": "04:cf:8c:df:3c:79:47:76:6:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "04:cf:8c:df:3c:79:47:76", + "endpoint_id": 6, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/lumi-lumi-remote-cagl02.json b/tests/data/devices/lumi-lumi-remote-cagl02.json index abf43354c..d3acebdda 100644 --- a/tests/data/devices/lumi-lumi-remote-cagl02.json +++ b/tests/data/devices/lumi-lumi-remote-cagl02.json @@ -440,20 +440,6 @@ "enabled": true, "primary": false, "cluster_handlers": [ - { - "class_name": "OtaClusterHandler", - "generic_id": "cluster_handler_0x0019", - "endpoint_id": 1, - "cluster": { - "id": 25, - "name": "Ota", - "type": "server" - }, - "id": "1:0x0019", - "unique_id": "54:ef:44:10:00:14:f3:e7:1:0x0019", - "status": "INITIALIZED", - "value_attribute": null - }, { "class_name": "OtaClientClusterHandler", "generic_id": "cluster_handler_0x0019_client", diff --git a/tests/data/devices/lumi-lumi-sensor-86sw2.json b/tests/data/devices/lumi-lumi-sensor-86sw2.json index 052d50b38..a2d7e4fd6 100644 --- a/tests/data/devices/lumi-lumi-sensor-86sw2.json +++ b/tests/data/devices/lumi-lumi-sensor-86sw2.json @@ -384,6 +384,131 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "00:15:8d:00:02:54:cb:fa-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "00:15:8d:00:02:54:cb:fa:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:15:8d:00:02:54:cb:fa", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:15:8d:00:02:54:cb:fa-2-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 2, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "2:0x0006_client", + "unique_id": "00:15:8d:00:02:54:cb:fa:2:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:15:8d:00:02:54:cb:fa", + "endpoint_id": 2, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:15:8d:00:02:54:cb:fa-3-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 3, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "3:0x0006_client", + "unique_id": "00:15:8d:00:02:54:cb:fa:3:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:15:8d:00:02:54:cb:fa", + "endpoint_id": 3, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { @@ -539,7 +664,7 @@ "entity_category": "diagnostic", "entity_registry_enabled_default": true, "enabled": true, - "primary": true, + "primary": false, "cluster_handlers": [ { "class_name": "DeviceTemperatureClusterHandler", @@ -587,20 +712,6 @@ "enabled": true, "primary": false, "cluster_handlers": [ - { - "class_name": "OtaClusterHandler", - "generic_id": "cluster_handler_0x0019", - "endpoint_id": 1, - "cluster": { - "id": 25, - "name": "Ota", - "type": "server" - }, - "id": "1:0x0019", - "unique_id": "00:15:8d:00:02:54:cb:fa:1:0x0019", - "status": "INITIALIZED", - "value_attribute": null - }, { "class_name": "OtaClientClusterHandler", "generic_id": "cluster_handler_0x0019_client", diff --git a/tests/data/devices/lumi-lumi-sensor-switch-aq2.json b/tests/data/devices/lumi-lumi-sensor-switch-aq2.json index 6def341c2..db1480a7a 100644 --- a/tests/data/devices/lumi-lumi-sensor-switch-aq2.json +++ b/tests/data/devices/lumi-lumi-sensor-switch-aq2.json @@ -184,6 +184,49 @@ } }, "zha_lib_entities": { + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "00:15:8d:00:02:13:91:38-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": true, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "00:15:8d:00:02:13:91:38:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:15:8d:00:02:13:91:38", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { @@ -339,7 +382,7 @@ "entity_category": "diagnostic", "entity_registry_enabled_default": true, "enabled": true, - "primary": true, + "primary": false, "cluster_handlers": [ { "class_name": "DeviceTemperatureClusterHandler", diff --git a/tests/data/devices/lumi-lumi-sensor-switch-aq3.json b/tests/data/devices/lumi-lumi-sensor-switch-aq3.json index d2e0836e8..983c9af2d 100644 --- a/tests/data/devices/lumi-lumi-sensor-switch-aq3.json +++ b/tests/data/devices/lumi-lumi-sensor-switch-aq3.json @@ -156,6 +156,49 @@ } }, "zha_lib_entities": { + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "00:15:8d:00:02:b0:e5:91-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": true, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "00:15:8d:00:02:b0:e5:91:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:15:8d:00:02:b0:e5:91", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { @@ -311,7 +354,7 @@ "entity_category": "diagnostic", "entity_registry_enabled_default": true, "enabled": true, - "primary": true, + "primary": false, "cluster_handlers": [ { "class_name": "DeviceTemperatureClusterHandler", diff --git a/tests/data/devices/lumi-lumi-sensor-switch.json b/tests/data/devices/lumi-lumi-sensor-switch.json index 393e85ef4..d42fb53ee 100644 --- a/tests/data/devices/lumi-lumi-sensor-switch.json +++ b/tests/data/devices/lumi-lumi-sensor-switch.json @@ -222,6 +222,90 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "00:15:8d:00:02:10:ba:72-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "00:15:8d:00:02:10:ba:72:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:15:8d:00:02:10:ba:72", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:15:8d:00:02:10:ba:72-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "00:15:8d:00:02:10:ba:72:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:15:8d:00:02:10:ba:72", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/lumi-lumi-vibration-aq1.json b/tests/data/devices/lumi-lumi-vibration-aq1.json index e5163fe1d..59faed8ed 100644 --- a/tests/data/devices/lumi-lumi-vibration-aq1.json +++ b/tests/data/devices/lumi-lumi-vibration-aq1.json @@ -575,20 +575,6 @@ "enabled": true, "primary": false, "cluster_handlers": [ - { - "class_name": "OtaClusterHandler", - "generic_id": "cluster_handler_0x0019", - "endpoint_id": 1, - "cluster": { - "id": 25, - "name": "Ota", - "type": "server" - }, - "id": "1:0x0019", - "unique_id": "00:15:8d:00:02:af:97:27:1:0x0019", - "status": "INITIALIZED", - "value_attribute": null - }, { "class_name": "OtaClientClusterHandler", "generic_id": "cluster_handler_0x0019_client", diff --git a/tests/data/devices/lutron-lzl4bwhl01-remote.json b/tests/data/devices/lutron-lzl4bwhl01-remote.json index 10954975c..62f656889 100644 --- a/tests/data/devices/lutron-lzl4bwhl01-remote.json +++ b/tests/data/devices/lutron-lzl4bwhl01-remote.json @@ -160,6 +160,90 @@ } }, "zha_lib_entities": { + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "ff:ff:00:0f:e7:ff:3c:b3-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "ff:ff:00:0f:e7:ff:3c:b3:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ff:ff:00:0f:e7:ff:3c:b3", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ff:ff:00:0f:e7:ff:3c:b3-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "ff:ff:00:0f:e7:ff:3c:b3:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ff:ff:00:0f:e7:ff:3c:b3", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/lutron-z3-1brl.json b/tests/data/devices/lutron-z3-1brl.json index dcdf3ec0f..5a8c32f4b 100644 --- a/tests/data/devices/lutron-z3-1brl.json +++ b/tests/data/devices/lutron-z3-1brl.json @@ -195,6 +195,90 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "ff:ff:00:0f:e7:fb:f0:07-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "ff:ff:00:0f:e7:fb:f0:07:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ff:ff:00:0f:e7:fb:f0:07", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ff:ff:00:0f:e7:fb:f0:07-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "ff:ff:00:0f:e7:fb:f0:07:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ff:ff:00:0f:e7:fb:f0:07", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/mli-zbt-remote-all-rgbw.json b/tests/data/devices/mli-zbt-remote-all-rgbw.json index 95042a55e..8a09e1e8f 100644 --- a/tests/data/devices/mli-zbt-remote-all-rgbw.json +++ b/tests/data/devices/mli-zbt-remote-all-rgbw.json @@ -551,6 +551,131 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:b1:2f:b5:32-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "ab:cd:ef:12:b1:2f:b5:32:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:b1:2f:b5:32", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:b1:2f:b5:32-1-768", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "ColorEvent", + "translation_key": "color", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "ColorClientClusterHandler", + "generic_id": "cluster_handler_0x0300_client", + "endpoint_id": 1, + "cluster": { + "id": 768, + "name": "Color Control", + "type": "client" + }, + "id": "1:0x0300_client", + "unique_id": "ab:cd:ef:12:b1:2f:b5:32:1:0x0300_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:b1:2f:b5:32", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "ColorEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:b1:2f:b5:32-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "ab:cd:ef:12:b1:2f:b5:32:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:b1:2f:b5:32", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/neuhaus-lighting-group-nlg-remote.json b/tests/data/devices/neuhaus-lighting-group-nlg-remote.json index dff0f1b9b..cbf3048ea 100644 --- a/tests/data/devices/neuhaus-lighting-group-nlg-remote.json +++ b/tests/data/devices/neuhaus-lighting-group-nlg-remote.json @@ -158,6 +158,131 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:90:e3:16:0a-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "ab:cd:ef:12:90:e3:16:0a:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:90:e3:16:0a", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:90:e3:16:0a-1-768", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "ColorEvent", + "translation_key": "color", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "ColorClientClusterHandler", + "generic_id": "cluster_handler_0x0300_client", + "endpoint_id": 1, + "cluster": { + "id": 768, + "name": "Color Control", + "type": "client" + }, + "id": "1:0x0300_client", + "unique_id": "ab:cd:ef:12:90:e3:16:0a:1:0x0300_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:90:e3:16:0a", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "ColorEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:90:e3:16:0a-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "ab:cd:ef:12:90:e3:16:0a:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:90:e3:16:0a", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/osram-switch-4x-lightify.json b/tests/data/devices/osram-switch-4x-lightify.json index baf790ac1..64f1e66f2 100644 --- a/tests/data/devices/osram-switch-4x-lightify.json +++ b/tests/data/devices/osram-switch-4x-lightify.json @@ -757,6 +757,746 @@ } }, "zha_lib_entities": { + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "00:0d:6f:00:0e:c8:d4:e7-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "00:0d:6f:00:0e:c8:d4:e7:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:0d:6f:00:0e:c8:d4:e7", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:0d:6f:00:0e:c8:d4:e7-1-768", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "ColorEvent", + "translation_key": "color", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "ColorClientClusterHandler", + "generic_id": "cluster_handler_0x0300_client", + "endpoint_id": 1, + "cluster": { + "id": 768, + "name": "Color Control", + "type": "client" + }, + "id": "1:0x0300_client", + "unique_id": "00:0d:6f:00:0e:c8:d4:e7:1:0x0300_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:0d:6f:00:0e:c8:d4:e7", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "ColorEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:0d:6f:00:0e:c8:d4:e7-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "00:0d:6f:00:0e:c8:d4:e7:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:0d:6f:00:0e:c8:d4:e7", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:0d:6f:00:0e:c8:d4:e7-2-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 2, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "2:0x0006_client", + "unique_id": "00:0d:6f:00:0e:c8:d4:e7:2:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:0d:6f:00:0e:c8:d4:e7", + "endpoint_id": 2, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:0d:6f:00:0e:c8:d4:e7-2-768", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "ColorEvent", + "translation_key": "color", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "ColorClientClusterHandler", + "generic_id": "cluster_handler_0x0300_client", + "endpoint_id": 2, + "cluster": { + "id": 768, + "name": "Color Control", + "type": "client" + }, + "id": "2:0x0300_client", + "unique_id": "00:0d:6f:00:0e:c8:d4:e7:2:0x0300_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:0d:6f:00:0e:c8:d4:e7", + "endpoint_id": 2, + "available": true, + "group_id": null + }, + "state": { + "class_name": "ColorEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:0d:6f:00:0e:c8:d4:e7-2-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 2, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "2:0x0008_client", + "unique_id": "00:0d:6f:00:0e:c8:d4:e7:2:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:0d:6f:00:0e:c8:d4:e7", + "endpoint_id": 2, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:0d:6f:00:0e:c8:d4:e7-3-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 3, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "3:0x0006_client", + "unique_id": "00:0d:6f:00:0e:c8:d4:e7:3:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:0d:6f:00:0e:c8:d4:e7", + "endpoint_id": 3, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:0d:6f:00:0e:c8:d4:e7-3-768", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "ColorEvent", + "translation_key": "color", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "ColorClientClusterHandler", + "generic_id": "cluster_handler_0x0300_client", + "endpoint_id": 3, + "cluster": { + "id": 768, + "name": "Color Control", + "type": "client" + }, + "id": "3:0x0300_client", + "unique_id": "00:0d:6f:00:0e:c8:d4:e7:3:0x0300_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:0d:6f:00:0e:c8:d4:e7", + "endpoint_id": 3, + "available": true, + "group_id": null + }, + "state": { + "class_name": "ColorEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:0d:6f:00:0e:c8:d4:e7-3-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 3, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "3:0x0008_client", + "unique_id": "00:0d:6f:00:0e:c8:d4:e7:3:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:0d:6f:00:0e:c8:d4:e7", + "endpoint_id": 3, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:0d:6f:00:0e:c8:d4:e7-4-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 4, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "4:0x0006_client", + "unique_id": "00:0d:6f:00:0e:c8:d4:e7:4:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:0d:6f:00:0e:c8:d4:e7", + "endpoint_id": 4, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:0d:6f:00:0e:c8:d4:e7-4-768", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "ColorEvent", + "translation_key": "color", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "ColorClientClusterHandler", + "generic_id": "cluster_handler_0x0300_client", + "endpoint_id": 4, + "cluster": { + "id": 768, + "name": "Color Control", + "type": "client" + }, + "id": "4:0x0300_client", + "unique_id": "00:0d:6f:00:0e:c8:d4:e7:4:0x0300_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:0d:6f:00:0e:c8:d4:e7", + "endpoint_id": 4, + "available": true, + "group_id": null + }, + "state": { + "class_name": "ColorEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:0d:6f:00:0e:c8:d4:e7-4-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 4, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "4:0x0008_client", + "unique_id": "00:0d:6f:00:0e:c8:d4:e7:4:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:0d:6f:00:0e:c8:d4:e7", + "endpoint_id": 4, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:0d:6f:00:0e:c8:d4:e7-5-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 5, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "5:0x0006_client", + "unique_id": "00:0d:6f:00:0e:c8:d4:e7:5:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:0d:6f:00:0e:c8:d4:e7", + "endpoint_id": 5, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:0d:6f:00:0e:c8:d4:e7-5-768", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "ColorEvent", + "translation_key": "color", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "ColorClientClusterHandler", + "generic_id": "cluster_handler_0x0300_client", + "endpoint_id": 5, + "cluster": { + "id": 768, + "name": "Color Control", + "type": "client" + }, + "id": "5:0x0300_client", + "unique_id": "00:0d:6f:00:0e:c8:d4:e7:5:0x0300_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:0d:6f:00:0e:c8:d4:e7", + "endpoint_id": 5, + "available": true, + "group_id": null + }, + "state": { + "class_name": "ColorEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:0d:6f:00:0e:c8:d4:e7-5-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 5, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "5:0x0008_client", + "unique_id": "00:0d:6f:00:0e:c8:d4:e7:5:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:0d:6f:00:0e:c8:d4:e7", + "endpoint_id": 5, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:0d:6f:00:0e:c8:d4:e7-6-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 6, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "6:0x0006_client", + "unique_id": "00:0d:6f:00:0e:c8:d4:e7:6:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:0d:6f:00:0e:c8:d4:e7", + "endpoint_id": 6, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:0d:6f:00:0e:c8:d4:e7-6-768", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "ColorEvent", + "translation_key": "color", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "ColorClientClusterHandler", + "generic_id": "cluster_handler_0x0300_client", + "endpoint_id": 6, + "cluster": { + "id": 768, + "name": "Color Control", + "type": "client" + }, + "id": "6:0x0300_client", + "unique_id": "00:0d:6f:00:0e:c8:d4:e7:6:0x0300_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:0d:6f:00:0e:c8:d4:e7", + "endpoint_id": 6, + "available": true, + "group_id": null + }, + "state": { + "class_name": "ColorEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:0d:6f:00:0e:c8:d4:e7-6-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 6, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "6:0x0008_client", + "unique_id": "00:0d:6f:00:0e:c8:d4:e7:6:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:0d:6f:00:0e:c8:d4:e7", + "endpoint_id": 6, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/philips-rom001.json b/tests/data/devices/philips-rom001.json index a8f1ffd31..c1f6fc9d1 100644 --- a/tests/data/devices/philips-rom001.json +++ b/tests/data/devices/philips-rom001.json @@ -262,6 +262,90 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "00:17:88:01:06:54:a7:c3-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "00:17:88:01:06:54:a7:c3:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:17:88:01:06:54:a7:c3", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:17:88:01:06:54:a7:c3-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "00:17:88:01:06:54:a7:c3:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:17:88:01:06:54:a7:c3", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/philips-rwl020.json b/tests/data/devices/philips-rwl020.json index a8f1bfc02..64d1326bc 100644 --- a/tests/data/devices/philips-rwl020.json +++ b/tests/data/devices/philips-rwl020.json @@ -325,6 +325,90 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "00:17:88:01:08:07:c3:5b-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "00:17:88:01:08:07:c3:5b:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:17:88:01:08:07:c3:5b", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:17:88:01:08:07:c3:5b-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "00:17:88:01:08:07:c3:5b:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:17:88:01:08:07:c3:5b", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/securifi-ltd-unk-model.json b/tests/data/devices/securifi-ltd-unk-model.json index a0377c55f..3ed27270f 100644 --- a/tests/data/devices/securifi-ltd-unk-model.json +++ b/tests/data/devices/securifi-ltd-unk-model.json @@ -358,6 +358,49 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "00:0d:6f:00:05:49:ac:68-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "00:0d:6f:00:05:49:ac:68:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:0d:6f:00:05:49:ac:68", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { @@ -707,7 +750,7 @@ "entity_category": null, "entity_registry_enabled_default": true, "enabled": true, - "primary": true, + "primary": false, "cluster_handlers": [ { "class_name": "OnOffClusterHandler", diff --git a/tests/data/devices/signify-netherlands-b-v-rdm001.json b/tests/data/devices/signify-netherlands-b-v-rdm001.json index 04ba86e42..414d81a2a 100644 --- a/tests/data/devices/signify-netherlands-b-v-rdm001.json +++ b/tests/data/devices/signify-netherlands-b-v-rdm001.json @@ -224,6 +224,90 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "00:17:88:01:0b:02:b6:79-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "00:17:88:01:0b:02:b6:79:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:17:88:01:0b:02:b6:79", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:17:88:01:0b:02:b6:79-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "00:17:88:01:0b:02:b6:79:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:17:88:01:0b:02:b6:79", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/signify-netherlands-b-v-rdm002.json b/tests/data/devices/signify-netherlands-b-v-rdm002.json index 57b4e0d36..b883d1b15 100644 --- a/tests/data/devices/signify-netherlands-b-v-rdm002.json +++ b/tests/data/devices/signify-netherlands-b-v-rdm002.json @@ -240,6 +240,90 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "00:17:88:01:0d:13:48:33-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "00:17:88:01:0d:13:48:33:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:17:88:01:0d:13:48:33", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:17:88:01:0d:13:48:33-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "00:17:88:01:0d:13:48:33:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:17:88:01:0d:13:48:33", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/signify-netherlands-b-v-rwl022.json b/tests/data/devices/signify-netherlands-b-v-rwl022.json index 9a7cf3923..cc3012c9c 100644 --- a/tests/data/devices/signify-netherlands-b-v-rwl022.json +++ b/tests/data/devices/signify-netherlands-b-v-rwl022.json @@ -236,6 +236,90 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "00:17:88:01:0c:26:42:ec-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "00:17:88:01:0c:26:42:ec:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:17:88:01:0c:26:42:ec", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "00:17:88:01:0c:26:42:ec-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "00:17:88:01:0c:26:42:ec:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "00:17:88:01:0c:26:42:ec", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/somfy-sonesse-28-wf-li-ion-roller.json b/tests/data/devices/somfy-sonesse-28-wf-li-ion-roller.json index 4b131ab14..250afaa1e 100644 --- a/tests/data/devices/somfy-sonesse-28-wf-li-ion-roller.json +++ b/tests/data/devices/somfy-sonesse-28-wf-li-ion-roller.json @@ -585,20 +585,6 @@ "enabled": true, "primary": false, "cluster_handlers": [ - { - "class_name": "OtaClusterHandler", - "generic_id": "cluster_handler_0x0019", - "endpoint_id": 232, - "cluster": { - "id": 25, - "name": "Ota", - "type": "server" - }, - "id": "232:0x0019", - "unique_id": "ab:cd:ef:12:7b:7c:3f:a7:232:0x0019", - "status": "INITIALIZED", - "value_attribute": null - }, { "class_name": "OtaClientClusterHandler", "generic_id": "cluster_handler_0x0019_client", diff --git a/tests/data/devices/third-reality-inc-3rsb22bz.json b/tests/data/devices/third-reality-inc-3rsb22bz.json index 72800c0ac..e8ebb9b52 100644 --- a/tests/data/devices/third-reality-inc-3rsb22bz.json +++ b/tests/data/devices/third-reality-inc-3rsb22bz.json @@ -140,6 +140,90 @@ } }, "zha_lib_entities": { + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "28:2c:02:bf:ff:e3:74:f8-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "28:2c:02:bf:ff:e3:74:f8:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "28:2c:02:bf:ff:e3:74:f8", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "28:2c:02:bf:ff:e3:74:f8-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "28:2c:02:bf:ff:e3:74:f8:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "28:2c:02:bf:ff:e3:74:f8", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/third-reality-inc-3rss007z.json b/tests/data/devices/third-reality-inc-3rss007z.json index c4b6c062f..8989953cf 100644 --- a/tests/data/devices/third-reality-inc-3rss007z.json +++ b/tests/data/devices/third-reality-inc-3rss007z.json @@ -291,7 +291,7 @@ "unique_id": "28:2c:02:bf:ff:e0:16:01-1-25-firmware_update", "migrate_unique_ids": [], "platform": "update", - "class_name": "FirmwareUpdateEntity", + "class_name": "FirmwareUpdateServerEntity", "translation_key": null, "translation_placeholders": null, "device_class": "firmware", @@ -323,7 +323,7 @@ "supported_features": 7 }, "state": { - "class_name": "FirmwareUpdateEntity", + "class_name": "FirmwareUpdateServerEntity", "available": true, "installed_version": null, "in_progress": false, diff --git a/tests/data/devices/third-reality-inc-3rss009z.json b/tests/data/devices/third-reality-inc-3rss009z.json index f0885a380..093d04907 100644 --- a/tests/data/devices/third-reality-inc-3rss009z.json +++ b/tests/data/devices/third-reality-inc-3rss009z.json @@ -147,6 +147,49 @@ }, "original_signature": {}, "zha_lib_entities": { + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "28:2c:02:bf:ff:e9:77:95-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "28:2c:02:bf:ff:e9:77:95:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "28:2c:02:bf:ff:e9:77:95", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + } + ], "number": [ { "info_object": { @@ -398,7 +441,7 @@ "entity_category": null, "entity_registry_enabled_default": true, "enabled": true, - "primary": true, + "primary": false, "cluster_handlers": [ { "class_name": "OnOffClusterHandler", diff --git a/tests/data/devices/tz3000-gwkzibhs-ts004f.json b/tests/data/devices/tz3000-gwkzibhs-ts004f.json index a775d28d0..7a79d3183 100644 --- a/tests/data/devices/tz3000-gwkzibhs-ts004f.json +++ b/tests/data/devices/tz3000-gwkzibhs-ts004f.json @@ -297,6 +297,90 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:e5:79:a6:00-1-768", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "ColorEvent", + "translation_key": "color", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "ColorClientClusterHandler", + "generic_id": "cluster_handler_0x0300_client", + "endpoint_id": 1, + "cluster": { + "id": 768, + "name": "Color Control", + "type": "client" + }, + "id": "1:0x0300_client", + "unique_id": "ab:cd:ef:12:e5:79:a6:00:1:0x0300_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:e5:79:a6:00", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "ColorEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:e5:79:a6:00-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "ab:cd:ef:12:e5:79:a6:00:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:e5:79:a6:00", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/tz3000-kjfzuycl-ts004f.json b/tests/data/devices/tz3000-kjfzuycl-ts004f.json index 6a82f0d53..0ca4010a1 100644 --- a/tests/data/devices/tz3000-kjfzuycl-ts004f.json +++ b/tests/data/devices/tz3000-kjfzuycl-ts004f.json @@ -246,6 +246,90 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "38:5b:44:ff:fe:36:af:0f-1-768", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "ColorEvent", + "translation_key": "color", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "ColorClientClusterHandler", + "generic_id": "cluster_handler_0x0300_client", + "endpoint_id": 1, + "cluster": { + "id": 768, + "name": "Color Control", + "type": "client" + }, + "id": "1:0x0300_client", + "unique_id": "38:5b:44:ff:fe:36:af:0f:1:0x0300_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "38:5b:44:ff:fe:36:af:0f", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "ColorEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "38:5b:44:ff:fe:36:af:0f-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "38:5b:44:ff:fe:36:af:0f:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "38:5b:44:ff:fe:36:af:0f", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/data/devices/tz3000-xa9g7rxs-ts1002.json b/tests/data/devices/tz3000-xa9g7rxs-ts1002.json index 61d6615cb..bb05895ea 100644 --- a/tests/data/devices/tz3000-xa9g7rxs-ts1002.json +++ b/tests/data/devices/tz3000-xa9g7rxs-ts1002.json @@ -215,6 +215,131 @@ } } ], + "event": [ + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:66:b9:e7:ff-1-6", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "OnOffEvent", + "translation_key": "on_off", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "OnOffClientClusterHandler", + "generic_id": "cluster_handler_0x0006_client", + "endpoint_id": 1, + "cluster": { + "id": 6, + "name": "On/Off", + "type": "client" + }, + "id": "1:0x0006_client", + "unique_id": "ab:cd:ef:12:66:b9:e7:ff:1:0x0006_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:66:b9:e7:ff", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "OnOffEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:66:b9:e7:ff-1-768", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "ColorEvent", + "translation_key": "color", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "ColorClientClusterHandler", + "generic_id": "cluster_handler_0x0300_client", + "endpoint_id": 1, + "cluster": { + "id": 768, + "name": "Color Control", + "type": "client" + }, + "id": "1:0x0300_client", + "unique_id": "ab:cd:ef:12:66:b9:e7:ff:1:0x0300_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:66:b9:e7:ff", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "ColorEvent", + "available": true + } + }, + { + "info_object": { + "fallback_name": null, + "unique_id": "ab:cd:ef:12:66:b9:e7:ff-1-8", + "migrate_unique_ids": [], + "platform": "event", + "class_name": "LevelControlEvent", + "translation_key": "level_control", + "translation_placeholders": null, + "device_class": null, + "state_class": null, + "entity_category": null, + "entity_registry_enabled_default": true, + "enabled": true, + "primary": false, + "cluster_handlers": [ + { + "class_name": "LevelControlClientClusterHandler", + "generic_id": "cluster_handler_0x0008_client", + "endpoint_id": 1, + "cluster": { + "id": 8, + "name": "Level control", + "type": "client" + }, + "id": "1:0x0008_client", + "unique_id": "ab:cd:ef:12:66:b9:e7:ff:1:0x0008_CLIENT", + "status": "INITIALIZED", + "value_attribute": null + } + ], + "device_ieee": "ab:cd:ef:12:66:b9:e7:ff", + "endpoint_id": 1, + "available": true, + "group_id": null + }, + "state": { + "class_name": "LevelControlEvent", + "available": true + } + } + ], "sensor": [ { "info_object": { diff --git a/tests/test_platform_event.py b/tests/test_platform_event.py new file mode 100644 index 000000000..77e0634c9 --- /dev/null +++ b/tests/test_platform_event.py @@ -0,0 +1,233 @@ +"""Test zha fan.""" + +# pylint: disable=redefined-outer-name + +import logging + +import pytest +from zigpy.device import Device as ZigpyDevice +from zigpy.profiles import zha +from zigpy.zcl.clusters import general, lighting +import zigpy.zdo.types as zdo_t + +from tests.common import ( + SIG_EP_INPUT, + SIG_EP_OUTPUT, + SIG_EP_PROFILE, + SIG_EP_TYPE, + create_mock_zigpy_device, + get_entity, + join_zigpy_device, + make_zcl_header, +) +from zha.application import Platform +from zha.application.gateway import Gateway +from zha.application.platforms.event import ( + BaseEvent, + ColorEvent, + LevelControlEvent, + OnOffEvent, +) + +IEEE_GROUPABLE_DEVICE = "01:2d:6f:00:0a:90:69:e8" +IEEE_GROUPABLE_DEVICE2 = "02:2d:6f:00:0a:90:69:e8" + +_LOGGER = logging.getLogger(__name__) + + +def zigpy_device_mock(zha_gateway: Gateway) -> ZigpyDevice: + """Device tracker zigpy device.""" + endpoints = { + 1: { + SIG_EP_INPUT: [], + SIG_EP_OUTPUT: [ + general.LevelControl.cluster_id, + general.OnOff.cluster_id, + lighting.Color.cluster_id, + ], + SIG_EP_TYPE: zha.DeviceType.LEVEL_CONTROL_SWITCH, + SIG_EP_PROFILE: zha.PROFILE_ID, + } + } + return create_mock_zigpy_device( + zha_gateway, + endpoints, + node_descriptor=zdo_t.NodeDescriptor( + logical_type=zdo_t.LogicalType.EndDevice, + complex_descriptor_available=0, + user_descriptor_available=0, + reserved=0, + aps_flags=0, + frequency_band=zdo_t.NodeDescriptor.FrequencyBand.Freq2400MHz, + mac_capability_flags=( + zdo_t.NodeDescriptor.MACCapabilityFlags.MainsPowered + | zdo_t.NodeDescriptor.MACCapabilityFlags.RxOnWhenIdle + | zdo_t.NodeDescriptor.MACCapabilityFlags.AllocateAddress + ), + manufacturer_code=4098, + maximum_buffer_size=82, + maximum_incoming_transfer_size=82, + server_mask=0, + maximum_outgoing_transfer_size=82, + descriptor_capability_field=zdo_t.NodeDescriptor.DescriptorCapability.NONE, + ), + ) + + +async def test_level_control_event( + zha_gateway: Gateway, +) -> None: + """Test zha fan platform.""" + + zigpy_device = zigpy_device_mock(zha_gateway) + zha_device = await join_zigpy_device(zha_gateway, zigpy_device) + cluster: general.LevelControl = zigpy_device.endpoints.get(1).out_clusters[ + general.LevelControl.cluster_id + ] + + entity = get_entity( + zha_device, platform=Platform.EVENT, exact_entity_type=LevelControlEvent + ) + assert isinstance(entity, BaseEvent) + assert entity.event_types == [ + "step", + "step_with_on_off", + "stop", + "move", + "move_with_on_off", + "move_to_level", + "move_to_level_with_on_off", + ] + + cmd = cluster.ServerCommandDefs.step + hdr = make_zcl_header(cmd.id, global_command=False, tsn=1) + msg = cmd.schema(step_mode=1, step_size=10, transition_time=5) + cluster.handle_message(hdr, msg) + assert entity.state == { + "event_attributes": { + "step_mode": 1, + "step_size": 10, + "transition_time": 5, + }, + "event_type": "step", + "available": True, + "class_name": "LevelControlEvent", + } + + +async def test_color_event( + zha_gateway: Gateway, +) -> None: + """Test zha fan platform.""" + + zigpy_device = zigpy_device_mock(zha_gateway) + zha_device = await join_zigpy_device(zha_gateway, zigpy_device) + cluster: lighting.Color = zigpy_device.endpoints.get(1).out_clusters[ + lighting.Color.cluster_id + ] + + entity = get_entity( + zha_device, platform=Platform.EVENT, exact_entity_type=ColorEvent + ) + assert isinstance(entity, BaseEvent) + assert entity.event_types == [ + "move_to_hue", + "move_hue", + "step_hue", + "move_to_saturation", + "move_saturation", + "step_saturation", + "move_to_hue_and_saturation", + "move_to_color", + "move_color", + "step_color", + "move_to_color_temp", + "enhanced_move_to_hue", + "enhanced_move_hue", + "enhanced_step_hue", + "enhanced_move_to_hue_and_saturation", + "color_loop_set", + "stop_move_step", + "move_color_temp", + "step_color_temp", + ] + + cmd = cluster.ServerCommandDefs.step_color_temp + hdr = make_zcl_header(cmd.id, global_command=False, tsn=1) + msg = cmd.schema(step_mode=1, step_size=10, transition_time=5) + cluster.handle_message(hdr, msg) + assert entity.state == { + "event_attributes": { + "step_mode": 1, + "step_size": 10, + "transition_time": 5, + }, + "event_type": "step_color_temp", + "available": True, + "class_name": "ColorEvent", + } + + +async def test_on_off_event( + zha_gateway: Gateway, +) -> None: + """Test zha fan platform.""" + + zigpy_device = zigpy_device_mock(zha_gateway) + zha_device = await join_zigpy_device(zha_gateway, zigpy_device) + cluster: general.OnOff = zigpy_device.endpoints.get(1).out_clusters[ + general.OnOff.cluster_id + ] + + entity = get_entity( + zha_device, platform=Platform.EVENT, exact_entity_type=OnOffEvent + ) + assert isinstance(entity, BaseEvent) + assert entity.event_types == [ + "off", + "on", + "toggle", + "off_with_effect", + "on_with_recall_global_scene", + "on_with_timed_off", + ] + + cmd = cluster.ServerCommandDefs.on + hdr = make_zcl_header(cmd.id, global_command=False, tsn=1) + msg = cmd.schema() + cluster.handle_message(hdr, msg) + assert entity.state == { + "event_attributes": {}, + "event_type": "on", + "available": True, + "class_name": "OnOffEvent", + } + + +async def test_invalid_event( + zha_gateway: Gateway, + caplog: pytest.LogCaptureFixture, +) -> None: + """Test that an invalid command does not trigger an exception.""" + + zigpy_device = zigpy_device_mock(zha_gateway) + zha_device = await join_zigpy_device(zha_gateway, zigpy_device) + cluster: general.LevelControl = zigpy_device.endpoints.get(1).out_clusters[ + general.LevelControl.cluster_id + ] + + entity = get_entity( + zha_device, platform=Platform.EVENT, exact_entity_type=LevelControlEvent + ) + assert isinstance(entity, BaseEvent) + + # cmd = general.OnOff.ServerCommandDefs.on + hdr = make_zcl_header(0xFF, global_command=False, tsn=1) + msg = b"" + + caplog.clear() + cluster.handle_message(hdr, msg) + assert ( + "[0xB79C:1:0x0008_client]: received '0xFF' command with b'' args on cluster_id '8' tsn '1'\n" + in caplog.text + ) diff --git a/zha/application/discovery.py b/zha/application/discovery.py index bacae08d2..9ec5bc4fc 100644 --- a/zha/application/discovery.py +++ b/zha/application/discovery.py @@ -34,6 +34,7 @@ climate, cover, device_tracker, + event, fan, light, lock, @@ -88,6 +89,7 @@ Platform.CLIMATE, Platform.COVER, Platform.DEVICE_TRACKER, + Platform.EVENT, Platform.FAN, Platform.LIGHT, Platform.LOCK, @@ -478,23 +480,26 @@ def discover_by_cluster_id(self, endpoint: Endpoint) -> Iterator[PlatformEntity] yield from self.probe_single_cluster(platform, cluster_handler, endpoint) - # until we can get rid of registries - yield from self.handle_on_off_output_cluster_exception(endpoint) + profile_id = endpoint.zigpy_endpoint.profile_id + device_type = endpoint.zigpy_endpoint.device_type + if device_type in REMOTE_DEVICE_TYPES.get(profile_id, []): + yield from self._handle_single_output_clusters(endpoint) + else: + # until we can get rid of registries + yield from self.handle_on_off_output_cluster_exception(endpoint) def handle_on_off_output_cluster_exception( self, endpoint: Endpoint ) -> Iterator[PlatformEntity]: """Process output clusters of the endpoint.""" - profile_id = endpoint.zigpy_endpoint.profile_id - device_type = endpoint.zigpy_endpoint.device_type - if device_type in REMOTE_DEVICE_TYPES.get(profile_id, []): - return - for cluster_id, cluster in endpoint.zigpy_endpoint.out_clusters.items(): - platform = SINGLE_OUTPUT_CLUSTER_DEVICE_CLASS.get(cluster.cluster_id) - if platform is None: + platforms = SINGLE_OUTPUT_CLUSTER_DEVICE_CLASS.get(cluster.cluster_id, []) + if not platforms: continue + # only get the first platform for this + # special construction. + platform = platforms[0] cluster_handler_classes = CLUSTER_HANDLER_REGISTRY.get( cluster_id, {None: ClusterHandler} @@ -517,6 +522,27 @@ def handle_on_off_output_cluster_exception( yield from self.probe_single_cluster(platform, cluster_handler, endpoint) + def _handle_single_output_clusters( + self, endpoint: Endpoint + ) -> Iterator[PlatformEntity]: + """Process output clusters of the endpoint.""" + remaining_cluster_handlers = endpoint.client_cluster_handlers.values() + for cluster_handler in remaining_cluster_handlers: + if cluster_handler.cluster.cluster_id in CLUSTER_HANDLER_ONLY_CLUSTERS: + endpoint.claim_cluster_handlers([cluster_handler]) + continue + + platforms = SINGLE_OUTPUT_CLUSTER_DEVICE_CLASS.get( + cluster_handler.cluster.cluster_id + ) + if not platforms: + continue + + for platform in platforms: + yield from self.probe_single_cluster( + platform, cluster_handler, endpoint + ) + def discover_multi_entities( self, endpoint: Endpoint, diff --git a/zha/application/platforms/event.py b/zha/application/platforms/event.py new file mode 100644 index 000000000..fabcb5b2a --- /dev/null +++ b/zha/application/platforms/event.py @@ -0,0 +1,174 @@ +"""Fans on Zigbee Home Automation networks.""" + +from __future__ import annotations + +import functools +from typing import TYPE_CHECKING, Any + +from zha.application import Platform +from zha.application.platforms import ( + BaseEntity, + EntityStateChangedEvent, + PlatformEntity, +) +from zha.application.registries import PLATFORM_ENTITIES +from zha.const import STATE_CHANGED +from zha.zigbee.cluster_handlers.const import ( + CLIENT_CLUSTER_HANDLER_COLOR, + CLIENT_CLUSTER_HANDLER_LEVEL, + CLIENT_CLUSTER_HANDLER_ON_OFF, + CLUSTER_HANDLER_COMMAND_EVENT, +) + +if TYPE_CHECKING: + from zha.zigbee.cluster_handlers import ClusterHandler, ClusterHandlerCommandEvent + +from enum import StrEnum + +STRICT_MATCH = functools.partial(PLATFORM_ENTITIES.strict_match, Platform.EVENT) +GROUP_MATCH = functools.partial(PLATFORM_ENTITIES.group_match, Platform.EVENT) +MULTI_MATCH = functools.partial(PLATFORM_ENTITIES.multipass_match, Platform.EVENT) + + +class EventDeviceClass(StrEnum): + """Device class for events.""" + + DOORBELL = "doorbell" + BUTTON = "button" + MOTION = "motion" + + +class BaseEvent(BaseEntity): + """Base representation of a ZHA events.""" + + PLATFORM = Platform.EVENT + + _attr_translation_key: str = "event" + _attr_event_types: list[str] = [] + _attr_device_class: EventDeviceClass | None = None + _attr_primary_weight = 10 + _state: dict[str, Any] = {} + + @functools.cached_property + def device_class(self) -> EventDeviceClass | None: + """Return the class of this entity.""" + return self._attr_device_class + + @functools.cached_property + def event_types(self) -> list[str]: + """Return a list of possible events.""" + return self._attr_event_types + + @property + def state(self) -> dict[str, Any]: + """Return the state of the select.""" + response = super().state + response.update(self._state) + return response + + def _trigger_event(self, event_type: str, event_attributes: dict[str, Any]) -> None: + """Handle state update from cluster handler.""" + if event_type not in self._attr_event_types: + self.debug("Event type %s ignored", event_type) + return + + self._state = { + "event_attributes": event_attributes, + "event_type": event_type, + } + self.emit(STATE_CHANGED, EntityStateChangedEvent(**self.identifiers.__dict__)) + + +class ClusterHandlerEvent(BaseEvent, PlatformEntity): + """Base representation of a ZHA events using cluster handler.""" + + _cluster_handler_name: str + _cluster_handler: ClusterHandler + + def __init__( + self, + *args, + **kwargs, + ) -> None: + """Initialize the fan.""" + super().__init__(*args, **kwargs) + self._cluster_handler = self.cluster_handlers[self._cluster_handler_name] + + def on_add(self) -> None: + """Run when entity is added.""" + super().on_add() + self._on_remove_callbacks.append( + self._cluster_handler.on_event( + CLUSTER_HANDLER_COMMAND_EVENT, + self.handle_cluster_handler_command, + ) + ) + + def handle_cluster_handler_command( + self, + event: ClusterHandlerCommandEvent, + ) -> None: + """Handle state update from cluster handler.""" + self._trigger_event(event.event, event.data) + + +@STRICT_MATCH(cluster_handler_names=CLIENT_CLUSTER_HANDLER_LEVEL) +class LevelControlEvent(ClusterHandlerEvent): + """Representation of a ZHA fan.""" + + _attr_translation_key = "level_control" + _attr_event_types = [ + "step", + "step_with_on_off", + "stop", + "move", + "move_with_on_off", + "move_to_level", + "move_to_level_with_on_off", + ] + _cluster_handler_name = CLIENT_CLUSTER_HANDLER_LEVEL + + +@STRICT_MATCH(cluster_handler_names=CLIENT_CLUSTER_HANDLER_ON_OFF) +class OnOffEvent(ClusterHandlerEvent): + """Representation of a ZHA fan.""" + + _attr_translation_key = "on_off" + _attr_event_types = [ + "off", + "on", + "toggle", + "off_with_effect", + "on_with_recall_global_scene", + "on_with_timed_off", + ] + _cluster_handler_name = CLIENT_CLUSTER_HANDLER_ON_OFF + + +@STRICT_MATCH(cluster_handler_names=CLIENT_CLUSTER_HANDLER_COLOR) +class ColorEvent(ClusterHandlerEvent): + """Representation of a ZHA fan.""" + + _attr_translation_key = "color" + _attr_event_types = [ + "move_to_hue", + "move_hue", + "step_hue", + "move_to_saturation", + "move_saturation", + "step_saturation", + "move_to_hue_and_saturation", + "move_to_color", + "move_color", + "step_color", + "move_to_color_temp", + "enhanced_move_to_hue", + "enhanced_move_hue", + "enhanced_step_hue", + "enhanced_move_to_hue_and_saturation", + "color_loop_set", + "stop_move_step", + "move_color_temp", + "step_color_temp", + ] + _cluster_handler_name = CLIENT_CLUSTER_HANDLER_COLOR diff --git a/zha/application/platforms/update.py b/zha/application/platforms/update.py index 7c2bedd9b..31bc155c1 100644 --- a/zha/application/platforms/update.py +++ b/zha/application/platforms/update.py @@ -19,9 +19,9 @@ from zha.exceptions import ZHAException from zha.zigbee.cluster_handlers import ClusterAttributeUpdatedEvent from zha.zigbee.cluster_handlers.const import ( + CLIENT_CLUSTER_HANDLER_OTA, CLUSTER_HANDLER_ATTRIBUTE_UPDATED, CLUSTER_HANDLER_OTA, - CLUSTER_HANDLER_OTA_SERVER, ) from zha.zigbee.endpoint import Endpoint @@ -265,7 +265,7 @@ async def on_remove(self) -> None: await super().on_remove() -@CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_OTA) +@CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLIENT_CLUSTER_HANDLER_OTA) class FirmwareUpdateEntity(BaseFirmwareUpdateEntity): """Representation of a ZHA firmware update entity.""" @@ -282,7 +282,7 @@ def __init__( super().__init__(cluster_handlers, endpoint, device, **kwargs) self._ota_cluster_handler: ClusterHandler = self.cluster_handlers[ - CLUSTER_HANDLER_OTA + CLIENT_CLUSTER_HANDLER_OTA ] self._attr_installed_version: str | None = self._get_cluster_version() self._compatible_images: OtaImagesResult = OtaImagesResult( @@ -312,7 +312,7 @@ def _get_cluster_version(self) -> str | None: return None -@CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_OTA_SERVER) +@CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_OTA) class FirmwareUpdateServerEntity(BaseFirmwareUpdateEntity): """Representation of a ZHA firmware update entity.""" @@ -330,7 +330,7 @@ def __init__( # Some devices make it a server cluster, not a client cluster... self._ota_cluster_handler: ClusterHandler = self.cluster_handlers[ - CLUSTER_HANDLER_OTA_SERVER + CLUSTER_HANDLER_OTA ] self._attr_installed_version: str | None = self._get_cluster_version() self._compatible_images: OtaImagesResult = OtaImagesResult( diff --git a/zha/application/registries.py b/zha/application/registries.py index 404afa97f..ee2f88b79 100644 --- a/zha/application/registries.py +++ b/zha/application/registries.py @@ -59,8 +59,10 @@ } SINGLE_OUTPUT_CLUSTER_DEVICE_CLASS = { - zcl.clusters.general.OnOff.cluster_id: Platform.BINARY_SENSOR, - zcl.clusters.security.IasAce.cluster_id: Platform.ALARM_CONTROL_PANEL, + zcl.clusters.lighting.Color.cluster_id: [Platform.EVENT], + zcl.clusters.general.LevelControl.cluster_id: [Platform.EVENT], + zcl.clusters.general.OnOff.cluster_id: [Platform.BINARY_SENSOR, Platform.EVENT], + zcl.clusters.security.IasAce.cluster_id: [Platform.ALARM_CONTROL_PANEL], } DEVICE_CLASS = { diff --git a/zha/zigbee/cluster_handlers/__init__.py b/zha/zigbee/cluster_handlers/__init__.py index 0f5c95b0d..dc2fa1efa 100644 --- a/zha/zigbee/cluster_handlers/__init__.py +++ b/zha/zigbee/cluster_handlers/__init__.py @@ -36,6 +36,7 @@ ATTRIBUTE_NAME, ATTRIBUTE_VALUE, CLUSTER_HANDLER_ATTRIBUTE_UPDATED, + CLUSTER_HANDLER_COMMAND_EVENT, CLUSTER_HANDLER_EVENT, CLUSTER_HANDLER_ZDO, CLUSTER_ID, @@ -90,6 +91,15 @@ async def wrapper(*args: P.args, **kwargs: P.kwargs) -> Any: return wrapper +@dataclass(frozen=True, kw_only=True) +class ClusterHandlerCommandEvent: + """Event to signal that a cluster command was received.""" + + event: str + event_type: Final[str] = "cluster_handler_event" + data: dict[str, Any] + + class AttrReportConfig(TypedDict, total=True): """Configuration to report for the attributes.""" @@ -731,6 +741,11 @@ def __init__(self, *args, **kwargs) -> None: self._generic_id += "_client" self._id += "_client" + @functools.cached_property + def name(self) -> str: + """Return friendly name.""" + return self.cluster.ep_attribute + "_client" or self._generic_id + def attribute_updated(self, attrid: int, value: Any, timestamp: datetime) -> None: """Handle an attribute updated on this cluster.""" super().attribute_updated(attrid, value, timestamp) @@ -752,8 +767,23 @@ def attribute_updated(self, attrid: int, value: Any, timestamp: datetime) -> Non def cluster_command(self, tsn, command_id, args): """Handle a cluster command received on this cluster.""" - if ( - self._cluster.server_commands is not None - and self._cluster.server_commands.get(command_id) is not None - ): - self.emit_zha_event(self._cluster.server_commands[command_id].name, args) + + parse_and_log_command(self, tsn, command_id, args) + + if (command := self._cluster.server_commands.get(command_id)) is None: + return + + # Emit standard zha event + self.emit_zha_event(command.name, args) + + # Some clusters emit empty lists and other types + if isinstance(args, CommandSchema): + data = args.as_dict(skip_missing=True, recursive=True) + else: + data = {} + + # Emit internal parsed event + self.emit( + CLUSTER_HANDLER_COMMAND_EVENT, + ClusterHandlerCommandEvent(event=command.name, data=data), + ) diff --git a/zha/zigbee/cluster_handlers/const.py b/zha/zigbee/cluster_handlers/const.py index 5cdae12c7..f3cff97a7 100644 --- a/zha/zigbee/cluster_handlers/const.py +++ b/zha/zigbee/cluster_handlers/const.py @@ -68,7 +68,6 @@ CLUSTER_HANDLER_OCCUPANCY: Final[str] = "occupancy" CLUSTER_HANDLER_ON_OFF: Final[str] = "on_off" CLUSTER_HANDLER_OTA: Final[str] = "ota" -CLUSTER_HANDLER_OTA_SERVER: Final[str] = "ota_server" CLUSTER_HANDLER_POWER_CONFIGURATION: Final[str] = "power" CLUSTER_HANDLER_PRESSURE: Final[str] = "pressure" CLUSTER_HANDLER_SHADE: Final[str] = "shade" @@ -81,6 +80,11 @@ ZONE: Final[str] = CLUSTER_HANDLER_ZONE CLUSTER_HANDLER_INOVELLI = "inovelli_vzm31sn_cluster" +CLIENT_CLUSTER_HANDLER_COLOR: Final[str] = CLUSTER_HANDLER_COLOR + "_client" +CLIENT_CLUSTER_HANDLER_LEVEL: Final[str] = CLUSTER_HANDLER_LEVEL + "_client" +CLIENT_CLUSTER_HANDLER_ON_OFF: Final[str] = CLUSTER_HANDLER_ON_OFF + "_client" +CLIENT_CLUSTER_HANDLER_OTA: Final[str] = CLUSTER_HANDLER_OTA + "_client" + AQARA_OPPLE_CLUSTER: Final[int] = 0xFCC0 IKEA_AIR_PURIFIER_CLUSTER: Final[int] = 0xFC7D IKEA_REMOTE_CLUSTER: Final[int] = 0xFC80 @@ -101,6 +105,7 @@ CLUSTER_HANDLER_ATTRIBUTE_UPDATED: Final[str] = "cluster_handler_attribute_updated" CLUSTER_HANDLER_STATE_CHANGED: Final[str] = "cluster_handler_state_changed" CLUSTER_HANDLER_LEVEL_CHANGED: Final[str] = "cluster_handler_level_changed" +CLUSTER_HANDLER_COMMAND_EVENT: Final[str] = "cluster_handler_command_event" ATTRIBUTE_ID: Final[str] = "attribute_id" ATTRIBUTE_NAME: Final[str] = "attribute_name"