"""Device handler for IKEA of Sweden TRADFRI remote control.""" from zigpy.profiles import zll from zigpy.quirks import CustomDevice from zigpy.zcl.clusters.general import ( Alarms, Basic, Groups, Identify, OnOff, Ota, 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, DoublingPowerConfig2CRCluster class IkeaTradfriMotion(CustomDevice): """Custom device representing IKEA of Sweden TRADFRI remote control.""" signature = { # MODELS_INFO: [(IKEA, "TRADFRI motion sensor")], ENDPOINTS: { 1: { PROFILE_ID: zll.PROFILE_ID, DEVICE_TYPE: zll.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: zll.PROFILE_ID, DEVICE_TYPE: zll.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, ], } } }