Skip to content

Commit 47fe8f3

Browse files
committed
Merge branch 'release/0.0.27'
2 parents 178708e + 93f657a commit 47fe8f3

File tree

13 files changed

+262
-30
lines changed

13 files changed

+262
-30
lines changed

script/check_format

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ cd "$(dirname "$0")/.."
66
black \
77
--check \
88
--fast \
9-
--quiet \
109
zhaquirks tests script *.py

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from setuptools import find_packages, setup
44

5-
VERSION = "0.0.26"
5+
VERSION = "0.0.27"
66

77

88
def readme():

zhaquirks/centralite/__init__.py

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,20 @@ class PowerConfigurationCluster(CustomCluster, PowerConfiguration):
1515
cluster_id = PowerConfiguration.cluster_id
1616
BATTERY_VOLTAGE_ATTR = 0x0020
1717
BATTERY_PERCENTAGE_REMAINING = 0x0021
18-
MIN_VOLTS = 15
19-
MAX_VOLTS = 28
18+
MIN_VOLTS = 21
19+
MAX_VOLTS = 31
2020
VOLTS_TO_PERCENT = {
21-
28: 100,
22-
27: 100,
23-
26: 100,
24-
25: 90,
25-
24: 90,
26-
23: 70,
27-
22: 70,
28-
21: 50,
29-
20: 50,
30-
19: 30,
31-
18: 30,
32-
17: 15,
33-
16: 1,
34-
15: 0,
21+
31: 100,
22+
30: 90,
23+
29: 80,
24+
28: 70,
25+
27: 60,
26+
26: 50,
27+
25: 40,
28+
24: 30,
29+
23: 20,
30+
22: 10,
31+
21: 0,
3532
}
3633

3734
def _update_attribute(self, attrid, value):

zhaquirks/const.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
COMMAND_ID = "command_id"
2525
COMMAND_MOVE = "move"
2626
COMMAND_MOVE_ON_OFF = "move_with_on_off"
27+
COMMAND_MOVE_TO_LEVEL_ON_OFF = "move_to_level_with_on_off"
2728
COMMAND_OFF = "off"
2829
COMMAND_OFF_WITH_EFFECT = "off_with_effect"
2930
COMMAND_ON = "on"

zhaquirks/lutron/lzl4bwhl01remote.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,24 @@
1414
from zhaquirks import GroupBoundCluster
1515

1616
from ..const import (
17+
ARGS,
18+
CLUSTER_ID,
19+
COMMAND,
20+
COMMAND_MOVE_TO_LEVEL_ON_OFF,
21+
COMMAND_STEP,
22+
COMMAND_STEP_ON_OFF,
1723
DEVICE_TYPE,
24+
DIM_DOWN,
25+
DIM_UP,
26+
ENDPOINT_ID,
1827
ENDPOINTS,
1928
INPUT_CLUSTERS,
2029
MODELS_INFO,
2130
OUTPUT_CLUSTERS,
2231
PROFILE_ID,
32+
SHORT_PRESS,
33+
TURN_OFF,
34+
TURN_ON,
2335
)
2436

2537
MANUFACTURER_SPECIFIC_CLUSTER_ID_1 = 0xFF00 # decimal = 65280
@@ -96,6 +108,33 @@ class LutronLZL4BWHL01Remote(CustomDevice):
96108
}
97109
}
98110

111+
device_automation_triggers = {
112+
(SHORT_PRESS, TURN_ON): {
113+
COMMAND: COMMAND_MOVE_TO_LEVEL_ON_OFF,
114+
CLUSTER_ID: 8,
115+
ENDPOINT_ID: 1,
116+
ARGS: [254, 4],
117+
},
118+
(SHORT_PRESS, TURN_OFF): {
119+
COMMAND: COMMAND_MOVE_TO_LEVEL_ON_OFF,
120+
CLUSTER_ID: 8,
121+
ENDPOINT_ID: 1,
122+
ARGS: [0, 4],
123+
},
124+
(SHORT_PRESS, DIM_UP): {
125+
COMMAND: COMMAND_STEP_ON_OFF,
126+
CLUSTER_ID: 8,
127+
ENDPOINT_ID: 1,
128+
ARGS: [0, 30, 6],
129+
},
130+
(SHORT_PRESS, DIM_DOWN): {
131+
COMMAND: COMMAND_STEP,
132+
CLUSTER_ID: 8,
133+
ENDPOINT_ID: 1,
134+
ARGS: [1, 30, 6],
135+
},
136+
}
137+
99138

100139
class LutronLZL4BWHL01Remote2(LutronLZL4BWHL01Remote):
101140
"""Custom device representing Lutron LZL4BWHL01 Remote."""

