File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1
1
"""Tuya temp and humidity sensors."""
2
2
3
+ from zigpy .quirks .v2 .homeassistant import EntityType
4
+ from zigpy .quirks .v2 .homeassistant .binary_sensor import BinarySensorDeviceClass
5
+ from zigpy .quirks .v2 .homeassistant .sensor import SensorDeviceClass , SensorStateClass
6
+ import zigpy .types as t
7
+
3
8
from zhaquirks .tuya .builder import TuyaPowerConfigurationCluster2AAA , TuyaQuirkBuilder
4
9
5
10
(
72
77
.skip_configuration ()
73
78
.add_to_registry ()
74
79
)
80
+
81
+ (
82
+ TuyaQuirkBuilder ("_TZE200_pay2byax" , "TS0601" ) # Cusam ZG-102ZL
83
+ .applies_to ("_TZE200_n8dljorx" , "TS0601" )
84
+ .tuya_sensor (
85
+ dp_id = 101 ,
86
+ attribute_name = "measured_value" ,
87
+ type = t .uint16_t ,
88
+ fallback_name = "Illuminance" ,
89
+ device_class = SensorDeviceClass .ILLUMINANCE ,
90
+ state_class = SensorStateClass .MEASUREMENT ,
91
+ )
92
+ .tuya_binary_sensor (
93
+ dp_id = 1 ,
94
+ attribute_name = "zone_status" ,
95
+ device_class = BinarySensorDeviceClass .OPENING ,
96
+ fallback_name = "Opening" ,
97
+ entity_type = EntityType .STANDARD ,
98
+ )
99
+ .tuya_battery (dp_id = 2 )
100
+ .skip_configuration ()
101
+ .add_to_registry ()
102
+ )
You can’t perform that action at this time.
0 commit comments