Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add battery sensors to Tuya smoke TZE284_0zaf1cr8 #3768

Merged
merged 3 commits into from
Jan 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
prairiesnpr marked this conversation as resolved.
Show resolved Hide resolved
.skip_configuration()
.add_to_registry()
)
Expand Down
Loading