Skip to content

Commit

Permalink
Merge branch 'release/0.0.101'
Browse files Browse the repository at this point in the history
  • Loading branch information
dmulcahey committed Jun 7, 2023
2 parents cdc900f + 2375d90 commit a6d414d
Show file tree
Hide file tree
Showing 46 changed files with 413 additions and 399 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from setuptools import find_packages, setup

VERSION = "0.0.100"
VERSION = "0.0.101"


setup(
Expand All @@ -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"],
)
2 changes: 1 addition & 1 deletion tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
53 changes: 31 additions & 22 deletions tests/test_xiaomi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
],
),
(
Expand All @@ -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,
),
],
),
Expand Down
10 changes: 5 additions & 5 deletions zhaquirks/aurora/aurora_dimmer.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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],
},
Expand Down Expand Up @@ -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],
},
Expand Down
10 changes: 5 additions & 5 deletions zhaquirks/gledopto/glc009p.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
18 changes: 9 additions & 9 deletions zhaquirks/ikea/starkvind.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions zhaquirks/ikea/tradfriplug.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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],
},
},
}
Expand Down
10 changes: 5 additions & 5 deletions zhaquirks/iluminize/cct.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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],
},
Expand All @@ -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],
},
Expand Down
10 changes: 5 additions & 5 deletions zhaquirks/iluminize/dim.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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],
},
Expand All @@ -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],
},
Expand Down
10 changes: 5 additions & 5 deletions zhaquirks/innr/innr_sp234_plug.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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],
},
Expand Down Expand Up @@ -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],
},
Expand Down
Loading

0 comments on commit a6d414d

Please sign in to comment.