|
25 | 25 | TUYA_CLUSTER_ID,
|
26 | 26 | EnchantedDevice,
|
27 | 27 | TuyaLocalCluster,
|
| 28 | + TuyaPowerConfigurationCluster2AA, |
28 | 29 | TuyaPowerConfigurationCluster4AA,
|
29 | 30 | )
|
30 | 31 | from zhaquirks.tuya.builder import TuyaQuirkBuilder
|
@@ -568,3 +569,74 @@ class GiexIrrigationStatus(t.enum8):
|
568 | 569 | .skip_configuration()
|
569 | 570 | .add_to_registry()
|
570 | 571 | )
|
| 572 | + |
| 573 | + |
| 574 | +class RoyalGardineerWeatherDelay(t.enum8): |
| 575 | + """Royal Gardineer Irrigation Valve weather delay enum.""" |
| 576 | + |
| 577 | + Disabled = 0x00 |
| 578 | + Delayed_24h = 0x01 |
| 579 | + Delayed_48h = 0x02 |
| 580 | + Delayed_72h = 0x03 |
| 581 | + |
| 582 | + |
| 583 | +class RoyalGardineerTimerState(t.enum8): |
| 584 | + """Royal Gardineer Irrigation Valve timer state enum.""" |
| 585 | + |
| 586 | + Disabled = 0x00 |
| 587 | + Active = 0x01 |
| 588 | + Enabled = 0x02 |
| 589 | + |
| 590 | + |
| 591 | +( |
| 592 | + TuyaQuirkBuilder("_TZE200_2wg5qrjy", "TS0601") |
| 593 | + .tuya_onoff(dp_id=1) |
| 594 | + # Should be TuyaPowerConfigurationCluster2AA, but it is broken at this time. |
| 595 | + .tuya_battery(dp_id=7, power_cfg=TuyaPowerConfigurationCluster2AA) |
| 596 | + # Might need a converter: x // 10 |
| 597 | + .tuya_metering(dp_id=5) |
| 598 | + # Timer time left/remaining (raw value in seconds). |
| 599 | + .tuya_number( |
| 600 | + dp_id=11, |
| 601 | + attribute_name="timer_time_left", |
| 602 | + type=t.uint32_t, |
| 603 | + min_value=1, |
| 604 | + max_value=600, |
| 605 | + step=1, |
| 606 | + multiplier=1 / 60, |
| 607 | + unit=UnitOfTime.MINUTES, |
| 608 | + translation_key="timer_time_left", |
| 609 | + fallback_name="Timer time left", |
| 610 | + ) |
| 611 | + # Weather delay. |
| 612 | + .tuya_enum( |
| 613 | + dp_id=10, |
| 614 | + attribute_name="weather_delay", |
| 615 | + enum_class=RoyalGardineerWeatherDelay, |
| 616 | + translation_key="weather_delay", |
| 617 | + fallback_name="Weather delay", |
| 618 | + initially_disabled=True, |
| 619 | + ) |
| 620 | + # Timer state - read-only. |
| 621 | + .tuya_enum( |
| 622 | + dp_id=12, |
| 623 | + attribute_name="timer_state", |
| 624 | + enum_class=RoyalGardineerTimerState, |
| 625 | + entity_platform=EntityPlatform.SENSOR, |
| 626 | + entity_type=EntityType.DIAGNOSTIC, |
| 627 | + translation_key="timer_state", |
| 628 | + fallback_name="Timer state", |
| 629 | + ) |
| 630 | + # Last valve open duration - read-only (raw value in seconds). |
| 631 | + .tuya_sensor( |
| 632 | + dp_id=15, |
| 633 | + attribute_name="last_valve_open_duration", |
| 634 | + type=t.uint32_t, |
| 635 | + divisor=60, |
| 636 | + entity_type=EntityType.DIAGNOSTIC, |
| 637 | + unit=UnitOfTime.MINUTES, |
| 638 | + translation_key="last_valve_open_duration", |
| 639 | + fallback_name="Last valve open duration", |
| 640 | + ) |
| 641 | + .add_to_registry() |
| 642 | +) |
0 commit comments