|
3 | 3 | from typing import Final
|
4 | 4 |
|
5 | 5 | from zigpy.quirks import CustomCluster
|
6 |
| -from zigpy.quirks.v2 import QuirkBuilder |
| 6 | +from zigpy.quirks.v2 import EntityType, QuirkBuilder |
| 7 | +from zigpy.quirks.v2.homeassistant import UnitOfPower, UnitOfTemperature, UnitOfTime |
| 8 | +from zigpy.quirks.v2.homeassistant.number import NumberDeviceClass |
7 | 9 | import zigpy.types as t
|
8 | 10 | from zigpy.zcl.clusters.hvac import SystemMode, Thermostat, UserInterface
|
9 | 11 | from zigpy.zcl.clusters.measurement import TemperatureMeasurement
|
@@ -285,7 +287,7 @@ class AttributeDefs(Thermostat.AttributeDefs):
|
285 | 287 | access="r",
|
286 | 288 | is_manufacturer_specific=True,
|
287 | 289 | )
|
288 |
| - se_local_temperature_souce_select: Final = ZCLAttributeDef( |
| 290 | + se_local_temperature_source_select: Final = ZCLAttributeDef( |
289 | 291 | id=0xE212,
|
290 | 292 | type=SELocalTemperatureSourceSelect,
|
291 | 293 | access="rw",
|
@@ -328,7 +330,7 @@ class AttributeDefs(Thermostat.AttributeDefs):
|
328 | 330 | is_manufacturer_specific=True,
|
329 | 331 | )
|
330 | 332 | se_heating_emitter_type: Final = ZCLAttributeDef(
|
331 |
| - id=0xE218, |
| 333 | + id=0xE21A, |
332 | 334 | type=SEHeatingEmitterType,
|
333 | 335 | access="rw",
|
334 | 336 | is_manufacturer_specific=True,
|
@@ -572,5 +574,213 @@ class AttributeDefs(CustomCluster.AttributeDefs):
|
572 | 574 | .replaces(SEMetering, endpoint_id=5)
|
573 | 575 | .replaces(SECycleTime)
|
574 | 576 | .replaces(SEHeatingCoolingOutput)
|
| 577 | + .number( |
| 578 | + cluster_id=SEMetering.cluster_id, |
| 579 | + endpoint_id=5, |
| 580 | + attribute_name=SEMetering.AttributeDefs.se_fixed_load_demand.name, |
| 581 | + translation_key="fixed_load_demand", |
| 582 | + fallback_name="Fixed Load Demand", |
| 583 | + device_class=NumberDeviceClass.POWER, |
| 584 | + unit=UnitOfPower.WATT, |
| 585 | + min_value=0, |
| 586 | + max_value=10000, |
| 587 | + step=1, |
| 588 | + ) |
| 589 | + .number( |
| 590 | + cluster_id=SEUserInterface.cluster_id, |
| 591 | + endpoint_id=1, |
| 592 | + attribute_name=SEUserInterface.AttributeDefs.se_brightness.name, |
| 593 | + translation_key="display_brightness", |
| 594 | + fallback_name="Display Brightness", |
| 595 | + # unit="%", |
| 596 | + min_value=0, |
| 597 | + max_value=100, |
| 598 | + step=1, |
| 599 | + ) |
| 600 | + .number( |
| 601 | + cluster_id=SEUserInterface.cluster_id, |
| 602 | + endpoint_id=1, |
| 603 | + attribute_name=SEUserInterface.AttributeDefs.se_inactive_brightness.name, |
| 604 | + translation_key="display_inactive_brightness", |
| 605 | + fallback_name="Display Inactive Brightness", |
| 606 | + # unit="%", |
| 607 | + min_value=0, |
| 608 | + max_value=100, |
| 609 | + step=1, |
| 610 | + ) |
| 611 | + .number( |
| 612 | + cluster_id=SEUserInterface.cluster_id, |
| 613 | + endpoint_id=1, |
| 614 | + attribute_name=SEUserInterface.AttributeDefs.se_activity_timeout.name, |
| 615 | + translation_key="display_activity_timeout", |
| 616 | + fallback_name="Display Activity Timeout", |
| 617 | + device_class=NumberDeviceClass.DURATION, |
| 618 | + unit=UnitOfTime.SECONDS, |
| 619 | + min_value=0, |
| 620 | + max_value=3600, |
| 621 | + step=1, |
| 622 | + ) |
| 623 | + .binary_sensor( |
| 624 | + cluster_id=SEThermostat.cluster_id, |
| 625 | + endpoint_id=1, |
| 626 | + attribute_name=SEThermostat.AttributeDefs.se_open_window_detection_status.name, |
| 627 | + translation_key="open_window_detection_status", |
| 628 | + fallback_name="Open Window Detection Status", |
| 629 | + entity_type=EntityType.DIAGNOSTIC, |
| 630 | + ) |
| 631 | + .number( |
| 632 | + cluster_id=SEThermostat.cluster_id, |
| 633 | + endpoint_id=1, |
| 634 | + attribute_name=SEThermostat.AttributeDefs.se_open_window_detection_threshold.name, |
| 635 | + translation_key="open_window_detection_threshold", |
| 636 | + fallback_name="Open Window Detection Threshold", |
| 637 | + device_class=NumberDeviceClass.TEMPERATURE, |
| 638 | + unit=UnitOfTemperature.CELSIUS, |
| 639 | + min_value=0, |
| 640 | + max_value=12, |
| 641 | + multiplier=0.1, |
| 642 | + step=0.1, |
| 643 | + ) |
| 644 | + .number( |
| 645 | + cluster_id=SEThermostat.cluster_id, |
| 646 | + endpoint_id=1, |
| 647 | + attribute_name=SEThermostat.AttributeDefs.se_open_window_event_duration.name, |
| 648 | + translation_key="open_window_event_duration", |
| 649 | + fallback_name="Open Window Event Duration", |
| 650 | + device_class=NumberDeviceClass.DURATION, |
| 651 | + unit=UnitOfTime.SECONDS, |
| 652 | + min_value=0, |
| 653 | + max_value=7620, |
| 654 | + step=1, |
| 655 | + ) |
| 656 | + .number( |
| 657 | + cluster_id=SEThermostat.cluster_id, |
| 658 | + endpoint_id=1, |
| 659 | + attribute_name=SEThermostat.AttributeDefs.se_open_window_detection_guard_period.name, |
| 660 | + translation_key="open_window_detection_guard_period", |
| 661 | + fallback_name="Open Window Detection Guard Period", |
| 662 | + device_class=NumberDeviceClass.DURATION, |
| 663 | + unit=UnitOfTime.SECONDS, |
| 664 | + min_value=0, |
| 665 | + max_value=7620, |
| 666 | + step=1, |
| 667 | + ) |
| 668 | + .number( |
| 669 | + cluster_id=SEThermostat.cluster_id, |
| 670 | + endpoint_id=1, |
| 671 | + attribute_name=SEThermostat.AttributeDefs.se_fallback_timeout.name, |
| 672 | + translation_key="fallback_timeout", |
| 673 | + fallback_name="Fallback Timeout", |
| 674 | + device_class=NumberDeviceClass.DURATION, |
| 675 | + unit=UnitOfTime.SECONDS, |
| 676 | + min_value=30, |
| 677 | + max_value=10800, |
| 678 | + step=1, |
| 679 | + ) |
| 680 | + .number( |
| 681 | + cluster_id=SEThermostat.cluster_id, |
| 682 | + endpoint_id=1, |
| 683 | + attribute_name=SEThermostat.AttributeDefs.se_boost_amount.name, |
| 684 | + translation_key="boost_amount", |
| 685 | + fallback_name="Boost Amount", |
| 686 | + device_class=NumberDeviceClass.TEMPERATURE, |
| 687 | + unit=UnitOfTemperature.CELSIUS, |
| 688 | + min_value=0, |
| 689 | + max_value=10, |
| 690 | + multiplier=0.01, |
| 691 | + step=0.5, |
| 692 | + ) |
| 693 | + # should be readonly |
| 694 | + .enum( |
| 695 | + cluster_id=SEThermostat.cluster_id, |
| 696 | + endpoint_id=1, |
| 697 | + attribute_name=SEThermostat.AttributeDefs.se_control_status.name, |
| 698 | + translation_key="control_status", |
| 699 | + fallback_name="Control Status", |
| 700 | + enum_class=SEControlStatus, |
| 701 | + entity_type=EntityType.DIAGNOSTIC, |
| 702 | + ) |
| 703 | + .enum( |
| 704 | + cluster_id=SEThermostat.cluster_id, |
| 705 | + endpoint_id=1, |
| 706 | + attribute_name=SEThermostat.AttributeDefs.se_local_temperature_source_select.name, |
| 707 | + translation_key="local_temperature_source", |
| 708 | + fallback_name="Local Temperature Source", |
| 709 | + enum_class=SELocalTemperatureSourceSelect, |
| 710 | + ) |
| 711 | + .enum( |
| 712 | + cluster_id=SEThermostat.cluster_id, |
| 713 | + endpoint_id=1, |
| 714 | + attribute_name=SEThermostat.AttributeDefs.se_control_type.name, |
| 715 | + translation_key="control_type", |
| 716 | + fallback_name="Control Type", |
| 717 | + enum_class=SEControlType, |
| 718 | + ) |
| 719 | + .enum( |
| 720 | + cluster_id=SEThermostat.cluster_id, |
| 721 | + endpoint_id=1, |
| 722 | + attribute_name=SEThermostat.AttributeDefs.se_thermostat_application.name, |
| 723 | + translation_key="thermostat_application", |
| 724 | + fallback_name="Thermostat Application", |
| 725 | + enum_class=SEThermostatApplication, |
| 726 | + ) |
| 727 | + .enum( |
| 728 | + cluster_id=SEThermostat.cluster_id, |
| 729 | + endpoint_id=1, |
| 730 | + attribute_name=SEThermostat.AttributeDefs.se_heating_fuel.name, |
| 731 | + translation_key="heating_fuel", |
| 732 | + fallback_name="Heating Fuel", |
| 733 | + enum_class=SEHeatingFuel, |
| 734 | + ) |
| 735 | + .enum( |
| 736 | + cluster_id=SEThermostat.cluster_id, |
| 737 | + endpoint_id=1, |
| 738 | + attribute_name=SEThermostat.AttributeDefs.se_heat_transfer_medium.name, |
| 739 | + translation_key="heat_transfer_medium", |
| 740 | + fallback_name="Heat Transfer Medium", |
| 741 | + enum_class=SEHeatTransferMedium, |
| 742 | + ) |
| 743 | + .enum( |
| 744 | + cluster_id=SEThermostat.cluster_id, |
| 745 | + endpoint_id=1, |
| 746 | + attribute_name=SEThermostat.AttributeDefs.se_heating_emitter_type.name, |
| 747 | + translation_key="heating_emitter_type", |
| 748 | + fallback_name="Heating Emitter Type", |
| 749 | + enum_class=SEHeatingEmitterType, |
| 750 | + ) |
| 751 | + .number( |
| 752 | + cluster_id=SETemperatureMeasurement.cluster_id, |
| 753 | + endpoint_id=2, |
| 754 | + attribute_name=SETemperatureMeasurement.AttributeDefs.se_sensor_correction.name, |
| 755 | + translation_key="ambient_sensor_correction", |
| 756 | + fallback_name="Ambient Sensor Correction", |
| 757 | + device_class=NumberDeviceClass.TEMPERATURE, |
| 758 | + unit=UnitOfTemperature.CELSIUS, |
| 759 | + min_value=-10, |
| 760 | + max_value=10, |
| 761 | + step=0.1, |
| 762 | + multiplier=0.01, |
| 763 | + ) |
| 764 | + .number( |
| 765 | + cluster_id=SETemperatureMeasurementExternal.cluster_id, |
| 766 | + endpoint_id=3, |
| 767 | + attribute_name=SETemperatureMeasurementExternal.AttributeDefs.se_sensor_correction.name, |
| 768 | + translation_key="external_sensor_correction", |
| 769 | + fallback_name="External Sensor Correction", |
| 770 | + device_class=NumberDeviceClass.TEMPERATURE, |
| 771 | + unit=UnitOfTemperature.CELSIUS, |
| 772 | + min_value=-10, |
| 773 | + max_value=10, |
| 774 | + step=0.1, |
| 775 | + multiplier=0.01, |
| 776 | + ) |
| 777 | + .enum( |
| 778 | + cluster_id=SETemperatureMeasurementExternal.cluster_id, |
| 779 | + endpoint_id=3, |
| 780 | + attribute_name=SETemperatureMeasurementExternal.AttributeDefs.se_temperature_sensor_type.name, |
| 781 | + translation_key="external_temperature_sensor_type", |
| 782 | + fallback_name="External Temperature Sensor Type", |
| 783 | + enum_class=SETemperatureSensorType, |
| 784 | + ) |
575 | 785 | .add_to_registry()
|
576 | 786 | )
|
0 commit comments