"""Quirk for FeiBit light switches to remove the LevelControl cluster.""" from zigpy.profiles import zll from zigpy.quirks import CustomDevice from zigpy.zcl.clusters.general import ( Basic, Groups, Identify, LevelControl, OnOff, Ota, Scenes, ) from zigpy.zcl.clusters.lightlink import LightLink from zhaquirks.const import ( DEVICE_TYPE, ENDPOINTS, INPUT_CLUSTERS, MODELS_INFO, OUTPUT_CLUSTERS, PROFILE_ID, ) from zhaquirks.feibit import FEIBIT class FeiBitOneWaySwitch(CustomDevice): """FeiBit FNB56-ZSW01LX2.0 custom device implementation.""" signature = { MODELS_INFO: [(FEIBIT, "FNB56-ZSW01LX2.0")], ENDPOINTS: { 11: { PROFILE_ID: zll.PROFILE_ID, DEVICE_TYPE: zll.DeviceType.ON_OFF_LIGHT, INPUT_CLUSTERS: [ Basic.cluster_id, Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, OnOff.cluster_id, LevelControl.cluster_id, LightLink.cluster_id, ], OUTPUT_CLUSTERS: [ Ota.cluster_id, ], } }, } replacement = { ENDPOINTS: { 11: { PROFILE_ID: zll.PROFILE_ID, DEVICE_TYPE: zll.DeviceType.ON_OFF_LIGHT, INPUT_CLUSTERS: [ Basic.cluster_id, Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, OnOff.cluster_id, LightLink.cluster_id, ], OUTPUT_CLUSTERS: [ Ota.cluster_id, ], } } } class FeiBitTwoWaySwitch(CustomDevice): """FeiBit FNB56-ZSW02LX2.0 custom device implementation.""" signature = { MODELS_INFO: [(FEIBIT, "FNB56-ZSW02LX2.0")], ENDPOINTS: { 11: { PROFILE_ID: zll.PROFILE_ID, DEVICE_TYPE: zll.DeviceType.ON_OFF_LIGHT, INPUT_CLUSTERS: [ Basic.cluster_id, Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, OnOff.cluster_id, LevelControl.cluster_id, LightLink.cluster_id, ], OUTPUT_CLUSTERS: [ Ota.cluster_id, ], }, 12: { PROFILE_ID: zll.PROFILE_ID, DEVICE_TYPE: zll.DeviceType.ON_OFF_LIGHT, INPUT_CLUSTERS: [ Basic.cluster_id, Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, OnOff.cluster_id, LevelControl.cluster_id, ], OUTPUT_CLUSTERS: [ Ota.cluster_id, ], }, }, } replacement = { ENDPOINTS: { 11: { PROFILE_ID: zll.PROFILE_ID, DEVICE_TYPE: zll.DeviceType.ON_OFF_LIGHT, INPUT_CLUSTERS: [ Basic.cluster_id, Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, OnOff.cluster_id, LightLink.cluster_id, ], OUTPUT_CLUSTERS: [ Ota.cluster_id, ], }, 12: { PROFILE_ID: zll.PROFILE_ID, DEVICE_TYPE: zll.DeviceType.ON_OFF_LIGHT, INPUT_CLUSTERS: [ Basic.cluster_id, Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, OnOff.cluster_id, ], OUTPUT_CLUSTERS: [ Ota.cluster_id, ], }, } } class FeiBitThreeWaySwitch(CustomDevice): """FeiBit FNB56-ZSW03LX2.0 custom device implementation.""" signature = { MODELS_INFO: [(FEIBIT, "FNB56-ZSW03LX2.0")], ENDPOINTS: { 1: { PROFILE_ID: zll.PROFILE_ID, DEVICE_TYPE: zll.DeviceType.ON_OFF_LIGHT, INPUT_CLUSTERS: [ Basic.cluster_id, Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, OnOff.cluster_id, LevelControl.cluster_id, LightLink.cluster_id, ], OUTPUT_CLUSTERS: [Ota.cluster_id], }, 2: { PROFILE_ID: zll.PROFILE_ID, DEVICE_TYPE: zll.DeviceType.ON_OFF_LIGHT, INPUT_CLUSTERS: [ Basic.cluster_id, Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, OnOff.cluster_id, LevelControl.cluster_id, ], OUTPUT_CLUSTERS: [Ota.cluster_id], }, 3: { PROFILE_ID: zll.PROFILE_ID, DEVICE_TYPE: zll.DeviceType.ON_OFF_LIGHT, INPUT_CLUSTERS: [ Basic.cluster_id, Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, OnOff.cluster_id, LevelControl.cluster_id, ], OUTPUT_CLUSTERS: [Ota.cluster_id], }, }, } replacement = { ENDPOINTS: { 1: { PROFILE_ID: zll.PROFILE_ID, DEVICE_TYPE: zll.DeviceType.ON_OFF_LIGHT, INPUT_CLUSTERS: [ Basic.cluster_id, Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, OnOff.cluster_id, LightLink.cluster_id, ], OUTPUT_CLUSTERS: [Ota.cluster_id], }, 2: { PROFILE_ID: zll.PROFILE_ID, DEVICE_TYPE: zll.DeviceType.ON_OFF_LIGHT, INPUT_CLUSTERS: [ Basic.cluster_id, Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, OnOff.cluster_id, ], OUTPUT_CLUSTERS: [Ota.cluster_id], }, 3: { PROFILE_ID: zll.PROFILE_ID, DEVICE_TYPE: zll.DeviceType.ON_OFF_LIGHT, INPUT_CLUSTERS: [ Basic.cluster_id, Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, OnOff.cluster_id, ], OUTPUT_CLUSTERS: [Ota.cluster_id], }, }, }