"""Device handler for IKEA of Sweden TRADFRI remote control.""" from zigpy.profiles import zha from zigpy.quirks import CustomDevice from zigpy.zcl.clusters.general import ( Alarms, Basic, Groups, Identify, LevelControl, OnOff, Ota, PollControl, PowerConfiguration, ) from zigpy.zcl.clusters.homeautomation import Diagnostic from zigpy.zcl.clusters.lightlink import LightLink from zhaquirks.const import ( DEVICE_TYPE, ENDPOINTS, INPUT_CLUSTERS, MODELS_INFO, OUTPUT_CLUSTERS, PROFILE_ID, ) from zhaquirks.ikea import ( IKEA, IKEA_CLUSTER_ID, WWAH_CLUSTER_ID, DoublingPowerConfig2CRCluster, ) class IkeaTradfriMotionE1745_Var01(CustomDevice): """Custom device representing IKEA of Sweden TRADFRI motion sensor E1745 second gen variation 1.""" signature = { # MODELS_INFO: [(IKEA, "TRADFRI motion sensor")], ENDPOINTS: { 1: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.ON_OFF_SENSOR, INPUT_CLUSTERS: [ Basic.cluster_id, PowerConfiguration.cluster_id, Identify.cluster_id, Alarms.cluster_id, Diagnostic.cluster_id, LightLink.cluster_id, ], OUTPUT_CLUSTERS: [ Identify.cluster_id, Groups.cluster_id, OnOff.cluster_id, Ota.cluster_id, LightLink.cluster_id, ], } }, } replacement = { ENDPOINTS: { 1: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.ON_OFF_SENSOR, INPUT_CLUSTERS: [ Basic.cluster_id, DoublingPowerConfig2CRCluster, Identify.cluster_id, Alarms.cluster_id, Diagnostic.cluster_id, LightLink.cluster_id, ], OUTPUT_CLUSTERS: [ Identify.cluster_id, Groups.cluster_id, OnOff.cluster_id, Ota.cluster_id, LightLink.cluster_id, ], } } } class IkeaTradfriMotionE1745_Var02(CustomDevice): """Custom device representing IKEA of Sweden TRADFRI motion sensor E1745 second gen variation 2.""" signature = { # MODELS_INFO: [(IKEA, "TRADFRI motion sensor")], ENDPOINTS: { 1: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.ON_OFF_SENSOR, INPUT_CLUSTERS: [ Basic.cluster_id, PowerConfiguration.cluster_id, Identify.cluster_id, Alarms.cluster_id, PollControl.cluster_id, LightLink.cluster_id, IKEA_CLUSTER_ID, ], OUTPUT_CLUSTERS: [ Identify.cluster_id, Groups.cluster_id, OnOff.cluster_id, LevelControl.cluster_id, Ota.cluster_id, LightLink.cluster_id, ], } }, } replacement = { ENDPOINTS: { 1: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.ON_OFF_SENSOR, INPUT_CLUSTERS: [ Basic.cluster_id, DoublingPowerConfig2CRCluster, Identify.cluster_id, Alarms.cluster_id, PollControl.cluster_id, LightLink.cluster_id, IKEA_CLUSTER_ID, ], OUTPUT_CLUSTERS: [ Identify.cluster_id, Groups.cluster_id, OnOff.cluster_id, LevelControl.cluster_id, Ota.cluster_id, LightLink.cluster_id, ], } } } class IkeaTradfriMotionE1525_Var01(CustomDevice): """Custom device representing IKEA of Sweden TRADFRI motion sensor E1525 first gen variation 1.""" signature = { # MODELS_INFO: [(IKEA, "TRADFRI motion sensor")], ENDPOINTS: { 1: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.ON_OFF_SENSOR, INPUT_CLUSTERS: [ Basic.cluster_id, PowerConfiguration.cluster_id, Identify.cluster_id, PollControl.cluster_id, LightLink.cluster_id, IKEA_CLUSTER_ID, WWAH_CLUSTER_ID, ], OUTPUT_CLUSTERS: [ Identify.cluster_id, Groups.cluster_id, OnOff.cluster_id, Ota.cluster_id, LightLink.cluster_id, ], } }, } replacement = { ENDPOINTS: { 1: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.ON_OFF_SENSOR, INPUT_CLUSTERS: [ Basic.cluster_id, DoublingPowerConfig2CRCluster, Identify.cluster_id, PollControl.cluster_id, LightLink.cluster_id, IKEA_CLUSTER_ID, WWAH_CLUSTER_ID, ], OUTPUT_CLUSTERS: [ Identify.cluster_id, Groups.cluster_id, OnOff.cluster_id, Ota.cluster_id, LightLink.cluster_id, ], } } }