diff --git a/setup.py b/setup.py index f21605f6e4..1b5a983841 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import find_packages, setup -VERSION = "0.0.100" +VERSION = "0.0.101" setup( @@ -20,6 +20,6 @@ keywords="zha quirks homeassistant hass", packages=find_packages(exclude=["tests"]), python_requires=">=3.8", - install_requires=["zigpy>=0.53"], + install_requires=["zigpy>=0.56.0"], tests_require=["pytest"], ) diff --git a/tests/common.py b/tests/common.py index 9ced1c14ff..dde6ac097c 100644 --- a/tests/common.py +++ b/tests/common.py @@ -15,7 +15,7 @@ def __init__(self, cluster): self.attribute_updates = [] cluster.add_listener(self) - def attribute_updated(self, attr_id, value): + def attribute_updated(self, attr_id, value, timestamp): """Attribute updated listener.""" self.attribute_updates.append((attr_id, value)) diff --git a/tests/test_xiaomi.py b/tests/test_xiaomi.py index dcab84e5a6..bfc3bedc48 100644 --- a/tests/test_xiaomi.py +++ b/tests/test_xiaomi.py @@ -581,88 +581,96 @@ async def test_aqara_feeder_write_attrs( b"\x1c_\x11f\n\xf1\xffA\t\x00\x05\x01\x04\x15\x00U\x01\x01", 2, [ - mock.call(ZCL_FEEDING, True), - mock.call(FEEDER_ATTR, b"\x00\x05\x01\x04\x15\x00U\x01\x01"), + mock.call(ZCL_FEEDING, True, mock.ANY), + mock.call(FEEDER_ATTR, b"\x00\x05\x01\x04\x15\x00U\x01\x01", mock.ANY), ], ), ( b"\x1c_\x11l\n\xf1\xffA\x0c\x00\x05\xd0\x04\x15\x02\xbc\x040203", 3, [ - mock.call(ZCL_LAST_FEEDING_SIZE, 3), - mock.call(ZCL_LAST_FEEDING_SOURCE, OppleCluster.FeedingSource.Remote), - mock.call(FEEDER_ATTR, b"\x00\x05\xd0\x04\x15\x02\xbc\x040203"), + mock.call(ZCL_LAST_FEEDING_SIZE, 3, mock.ANY), + mock.call( + ZCL_LAST_FEEDING_SOURCE, OppleCluster.FeedingSource.Remote, mock.ANY + ), + mock.call( + FEEDER_ATTR, b"\x00\x05\xd0\x04\x15\x02\xbc\x040203", mock.ANY + ), ], ), ( b"\x1c_\x11m\n\xf1\xffA\n\x00\x05\xd1\rh\x00U\x02\x00!", 2, [ - mock.call(ZCL_PORTIONS_DISPENSED, 33), - mock.call(FEEDER_ATTR, b"\x00\x05\xd1\rh\x00U\x02\x00!"), + mock.call(ZCL_PORTIONS_DISPENSED, 33, mock.ANY), + mock.call(FEEDER_ATTR, b"\x00\x05\xd1\rh\x00U\x02\x00!", mock.ANY), ], ), ( b"\x1c_\x11n\n\xf1\xffA\x0c\x00\x05\xd2\ri\x00U\x04\x00\x00\x01\x08", 2, [ - mock.call(ZCL_WEIGHT_DISPENSED, 264), - mock.call(FEEDER_ATTR, b"\x00\x05\xd2\ri\x00U\x04\x00\x00\x01\x08"), + mock.call(ZCL_WEIGHT_DISPENSED, 264, mock.ANY), + mock.call( + FEEDER_ATTR, b"\x00\x05\xd2\ri\x00U\x04\x00\x00\x01\x08", mock.ANY + ), ], ), ( b"\x1c_\x11o\n\xf1\xffA\t\x00\x05\xd3\r\x0b\x00U\x01\x00", 2, [ - mock.call(ZCL_ERROR_DETECTED, False), - mock.call(FEEDER_ATTR, b"\x00\x05\xd3\r\x0b\x00U\x01\x00"), + mock.call(ZCL_ERROR_DETECTED, False, mock.ANY), + mock.call(FEEDER_ATTR, b"\x00\x05\xd3\r\x0b\x00U\x01\x00", mock.ANY), ], ), ( b"\x1c_\x11p\n\xf1\xffA\t\x00\x05\x05\x04\x16\x00U\x01\x01", 2, [ - mock.call(ZCL_CHILD_LOCK, True), - mock.call(FEEDER_ATTR, b"\x00\x05\x05\x04\x16\x00U\x01\x01"), + mock.call(ZCL_CHILD_LOCK, True, mock.ANY), + mock.call(FEEDER_ATTR, b"\x00\x05\x05\x04\x16\x00U\x01\x01", mock.ANY), ], ), ( b"\x1c_\x11r\n\xf1\xffA\t\x00\x05\t\x04\x17\x00U\x01\x01", 2, [ - mock.call(ZCL_DISABLE_LED_INDICATOR, True), - mock.call(FEEDER_ATTR, b"\x00\x05\t\x04\x17\x00U\x01\x01"), + mock.call(ZCL_DISABLE_LED_INDICATOR, True, mock.ANY), + mock.call(FEEDER_ATTR, b"\x00\x05\t\x04\x17\x00U\x01\x01", mock.ANY), ], ), ( b"\x1c_\x11s\n\xf1\xffA\t\x00\x05\x0b\x04\x18\x00U\x01\x01", 2, [ - mock.call(ZCL_FEEDING_MODE, OppleCluster.FeedingMode.Schedule), - mock.call(FEEDER_ATTR, b"\x00\x05\x0b\x04\x18\x00U\x01\x01"), + mock.call( + ZCL_FEEDING_MODE, OppleCluster.FeedingMode.Schedule, mock.ANY + ), + mock.call(FEEDER_ATTR, b"\x00\x05\x0b\x04\x18\x00U\x01\x01", mock.ANY), ], ), ( b"\x1c_\x11u\n\xf1\xffA\t\x00\x05\x0f\x0e_\x00U\x01\x06", 2, [ - mock.call(ZCL_PORTION_WEIGHT, 6), - mock.call(FEEDER_ATTR, b"\x00\x05\x0f\x0e_\x00U\x01\x06"), + mock.call(ZCL_PORTION_WEIGHT, 6, mock.ANY), + mock.call(FEEDER_ATTR, b"\x00\x05\x0f\x0e_\x00U\x01\x06", mock.ANY), ], ), ( b"\x1c_\x11v\n\xf1\xffA\t\x00\x05\x11\x0e\\\x00U\x01\x02", 2, [ - mock.call(ZCL_SERVING_SIZE, 2), - mock.call(FEEDER_ATTR, b"\x00\x05\x11\x0e\\\x00U\x01\x02"), + mock.call(ZCL_SERVING_SIZE, 2, mock.ANY), + mock.call(FEEDER_ATTR, b"\x00\x05\x11\x0e\\\x00U\x01\x02", mock.ANY), ], ), ( b"\x1c_\x11{\n\xf7\x00A\x0e\x05!\x0e\x00\r#!%\x00\x00\t!\x02\x03", 1, [ - mock.call(0x00F7, b"\x05!\x0e\x00\r#!%\x00\x00\t!\x02\x03"), + mock.call(0x00F7, b"\x05!\x0e\x00\r#!%\x00\x00\t!\x02\x03", mock.ANY), ], ), ( @@ -672,6 +680,7 @@ async def test_aqara_feeder_write_attrs( mock.call( FEEDER_ATTR, b"\x00\x05\x15\x08\x00\x08\xc8 7F09000100,7F0D000100,7F13000100", + mock.ANY, ), ], ), diff --git a/zhaquirks/aurora/aurora_dimmer.py b/zhaquirks/aurora/aurora_dimmer.py index 470c9f55e7..17a5fcb6a5 100644 --- a/zhaquirks/aurora/aurora_dimmer.py +++ b/zhaquirks/aurora/aurora_dimmer.py @@ -1,5 +1,5 @@ """Device handler for Aurora dimmer switch, battery powered.""" -from zigpy.profiles import zha +from zigpy.profiles import zgp, zha from zigpy.quirks import CustomDevice from zigpy.zcl.clusters.general import ( Basic, @@ -118,8 +118,8 @@ class WallSwitchColorCluster(EventableCluster, Color): # device_version=0 # input_clusters=[] # output_clusters=[33] - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -165,8 +165,8 @@ class WallSwitchColorCluster(EventableCluster, Color): ], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, diff --git a/zhaquirks/gledopto/glc009p.py b/zhaquirks/gledopto/glc009p.py index f50b14baef..2a8e21af59 100644 --- a/zhaquirks/gledopto/glc009p.py +++ b/zhaquirks/gledopto/glc009p.py @@ -1,5 +1,5 @@ """GLEDOPTO GL-C-009P device.""" -from zigpy.profiles import zha +from zigpy.profiles import zgp, zha from zigpy.quirks import CustomDevice from zigpy.zcl.clusters.general import ( Basic, @@ -48,8 +48,8 @@ class GLC009P(CustomDevice): ], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [ GreenPowerProxy.cluster_id, @@ -77,8 +77,8 @@ class GLC009P(CustomDevice): ], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [ GreenPowerProxy.cluster_id, diff --git a/zhaquirks/ikea/starkvind.py b/zhaquirks/ikea/starkvind.py index 1b30afb188..9e3c1bf591 100644 --- a/zhaquirks/ikea/starkvind.py +++ b/zhaquirks/ikea/starkvind.py @@ -4,7 +4,7 @@ import logging from typing import Any -from zigpy.profiles import zha +from zigpy.profiles import zgp, zha from zigpy.quirks import CustomCluster, CustomDevice import zigpy.types as t from zigpy.zcl.clusters.general import ( @@ -177,8 +177,8 @@ def __init__(self, *args, **kwargs): # device_version=0 # input_clusters=[33] output_clusters=[33]> 242: { - PROFILE_ID: 0xA1E0, # 41440 (dec) - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, # 41440 (dec) + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [ GreenPowerProxy.cluster_id, # 0x0021 = GreenPowerProxy.cluster_id @@ -210,8 +210,8 @@ def __init__(self, *args, **kwargs): # device_version=0 # input_clusters=[33] output_clusters=[33]> 242: { - PROFILE_ID: 0xA1E0, # 41440 (dec) - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, # 41440 (dec) + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [ GreenPowerProxy.cluster_id, # 0x0021 = GreenPowerProxy.cluster_id @@ -253,8 +253,8 @@ class IkeaSTARKVIND_v2(IkeaSTARKVIND): # device_version=0 # input_clusters=[33] output_clusters=[33]> 242: { - PROFILE_ID: 0xA1E0, # 41440 (dec) - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, # 41440 (dec) + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [ GreenPowerProxy.cluster_id, # 0x0021 = GreenPowerProxy.cluster_id @@ -287,8 +287,8 @@ class IkeaSTARKVIND_v2(IkeaSTARKVIND): # device_version=0 # input_clusters=[33] output_clusters=[33]> 242: { - PROFILE_ID: 0xA1E0, # 41440 (dec) - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, # 41440 (dec) + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [ GreenPowerProxy.cluster_id, # 0x0021 = GreenPowerProxy.cluster_id diff --git a/zhaquirks/ikea/tradfriplug.py b/zhaquirks/ikea/tradfriplug.py index aa4dfe597e..ccfcaf2bfc 100644 --- a/zhaquirks/ikea/tradfriplug.py +++ b/zhaquirks/ikea/tradfriplug.py @@ -1,8 +1,9 @@ """Tradfri Plug Quirk.""" -from zigpy.profiles import zha, zll +from zigpy.profiles import zgp, zha, zll from zigpy.quirks import CustomDevice from zigpy.zcl.clusters.general import ( Basic, + GreenPowerProxy, Groups, Identify, LevelControl, @@ -64,10 +65,10 @@ class TradfriPlug(CustomDevice): # device_version=0 # input_clusters=[33] output_clusters=[33]> 242: { - PROFILE_ID: 0xA1E0, - DEVICE_TYPE: 0x0061, - INPUT_CLUSTERS: [33], - OUTPUT_CLUSTERS: [33], + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, + INPUT_CLUSTERS: [GreenPowerProxy.cluster_id], + OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, }, } diff --git a/zhaquirks/iluminize/cct.py b/zhaquirks/iluminize/cct.py index 5950d1f520..3b0c51ae18 100644 --- a/zhaquirks/iluminize/cct.py +++ b/zhaquirks/iluminize/cct.py @@ -1,5 +1,5 @@ """Quirk for iluminize CCT actor.""" -from zigpy.profiles import zll +from zigpy.profiles import zgp, zll from zigpy.quirks import CustomCluster, CustomDevice from zigpy.zcl.clusters.general import ( Basic, @@ -64,8 +64,8 @@ class CCTLight(CustomDevice): # device_version=0 # input_clusters=[33] # output_clusters=[33] - PROFILE_ID: 41440, - DEVICE_TYPE: 102, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.COMBO_BASIC, INPUT_CLUSTERS: [GreenPowerProxy.cluster_id], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -91,8 +91,8 @@ class CCTLight(CustomDevice): OUTPUT_CLUSTERS: [Ota.cluster_id], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 102, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.COMBO_BASIC, INPUT_CLUSTERS: [GreenPowerProxy.cluster_id], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, diff --git a/zhaquirks/iluminize/dim.py b/zhaquirks/iluminize/dim.py index c718cf98b7..69f4a24bd1 100644 --- a/zhaquirks/iluminize/dim.py +++ b/zhaquirks/iluminize/dim.py @@ -1,5 +1,5 @@ """Quirk for iluminize DIM actor.""" -from zigpy.profiles import zha +from zigpy.profiles import zgp, zha from zigpy.quirks import CustomCluster, CustomDevice from zigpy.zcl.clusters.general import ( Basic, @@ -64,8 +64,8 @@ class DIMLight(CustomDevice): # device_version=0 # input_clusters=[33] # output_clusters=[33] - PROFILE_ID: 41440, - DEVICE_TYPE: 102, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.COMBO_BASIC, INPUT_CLUSTERS: [GreenPowerProxy.cluster_id], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -91,8 +91,8 @@ class DIMLight(CustomDevice): OUTPUT_CLUSTERS: [Ota.cluster_id], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 102, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.COMBO_BASIC, INPUT_CLUSTERS: [GreenPowerProxy.cluster_id], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, diff --git a/zhaquirks/innr/innr_sp234_plug.py b/zhaquirks/innr/innr_sp234_plug.py index 6e24f41d59..f0e86f889c 100644 --- a/zhaquirks/innr/innr_sp234_plug.py +++ b/zhaquirks/innr/innr_sp234_plug.py @@ -1,5 +1,5 @@ """Innr SP 234 plug.""" -from zigpy.profiles import zha +from zigpy.profiles import zgp, zha from zigpy.quirks import CustomCluster, CustomDevice from zigpy.zcl.clusters.general import ( Basic, @@ -64,8 +64,8 @@ class SP234(CustomDevice): ], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -98,8 +98,8 @@ class SP234(CustomDevice): ], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, diff --git a/zhaquirks/innr/rs228t.py b/zhaquirks/innr/rs228t.py index a4374cd7e7..32f789dea7 100644 --- a/zhaquirks/innr/rs228t.py +++ b/zhaquirks/innr/rs228t.py @@ -1,5 +1,5 @@ """Innr RS 228 T device.""" -from zigpy.profiles import zha +from zigpy.profiles import zgp, zha from zigpy.profiles.zha import DeviceType from zigpy.quirks import CustomDevice from zigpy.zcl.clusters.general import ( @@ -55,8 +55,8 @@ class RS228T(CustomDevice): # input_clusters=[] # output_clusters=[33]> 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -81,8 +81,8 @@ class RS228T(CustomDevice): OUTPUT_CLUSTERS: [Ota.cluster_id], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, diff --git a/zhaquirks/inovelli/VZM31SN.py b/zhaquirks/inovelli/VZM31SN.py index 02173951e6..829f84ee08 100644 --- a/zhaquirks/inovelli/VZM31SN.py +++ b/zhaquirks/inovelli/VZM31SN.py @@ -1,10 +1,11 @@ """VZM31-SN Two in One Switch/Dimmer Module.""" -from zigpy.profiles import zha +from zigpy.profiles import zgp, zha from zigpy.profiles.zha import DeviceType from zigpy.quirks import CustomDevice from zigpy.zcl.clusters.general import ( Basic, + GreenPowerProxy, Groups, Identify, LevelControl, @@ -70,10 +71,10 @@ class InovelliVZM31SNv12(CustomDevice): ], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], - OUTPUT_CLUSTERS: [0x0021], + OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, }, } @@ -112,10 +113,10 @@ class InovelliVZM31SNv12(CustomDevice): ], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], - OUTPUT_CLUSTERS: [0x0021], + OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, }, } @@ -159,10 +160,10 @@ class InovelliVZM31SNv11(CustomDevice): ], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], - OUTPUT_CLUSTERS: [0x0021], + OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, }, } @@ -205,10 +206,10 @@ class InovelliVZM31SNv11(CustomDevice): ], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], - OUTPUT_CLUSTERS: [0x0021], + OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, }, } diff --git a/zhaquirks/insta/nexentro_pushbutton_interface.py b/zhaquirks/insta/nexentro_pushbutton_interface.py index 0c1badfaca..abb9b5c74e 100644 --- a/zhaquirks/insta/nexentro_pushbutton_interface.py +++ b/zhaquirks/insta/nexentro_pushbutton_interface.py @@ -1,5 +1,5 @@ """Device handler for Insta NEXENTRO Pushbutton Interface.""" -from zigpy.profiles import zha +from zigpy.profiles import zgp, zha from zigpy.quirks import CustomDevice from zigpy.zcl.clusters.closures import WindowCovering from zigpy.zcl.clusters.general import ( @@ -121,8 +121,8 @@ class InstaNexentroPushbuttonInterface(CustomDevice): # input_clusters=[] # output_clusters=[33]> 242: { - PROFILE_ID: 0xA1E0, - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -180,8 +180,8 @@ class InstaNexentroPushbuttonInterface(CustomDevice): ], }, 242: { - PROFILE_ID: 0xA1E0, - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, diff --git a/zhaquirks/legrand/dimmer.py b/zhaquirks/legrand/dimmer.py index e5479ccd06..c063365d2f 100644 --- a/zhaquirks/legrand/dimmer.py +++ b/zhaquirks/legrand/dimmer.py @@ -1,6 +1,6 @@ """Module for Legrand dimmers.""" -from zigpy.profiles import zha +from zigpy.profiles import zgp, zha from zigpy.quirks import CustomDevice from zigpy.zcl.clusters.general import ( Basic, @@ -116,10 +116,10 @@ class DimmerWithoutNeutral2(DimmerWithoutNeutral): ], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], - OUTPUT_CLUSTERS: [0x0021], + OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, }, } @@ -157,10 +157,10 @@ class DimmerWithoutNeutral3(CustomDevice): ], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 0x0066, - INPUT_CLUSTERS: [0x0021], - OUTPUT_CLUSTERS: [0x0021], + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.COMBO_BASIC, + INPUT_CLUSTERS: [GreenPowerProxy.cluster_id], + OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, }, } @@ -193,8 +193,8 @@ class DimmerWithoutNeutral3(CustomDevice): }, # Green Power End Point 242: { - PROFILE_ID: 0xA1E0, - DEVICE_TYPE: 0x0066, # GP Combo Minimum + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.COMBO_BASIC, INPUT_CLUSTERS: [GreenPowerProxy.cluster_id], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -235,10 +235,10 @@ class DimmerWithoutNeutralAndBallast(CustomDevice): ], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 0x0066, - INPUT_CLUSTERS: [0x0021], - OUTPUT_CLUSTERS: [0x0021], + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.COMBO_BASIC, + INPUT_CLUSTERS: [GreenPowerProxy.cluster_id], + OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, }, } @@ -269,8 +269,8 @@ class DimmerWithoutNeutralAndBallast(CustomDevice): }, # Green Power End Point 242: { - PROFILE_ID: 0xA1E0, - DEVICE_TYPE: 0x0066, # GP Combo Minimum + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.COMBO_BASIC, INPUT_CLUSTERS: [GreenPowerProxy.cluster_id], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -308,10 +308,10 @@ class DimmerWithNeutral(DimmerWithoutNeutral): ], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 0x0066, - INPUT_CLUSTERS: [0x0021], - OUTPUT_CLUSTERS: [0x0021], + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.COMBO_BASIC, + INPUT_CLUSTERS: [GreenPowerProxy.cluster_id], + OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, }, } @@ -348,10 +348,10 @@ class DimmerWithNeutral2(CustomDevice): ], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 0x0066, - INPUT_CLUSTERS: [0x0021], - OUTPUT_CLUSTERS: [0x0021], + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.COMBO_BASIC, + INPUT_CLUSTERS: [GreenPowerProxy.cluster_id], + OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, }, } diff --git a/zhaquirks/lidl/TS0501A.py b/zhaquirks/lidl/TS0501A.py index 64b9e4e718..0803440aef 100644 --- a/zhaquirks/lidl/TS0501A.py +++ b/zhaquirks/lidl/TS0501A.py @@ -1,5 +1,5 @@ """Lidl dimmable bulb.""" -from zigpy.profiles import zha +from zigpy.profiles import zgp, zha from zigpy.quirks import CustomDevice from zigpy.zcl.clusters.general import ( Basic, @@ -57,8 +57,8 @@ class DimmableBulb(CustomDevice): # 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, diff --git a/zhaquirks/lixee/zlinky.py b/zhaquirks/lixee/zlinky.py index a2e29e49dc..7695aae031 100644 --- a/zhaquirks/lixee/zlinky.py +++ b/zhaquirks/lixee/zlinky.py @@ -1,7 +1,7 @@ """Quirk for ZLinky_TIC.""" from copy import deepcopy -from zigpy.profiles import zha +from zigpy.profiles import zgp, zha from zigpy.quirks import CustomCluster, CustomDevice import zigpy.types as t from zigpy.zcl.clusters.general import ( @@ -166,8 +166,8 @@ class ZLinkyTIC(CustomDevice): OUTPUT_CLUSTERS: [Ota.cluster_id], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [GreenPowerProxy.cluster_id], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -190,8 +190,8 @@ class ZLinkyTIC(CustomDevice): OUTPUT_CLUSTERS: [Ota.cluster_id], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [GreenPowerProxy.cluster_id], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, diff --git a/zhaquirks/mli/tintE14rgbcct.py b/zhaquirks/mli/tintE14rgbcct.py index 875781109e..b34336dcb2 100644 --- a/zhaquirks/mli/tintE14rgbcct.py +++ b/zhaquirks/mli/tintE14rgbcct.py @@ -1,5 +1,5 @@ """Tint E14 RGB CCT.""" -from zigpy.profiles import zha +from zigpy.profiles import zgp, zha from zigpy.quirks import CustomCluster, CustomDevice from zigpy.zcl.clusters.general import ( Basic, @@ -61,8 +61,8 @@ class TintRGBCCTLight(CustomDevice): OUTPUT_CLUSTERS: [Ota.cluster_id], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -88,8 +88,8 @@ class TintRGBCCTLight(CustomDevice): OUTPUT_CLUSTERS: [Ota.cluster_id], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, diff --git a/zhaquirks/nodon/switch.py b/zhaquirks/nodon/switch.py index 4bdc2cc1fb..dbb1684920 100644 --- a/zhaquirks/nodon/switch.py +++ b/zhaquirks/nodon/switch.py @@ -1,5 +1,5 @@ """NodOn on/off switch two channels.""" -from zigpy.profiles import zha +from zigpy.profiles import zgp, zha from zigpy.quirks import CustomDevice from zigpy.zcl.clusters.general import ( Basic, @@ -79,8 +79,8 @@ class NodOnSIN4220(CustomDevice): # input_clusters=[33] # output_clusters=[33] 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 102, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.COMBO_BASIC, INPUT_CLUSTERS: [GreenPowerProxy.cluster_id], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -124,8 +124,8 @@ class NodOnSIN4220(CustomDevice): ], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 102, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.COMBO_BASIC, INPUT_CLUSTERS: [GreenPowerProxy.cluster_id], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, diff --git a/zhaquirks/siglis/zigfred.py b/zhaquirks/siglis/zigfred.py index 8f99147dce..89475965ee 100644 --- a/zhaquirks/siglis/zigfred.py +++ b/zhaquirks/siglis/zigfred.py @@ -2,7 +2,7 @@ import logging from typing import Any, List, Optional, Union -from zigpy.profiles import zha +from zigpy.profiles import zgp, zha from zigpy.quirks import CustomCluster, CustomDevice import zigpy.types as t from zigpy.zcl import foundation @@ -187,8 +187,8 @@ def __init__(self, *args, **kwargs): # device_version=0, # input_clusters=[], # output_clusters=[33]) - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -236,8 +236,8 @@ def __init__(self, *args, **kwargs): ], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -414,8 +414,8 @@ def __init__(self, *args, **kwargs): # device_version=0, # input_clusters=[], # output_clusters=[33]) - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -510,8 +510,8 @@ def __init__(self, *args, **kwargs): ], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, diff --git a/zhaquirks/sinope/sensor.py b/zhaquirks/sinope/sensor.py index 2048d9aecc..7e38de7917 100644 --- a/zhaquirks/sinope/sensor.py +++ b/zhaquirks/sinope/sensor.py @@ -45,8 +45,8 @@ class SinopeManufacturerCluster(CustomCluster): class SinopeTechnologiesIasZoneCluster(CustomCluster, IasZone): """SinopeTechnologiesIasZoneCluster custom cluster.""" - class ZoneStatus(t.enum8): - """zone_status values.""" + class LeakStatus(t.enum8): + """leak_status values.""" Dry = 0x00 Leak = 0x01 @@ -54,7 +54,7 @@ class ZoneStatus(t.enum8): attributes = IasZone.attributes.copy() attributes.update( { - 0x0030: ("zone_status", ZoneStatus, True), + 0x0030: ("leak_status", LeakStatus, True), } ) diff --git a/zhaquirks/smartwings/wm25lz.py b/zhaquirks/smartwings/wm25lz.py index a394e92ddb..b761a19f54 100644 --- a/zhaquirks/smartwings/wm25lz.py +++ b/zhaquirks/smartwings/wm25lz.py @@ -40,7 +40,6 @@ async def command( *args, manufacturer: int | t.uint16_t | None = None, expect_reply: bool = True, - tries: int = 1, tsn: int | t.uint8_t | None = None, **kwargs: Any, ) -> Coroutine: @@ -56,7 +55,6 @@ async def command( *args, manufacturer=manufacturer, expect_reply=expect_reply, - tries=tries, tsn=tsn, **kwargs, ) diff --git a/zhaquirks/texasinstruments/router.py b/zhaquirks/texasinstruments/router.py index ea7e39532d..fd65bacb0f 100644 --- a/zhaquirks/texasinstruments/router.py +++ b/zhaquirks/texasinstruments/router.py @@ -1,5 +1,5 @@ """Texas Instruments Z-Stack router device.""" -from zigpy.profiles import zha +from zigpy.profiles import zgp, zha from zigpy.quirks import CustomCluster, CustomDevice import zigpy.types as t from zigpy.zcl.clusters.general import Basic, GreenPowerProxy, Identify @@ -39,8 +39,8 @@ class TiRouter(CustomDevice): ], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -60,8 +60,8 @@ class TiRouter(CustomDevice): ], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, diff --git a/zhaquirks/tuya/air/ts0601_air_quality.py b/zhaquirks/tuya/air/ts0601_air_quality.py index 8642afba87..dafd9b23d7 100644 --- a/zhaquirks/tuya/air/ts0601_air_quality.py +++ b/zhaquirks/tuya/air/ts0601_air_quality.py @@ -1,6 +1,6 @@ """Tuya Air Quality sensor.""" -from zigpy.profiles import zha +from zigpy.profiles import zgp, zha from zigpy.quirks import CustomDevice from zigpy.zcl.clusters.general import Basic, GreenPowerProxy, Groups, Ota, Scenes, Time @@ -103,8 +103,8 @@ class TuyaCO2SensorGPP(CustomDevice): # 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -116,8 +116,8 @@ class Switch_1G_Metering(EnchantedDevice): # input_clusters=[] # output_clusters=["0x0021"]> 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -189,8 +189,8 @@ class Switch_2G_GPP(EnchantedDevice): # input_clusters=[] # output_clusters=[33]> 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -224,8 +224,8 @@ class Switch_2G_GPP(EnchantedDevice): OUTPUT_CLUSTERS: [], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -276,8 +276,8 @@ class Switch_2G_Metering(EnchantedDevice): # input_clusters=[] # output_clusters=["0x0021"]> 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -312,8 +312,8 @@ class Switch_2G_Metering(EnchantedDevice): OUTPUT_CLUSTERS: [], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -367,8 +367,8 @@ class Switch_2G_Var03(EnchantedDevice): # input_clusters=[] # output_clusters=[33]> 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -404,8 +404,8 @@ class Switch_2G_Var03(EnchantedDevice): OUTPUT_CLUSTERS: [], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -472,8 +472,8 @@ class Switch_3G_GPP(EnchantedDevice): # input_clusters=[] # output_clusters=[33]> 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -518,8 +518,8 @@ class Switch_3G_GPP(EnchantedDevice): OUTPUT_CLUSTERS: [], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -583,8 +583,8 @@ class Switch_3G_Metering(EnchantedDevice): # input_clusters=[] # output_clusters=["0x0021"]> 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -629,8 +629,8 @@ class Switch_3G_Metering(EnchantedDevice): OUTPUT_CLUSTERS: [], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -712,8 +712,8 @@ class Switch_4G_GPP(EnchantedDevice): # input_clusters=[] # output_clusters=[33]> 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -769,8 +769,8 @@ class Switch_4G_GPP(EnchantedDevice): OUTPUT_CLUSTERS: [], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -847,8 +847,8 @@ class Switch_4G_Metering(EnchantedDevice): # input_clusters=[] # output_clusters=["0x0021"]> 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -903,8 +903,8 @@ class Switch_4G_Metering(EnchantedDevice): OUTPUT_CLUSTERS: [], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, diff --git a/zhaquirks/tuya/ts011f_plug.py b/zhaquirks/tuya/ts011f_plug.py index ac4558df0d..dbf501b650 100644 --- a/zhaquirks/tuya/ts011f_plug.py +++ b/zhaquirks/tuya/ts011f_plug.py @@ -1,6 +1,6 @@ """TS011F plug.""" -from zigpy.profiles import zha +from zigpy.profiles import zgp, zha from zigpy.quirks import CustomDevice from zigpy.zcl.clusters.general import ( Basic, @@ -68,8 +68,8 @@ class Plug(EnchantedDevice): # input_clusters=[] # output_clusters=[33]> 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -124,8 +124,8 @@ class Plug_1AC(CustomDevice): # input_clusters=[] # output_clusters=[33]> 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -146,8 +146,8 @@ class Plug_1AC(CustomDevice): OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -229,8 +229,8 @@ class Plug_2AC_2USB(EnchantedDevice): # input_clusters=[] # output_clusters=[33]> 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -283,8 +283,8 @@ class Plug_2AC_2USB(EnchantedDevice): OUTPUT_CLUSTERS: [], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -349,8 +349,8 @@ class Plug_3AC_4USB(CustomDevice): # input_clusters=[] # output_clusters=[33]> 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -393,8 +393,8 @@ class Plug_3AC_4USB(CustomDevice): OUTPUT_CLUSTERS: [], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -499,8 +499,8 @@ class Plug_4AC_2USB(CustomDevice): # input_clusters=[] # output_clusters=[33]> 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -575,8 +575,8 @@ class Plug_4AC_2USB(CustomDevice): OUTPUT_CLUSTERS: [], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -630,8 +630,8 @@ class Plug_TZ3210_2AC(CustomDevice): # input_clusters=[] # output_clusters=[33]> 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -668,8 +668,8 @@ class Plug_TZ3210_2AC(CustomDevice): OUTPUT_CLUSTERS: [], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -707,8 +707,8 @@ class Plug_TZ3210_1AC(CustomDevice): # input_clusters=[] # output_clusters=[33]> 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -733,8 +733,8 @@ class Plug_TZ3210_1AC(CustomDevice): OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -831,8 +831,8 @@ class Plug_4AC_2USB_cfnprab5(EnchantedDevice): # input_clusters=[] # output_clusters=[33]> 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -899,8 +899,8 @@ class Plug_4AC_2USB_cfnprab5(EnchantedDevice): OUTPUT_CLUSTERS: [], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -969,8 +969,8 @@ class Plug_4AC_2USB_Metering(EnchantedDevice): # "device_type": "0x0061", # "in_clusters": [], # "out_clusters": ["0x0021"] - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -1017,8 +1017,8 @@ class Plug_4AC_2USB_Metering(EnchantedDevice): OUTPUT_CLUSTERS: [], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -1177,8 +1177,8 @@ class Plug_CB_Metering(EnchantedDevice): # input_clusters=[] # output_clusters=[33]> 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -1203,8 +1203,8 @@ class Plug_CB_Metering(EnchantedDevice): OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -1258,8 +1258,8 @@ class Plug_2AC_var05(EnchantedDevice): # "device_type": "0x0061", # "in_clusters": [], # "out_clusters": ["0x0021"] - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -1295,8 +1295,8 @@ class Plug_2AC_var05(EnchantedDevice): OUTPUT_CLUSTERS: [], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, diff --git a/zhaquirks/tuya/ts011f_switch.py b/zhaquirks/tuya/ts011f_switch.py index 96e5c46935..950f08fc2c 100644 --- a/zhaquirks/tuya/ts011f_switch.py +++ b/zhaquirks/tuya/ts011f_switch.py @@ -1,6 +1,6 @@ """Tuya TS011F Switches.""" -from zigpy.profiles import zha +from zigpy.profiles import zgp, zha from zigpy.zcl.clusters.general import ( Basic, GreenPowerProxy, @@ -71,8 +71,8 @@ class Tuya_2G_Switch(TuyaSwitch): # input_clusters=[] # output_clusters=[33]> 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -108,8 +108,8 @@ class Tuya_2G_Switch(TuyaSwitch): OUTPUT_CLUSTERS: [], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, diff --git a/zhaquirks/tuya/ts0121_plug.py b/zhaquirks/tuya/ts0121_plug.py index a1351a6bf4..286fe57075 100644 --- a/zhaquirks/tuya/ts0121_plug.py +++ b/zhaquirks/tuya/ts0121_plug.py @@ -1,7 +1,16 @@ """Tuya TS0121 plug.""" -from zigpy.profiles import zha +from zigpy.profiles import zgp, zha from zigpy.quirks import CustomDevice -from zigpy.zcl.clusters.general import Basic, Groups, Identify, OnOff, Ota, Scenes, Time +from zigpy.zcl.clusters.general import ( + Basic, + GreenPowerProxy, + Groups, + Identify, + OnOff, + Ota, + Scenes, + Time, +) from zigpy.zcl.clusters.homeautomation import ElectricalMeasurement from zigpy.zcl.clusters.smartenergy import Metering @@ -90,10 +99,10 @@ class TS0121B(CustomDevice): OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id], }, 242: { - PROFILE_ID: 0xA1E0, - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], - OUTPUT_CLUSTERS: [0x0021], + OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, }, } @@ -116,10 +125,10 @@ class TS0121B(CustomDevice): OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id], }, 242: { - PROFILE_ID: 0xA1E0, - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], - OUTPUT_CLUSTERS: [0x0021], + OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, }, } @@ -151,14 +160,14 @@ class TS0121_Var03(CustomDevice): OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id], }, 242: { - # "profile_id": 41440, + # "profile_id": "0xA1E0", # "device_type": "0x0061", # "in_clusters": [], # "out_clusters": ["0x0021"] - PROFILE_ID: 0xA1E0, - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], - OUTPUT_CLUSTERS: [0x0021], + OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, }, } @@ -178,10 +187,10 @@ class TS0121_Var03(CustomDevice): OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id], }, 242: { - PROFILE_ID: 0xA1E0, - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], - OUTPUT_CLUSTERS: [0x0021], + OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, }, } diff --git a/zhaquirks/tuya/ts0501b.py b/zhaquirks/tuya/ts0501b.py index ece26ef329..80db73b632 100644 --- a/zhaquirks/tuya/ts0501b.py +++ b/zhaquirks/tuya/ts0501b.py @@ -1,5 +1,5 @@ """Tuya dimmable led controller.""" -from zigpy.profiles import zha +from zigpy.profiles import zgp, zha from zigpy.quirks import CustomCluster, CustomDevice from zigpy.zcl.clusters.general import ( Basic, @@ -59,8 +59,8 @@ class DimmableLedController(CustomDevice): # 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -214,8 +214,8 @@ class TuyaTS130FTOGP(CustomDevice): ], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -329,8 +329,8 @@ class TuyaTS130GP(CustomDevice): # 242: { - PROFILE_ID: XIAOMI_PROFILE_ID, - DEVICE_TYPE: XIAOMI_DEVICE_TYPE, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, }, @@ -155,8 +153,8 @@ def __init__(self, *args, **kwargs): INPUT_CLUSTERS: [AnalogInputCluster], }, 242: { - PROFILE_ID: XIAOMI_PROFILE_ID, - DEVICE_TYPE: XIAOMI_DEVICE_TYPE, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, }, @@ -210,8 +208,8 @@ class PlugMMEU01Alt1(PlugMMEU01): # input_clusters=[] # output_clusters=[33]> 242: { - PROFILE_ID: XIAOMI_PROFILE_ID, - DEVICE_TYPE: XIAOMI_DEVICE_TYPE, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, }, @@ -249,8 +247,8 @@ class PlugMMEU01Alt2(PlugMMEU01): # input_clusters=[] # output_clusters=[33]> 242: { - PROFILE_ID: XIAOMI_PROFILE_ID, - DEVICE_TYPE: XIAOMI_DEVICE_TYPE, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, }, @@ -306,8 +304,8 @@ class PlugMMEU01Alt3(PlugMMEU01): # input_clusters=[] # output_clusters=[33]> 242: { - PROFILE_ID: XIAOMI_PROFILE_ID, - DEVICE_TYPE: XIAOMI_DEVICE_TYPE, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, }, diff --git a/zhaquirks/xiaomi/aqara/roller_curtain_e1.py b/zhaquirks/xiaomi/aqara/roller_curtain_e1.py index 0adb57970b..cbeb2d55d4 100644 --- a/zhaquirks/xiaomi/aqara/roller_curtain_e1.py +++ b/zhaquirks/xiaomi/aqara/roller_curtain_e1.py @@ -4,7 +4,7 @@ from typing import Any from zigpy import types as t -from zigpy.profiles import zha +from zigpy.profiles import zgp, zha from zigpy.zcl import foundation from zigpy.zcl.clusters.closures import WindowCovering from zigpy.zcl.clusters.general import ( @@ -100,7 +100,6 @@ async def command( *args: Any, manufacturer: int | t.uint16_t | None = None, expect_reply: bool = True, - tries: int = 1, tsn: int | t.uint8_t | None = None, **kwargs: Any, ) -> Any: @@ -212,8 +211,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # input_clusters=[] # output_clusters=[33]> 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [ GreenPowerProxy.cluster_id, @@ -245,8 +244,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: ], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [ GreenPowerProxy.cluster_id, @@ -291,8 +290,8 @@ class RollerE1AQ_2(RollerE1AQ): # input_clusters=[] # output_clusters=[33]> 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [ GreenPowerProxy.cluster_id, @@ -337,8 +336,8 @@ class RollerE1AQ_3(RollerE1AQ): # input_clusters=[] # output_clusters=[33]> 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [ GreenPowerProxy.cluster_id, diff --git a/zhaquirks/xiaomi/aqara/switch_h1.py b/zhaquirks/xiaomi/aqara/switch_h1.py index bb7184bd14..1932eb7910 100644 --- a/zhaquirks/xiaomi/aqara/switch_h1.py +++ b/zhaquirks/xiaomi/aqara/switch_h1.py @@ -1,4 +1,4 @@ -from zigpy.profiles import zha +from zigpy.profiles import zgp, zha from zigpy.quirks import CustomDevice from zigpy.zcl.clusters.general import ( Alarms, @@ -101,8 +101,8 @@ class AqaraH1SingleRockerSwitchWithNeutral(AqaraH1SingleRockerBase): ], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [ GreenPowerProxy.cluster_id, # 0x0021 @@ -143,8 +143,8 @@ class AqaraH1SingleRockerSwitchWithNeutral(AqaraH1SingleRockerBase): OUTPUT_CLUSTERS: [], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], }, @@ -177,8 +177,8 @@ class AqaraH1SingleRockerSwitchNoNeutral(AqaraH1SingleRockerBase): ], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 0x0061, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [ GreenPowerProxy.cluster_id, # 0x0021 @@ -217,8 +217,8 @@ class AqaraH1SingleRockerSwitchNoNeutral(AqaraH1SingleRockerBase): OUTPUT_CLUSTERS: [], }, 242: { - PROFILE_ID: 41440, - DEVICE_TYPE: 97, + PROFILE_ID: zgp.PROFILE_ID, + DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], },