"""Tint E14 RGB CCT.""" from zigpy.profiles import zgp, zha from zigpy.quirks import CustomCluster, CustomDevice from zigpy.zcl.clusters.general import ( Basic, GreenPowerProxy, Groups, Identify, LevelControl, OnOff, Ota, Scenes, ) from zigpy.zcl.clusters.lighting import Color from zigpy.zcl.clusters.lightlink import LightLink from zhaquirks.const import ( DEVICE_TYPE, ENDPOINTS, INPUT_CLUSTERS, MODELS_INFO, OUTPUT_CLUSTERS, PROFILE_ID, ) class TintManufacturerSpecificCluster(CustomCluster): """Tint manufacturer specific cluster.""" cluster_id = 0x100F # not inside the manufacturer specific cluster range class TintRGBCCTColorCluster(CustomCluster, Color): """Tint RGB+CCT Lighting custom cluster.""" # Set correct capabilities to ct, xy, hs # Tint bulbs do not correctly report this attribute _CONSTANT_ATTRIBUTES = {0x400A: 0b11110} class TintRGBCCTLight(CustomDevice): """Tint E14 RGB+CCT Lighting device.""" signature = { MODELS_INFO: [("MLI", "tint-ExtendedColor")], ENDPOINTS: { 1: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.EXTENDED_COLOR_LIGHT, INPUT_CLUSTERS: [ Basic.cluster_id, Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, OnOff.cluster_id, LevelControl.cluster_id, Color.cluster_id, LightLink.cluster_id, TintManufacturerSpecificCluster.cluster_id, ], OUTPUT_CLUSTERS: [Ota.cluster_id], }, 242: { PROFILE_ID: zgp.PROFILE_ID, DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, }, } replacement = { ENDPOINTS: { 1: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.EXTENDED_COLOR_LIGHT, INPUT_CLUSTERS: [ Basic.cluster_id, Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, OnOff.cluster_id, LevelControl.cluster_id, TintRGBCCTColorCluster, LightLink.cluster_id, TintManufacturerSpecificCluster, ], OUTPUT_CLUSTERS: [Ota.cluster_id], }, 242: { PROFILE_ID: zgp.PROFILE_ID, DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, } }