|
10 | 10 | import zigpy.types as t
|
11 | 11 | from zigpy.zcl.clusters.measurement import OccupancySensing
|
12 | 12 | from zigpy.zcl.clusters.security import IasZone
|
| 13 | +from zigpy.quirks.v2 import ClusterType |
13 | 14 |
|
| 15 | +from zhaquirks.tuya import tuya |
14 | 16 | from zhaquirks.tuya import TuyaLocalCluster
|
15 | 17 | from zhaquirks.tuya.builder import TuyaQuirkBuilder
|
16 | 18 |
|
@@ -1610,3 +1612,74 @@ class TuyaMotionDetectionMode(t.enum8):
|
1610 | 1612 | .skip_configuration()
|
1611 | 1613 | .add_to_registry()
|
1612 | 1614 | )
|
| 1615 | + |
| 1616 | +# Mercator Ikuü TS0601 motion sensor (_TZE200_agumlajc) |
| 1617 | + |
| 1618 | + |
| 1619 | +class LightControlMode(t.enum8): |
| 1620 | + """Enum for the light control mode setting (dp_id=105).""" |
| 1621 | + |
| 1622 | + On = 0 |
| 1623 | + Off = 1 |
| 1624 | + Auto = 2 |
| 1625 | + |
| 1626 | + |
| 1627 | +( |
| 1628 | + TuyaQuirkBuilder("_TZE200_agumlajc", "TS0601") |
| 1629 | + .applies_to("_TZE204_agumlajc", "TS0601") |
| 1630 | + .tuya_temperature(dp_id=1, scale=10) |
| 1631 | + .tuya_humidity(dp_id=2) |
| 1632 | + .tuya_illuminance(dp_id=101) |
| 1633 | + .tuya_number( |
| 1634 | + dp_id=102, |
| 1635 | + attribute_name="brightness_threshold", |
| 1636 | + type=t.uint16_t, |
| 1637 | + device_class=SensorDeviceClass.ILLUMINANCE, |
| 1638 | + min_value=0, |
| 1639 | + max_value=1000, |
| 1640 | + step=1, |
| 1641 | + translation_key="brightness_threshold", |
| 1642 | + fallback_name="Brightness threshold", |
| 1643 | + ) |
| 1644 | + .tuya_number( |
| 1645 | + dp_id=103, |
| 1646 | + attribute_name="motion_hold_time", |
| 1647 | + type=t.uint16_t, |
| 1648 | + device_class=SensorDeviceClass.DURATION, |
| 1649 | + unit=UnitOfTime.SECONDS, |
| 1650 | + min_value=1, |
| 1651 | + max_value=3600, |
| 1652 | + step=1, |
| 1653 | + translation_key="motion_hold_time", |
| 1654 | + fallback_name="Motion hold time", |
| 1655 | + ) |
| 1656 | + .tuya_dp( |
| 1657 | + dp_id=104, |
| 1658 | + dp_type=tuya.DATA, |
| 1659 | + attribute_name="motion", |
| 1660 | + cluster_id=IasZone.cluster_id, |
| 1661 | + cluster_type=ClusterType.Server, |
| 1662 | + endpoint_id=1, |
| 1663 | + attribute_type=t.Bool, |
| 1664 | + converter=tuya.value_converter.true_false_1, |
| 1665 | + ) |
| 1666 | + .tuya_enum( |
| 1667 | + dp_id=105, |
| 1668 | + attribute_name="light_control_mode", |
| 1669 | + enum_class=LightControlMode, |
| 1670 | + translation_key="light_control_mode", |
| 1671 | + fallback_name="Light control mode", |
| 1672 | + ) |
| 1673 | + .tuya_number( |
| 1674 | + dp_id=106, |
| 1675 | + attribute_name="motion_sensitivity", |
| 1676 | + type=t.uint16_t, |
| 1677 | + min_value=0, |
| 1678 | + max_value=100, |
| 1679 | + step=1, |
| 1680 | + translation_key="motion_sensitivity", |
| 1681 | + fallback_name="Motion sensitivity", |
| 1682 | + ) |
| 1683 | + .skip_configuration() |
| 1684 | + .add_to_registry() |
| 1685 | +) |
0 commit comments