zhaquirks/philips/rwl021.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class PhilipsRWL021(CustomDevice):
134134
COMMAND: COMMAND_STEP,
135135
CLUSTER_ID: 8,
136136
ENDPOINT_ID: 1,
137-
ARGS: [1, 56, 9],
137+
ARGS: [1, 30, 9],
138138
},
139139
(LONG_PRESS, DIM_DOWN): {
140140
COMMAND: COMMAND_STEP,
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
"""Device handler for smartthings moistureV4 sensor."""
2+
from zigpy.profiles import zha
3+
from zigpy.quirks import CustomDevice
4+
from zigpy.zcl.clusters.general import Basic, BinaryInput, Identify, Ota, PollControl
5+
from zigpy.zcl.clusters.measurement import TemperatureMeasurement
6+
from zigpy.zcl.clusters.security import IasZone
7+
8+
from zhaquirks.centralite import PowerConfigurationCluster
9+
10+
from . import SMART_THINGS
11+
from ..const import (
12+
DEVICE_TYPE,
13+
ENDPOINTS,
14+
INPUT_CLUSTERS,
15+
MODELS_INFO,
16+
OUTPUT_CLUSTERS,
17+
PROFILE_ID,
18+
)
19+
20+
21+
class CustomIasZone(IasZone):
22+
"""Custom IasZone cluster."""
23+
24+
MOISTURE_TYPE = 0x002A
25+
ZONE_TYPE = 0x0001
26+
27+
def _update_attribute(self, attrid, value):
28+
if attrid == self.ZONE_TYPE:
29+
super()._update_attribute(attrid, self.MOISTURE_TYPE)
30+
else:
31+
super()._update_attribute(attrid, value)
32+
33+
34+
class SmartThingsMoistureV4(CustomDevice):
35+
"""SmartThingsMoistureV4."""
36+
37+
signature = {
38+
# <SimpleDescriptor endpoint=1 profile=260 device_type=1026
39+
# device_version=0
40+
# input_clusters=[0, 1, 3, 15, 1026, 1280, 32]
41+
# output_clusters=[25]>
42+
MODELS_INFO: [(SMART_THINGS, "moisturev4")],
43+
ENDPOINTS: {
44+
1: {
45+
PROFILE_ID: zha.PROFILE_ID,
46+
DEVICE_TYPE: zha.DeviceType.IAS_ZONE,
47+
INPUT_CLUSTERS: [
48+
Basic.cluster_id,
49+
PowerConfigurationCluster.cluster_id,
50+
Identify.cluster_id,
51+
BinaryInput.cluster_id,
52+
PollControl.cluster_id,
53+
TemperatureMeasurement.cluster_id,
54+
IasZone.cluster_id,
55+
],
56+
OUTPUT_CLUSTERS: [Ota.cluster_id],
57+
}
58+
},
59+
}
60+
61+
replacement = {
62+
ENDPOINTS: {
63+
1: {
64+
INPUT_CLUSTERS: [
65+
Basic.cluster_id,
66+
PowerConfigurationCluster,
67+
Identify.cluster_id,
68+
BinaryInput.cluster_id,
69+
PollControl.cluster_id,
70+
TemperatureMeasurement.cluster_id,
71+
CustomIasZone,
72+
],
73+
OUTPUT_CLUSTERS: [Ota.cluster_id],
74+
}
75+
}
76+
}

zhaquirks/smartthings/iasv4.py renamed to zhaquirks/smartthings/motionv4.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Device handler for smartthings IAS V4 sensors."""
1+
"""Device handler for smartthings motionV4 sensors."""
22
from zigpy.profiles import zha
33
from zigpy.quirks import CustomDevice
44
from zigpy.zcl.clusters.general import Basic, BinaryInput, Identify, Ota, PollControl
@@ -18,15 +18,15 @@
1818
)
1919

2020

21-
class SmartThingsIASV4(CustomDevice):
22-
"""SmartThingsIASV4."""
21+
class SmartThingsMotionV4(CustomDevice):
22+
"""SmartThingsMotionV4."""
2323

2424
signature = {
2525
# <SimpleDescriptor endpoint=1 profile=260 device_type=1026
2626
# device_version=0
2727
# input_clusters=[0, 1, 3, 15, 1026, 1280, 32]
2828
# output_clusters=[25]>
29-
MODELS_INFO: [(SMART_THINGS, "motionv4"), (SMART_THINGS, "moisturev4")],
29+
MODELS_INFO: [(SMART_THINGS, "motionv4")],
3030
ENDPOINTS: {
3131
1: {
3232
PROFILE_ID: zha.PROFILE_ID,

0 commit comments

Comments
 (0)