Skip to content

Commit a54b2c7

Browse files
authored
Add TuyaVibration_TO devices (#1720)
Add devices with the Time as `OUTPUT_CLUSTERS`
1 parent 1354b31 commit a54b2c7

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

zhaquirks/tuya/ts0210.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,53 @@ def __init__(self, *args, **kwargs):
8989
}
9090
}
9191
}
92+
93+
94+
class TuyaVibration_TO(CustomDevice):
95+
"""Tuya vibration sensor (TO)."""
96+
97+
def __init__(self, *args, **kwargs):
98+
"""Init device."""
99+
self.motion_bus = Bus()
100+
super().__init__(*args, **kwargs)
101+
102+
signature = {
103+
MODEL: "TS0210",
104+
ENDPOINTS: {
105+
# "profile_id": 260,
106+
# "device_type": "0x0402",
107+
# "in_clusters": ["0x0000", "0x0001", "0x0500"],
108+
# "out_clusters": ["0x000a", "0x0019"]
109+
1: {
110+
PROFILE_ID: zha.PROFILE_ID,
111+
DEVICE_TYPE: zha.DeviceType.IAS_ZONE,
112+
INPUT_CLUSTERS: [
113+
Basic.cluster_id,
114+
PowerConfiguration.cluster_id,
115+
IasZone.cluster_id,
116+
],
117+
OUTPUT_CLUSTERS: [
118+
Time.cluster_id,
119+
Ota.cluster_id,
120+
],
121+
}
122+
},
123+
}
124+
125+
replacement = {
126+
ENDPOINTS: {
127+
1: {
128+
PROFILE_ID: zha.PROFILE_ID,
129+
DEVICE_TYPE: IAS_VIBRATION_SENSOR,
130+
INPUT_CLUSTERS: [
131+
Basic.cluster_id,
132+
PowerConfiguration.cluster_id,
133+
VibrationCluster,
134+
],
135+
OUTPUT_CLUSTERS: [
136+
Time.cluster_id,
137+
Ota.cluster_id,
138+
],
139+
}
140+
}
141+
}

0 commit comments

Comments
 (0)