Skip to content

Commit

Permalink
Add battery sensors to Tuya smoke TZE284_0zaf1cr8 (#3768)
Browse files Browse the repository at this point in the history
  • Loading branch information
prairiesnpr authored Jan 26, 2025
1 parent 56748bc commit 068cf83
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion zhaquirks/tuya/tuya_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
from zigpy.zcl.foundation import BaseAttributeDefs, ZCLAttributeDef

from zhaquirks import LocalDataCluster
from zhaquirks.tuya import TuyaManufClusterAttributes, TuyaPowerConfigurationCluster2AAA
from zhaquirks.tuya import (
BatterySize,
TuyaManufClusterAttributes,
TuyaPowerConfigurationCluster2AAA,
)
from zhaquirks.tuya.builder import TuyaQuirkBuilder


Expand Down Expand Up @@ -60,8 +64,23 @@ def _update_attribute(self, attrid, value):
.applies_to("_TZE284_rccxox8p", "TS0601")
.applies_to("_TZE200_vzekyi4c", "TS0601")
.applies_to("_TZE204_vawy74yh", "TS0601")
.tuya_smoke(dp_id=1)
.skip_configuration()
.add_to_registry()
)

(
TuyaQuirkBuilder("TZE200_0zaf1cr8", "TS0601")
.applies_to("_TZE284_0zaf1cr8", "TS0601")
.tuya_smoke(dp_id=1)
.tuya_binary_sensor(
dp_id=14,
attribute_name="battery_low",
device_class=BinarySensorDeviceClass.BATTERY,
entity_type=EntityType.DIAGNOSTIC,
fallback_name="Battery low",
)
.tuya_battery(dp_id=15, battery_type=BatterySize.CR123A, battery_qty=1)
.skip_configuration()
.add_to_registry()
)
Expand Down

0 comments on commit 068cf83

Please sign in to comment.