Skip to content

Commit 068cf83

Browse files
authored
Add battery sensors to Tuya smoke TZE284_0zaf1cr8 (#3768)
1 parent 56748bc commit 068cf83

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

zhaquirks/tuya/tuya_smoke.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
from zigpy.zcl.foundation import BaseAttributeDefs, ZCLAttributeDef
1010

1111
from zhaquirks import LocalDataCluster
12-
from zhaquirks.tuya import TuyaManufClusterAttributes, TuyaPowerConfigurationCluster2AAA
12+
from zhaquirks.tuya import (
13+
BatterySize,
14+
TuyaManufClusterAttributes,
15+
TuyaPowerConfigurationCluster2AAA,
16+
)
1317
from zhaquirks.tuya.builder import TuyaQuirkBuilder
1418

1519

@@ -60,8 +64,23 @@ def _update_attribute(self, attrid, value):
6064
.applies_to("_TZE284_rccxox8p", "TS0601")
6165
.applies_to("_TZE200_vzekyi4c", "TS0601")
6266
.applies_to("_TZE204_vawy74yh", "TS0601")
67+
.tuya_smoke(dp_id=1)
68+
.skip_configuration()
69+
.add_to_registry()
70+
)
71+
72+
(
73+
TuyaQuirkBuilder("TZE200_0zaf1cr8", "TS0601")
6374
.applies_to("_TZE284_0zaf1cr8", "TS0601")
6475
.tuya_smoke(dp_id=1)
76+
.tuya_binary_sensor(
77+
dp_id=14,
78+
attribute_name="battery_low",
79+
device_class=BinarySensorDeviceClass.BATTERY,
80+
entity_type=EntityType.DIAGNOSTIC,
81+
fallback_name="Battery low",
82+
)
83+
.tuya_battery(dp_id=15, battery_type=BatterySize.CR123A, battery_qty=1)
6584
.skip_configuration()
6685
.add_to_registry()
6786
)

0 commit comments

Comments
 (0)