|
36 | 36 | WAN: Final = "wan"
|
37 | 37 | LAN: Final = "lan"
|
38 | 38 |
|
39 |
| -@dataclass |
40 |
| -class ExtBinarySensorEntityDescription(BinarySensorEntityDescription): |
| 39 | +class ExtBinarySensorEntityDescription(BinarySensorEntityDescription, frozen_or_thawed=True): |
41 | 40 | idx: int | None = None
|
42 | 41 | icon_off: str | None = None
|
43 | 42 |
|
44 | 43 |
|
45 |
| -@dataclass |
46 |
| -class ExtButtonEntityDescription(ButtonEntityDescription): |
| 44 | +class ExtButtonEntityDescription(ButtonEntityDescription, frozen_or_thawed=True): |
47 | 45 | payload: str | None = None
|
48 | 46 |
|
49 | 47 |
|
50 |
| -@dataclass |
51 |
| -class ExtNumberEntityDescription(NumberEntityDescription): |
| 48 | +class ExtNumberEntityDescription(NumberEntityDescription, frozen_or_thawed=True): |
52 | 49 | write_zero_as_null: bool | None = None
|
53 | 50 | handle_as_float: bool | None = None
|
54 | 51 | factor: int | None = None
|
55 | 52 | idx: int | str | None = None
|
56 | 53 | check_16a_limit: bool | None = None
|
57 | 54 |
|
58 |
| -@dataclass |
59 |
| -class ExtSelectEntityDescription(SelectEntityDescription): |
| 55 | +class ExtSelectEntityDescription(SelectEntityDescription, frozen_or_thawed=True): |
60 | 56 | idx: int | str | None = None
|
61 | 57 |
|
62 | 58 |
|
63 |
| -@dataclass |
64 |
| -class ExtSensorEntityDescription(SensorEntityDescription): |
| 59 | +class ExtSensorEntityDescription(SensorEntityDescription, frozen_or_thawed=True): |
65 | 60 | idx: int | str | None = None
|
66 | 61 | tuple_idx: list | None = None
|
67 | 62 | factor: int | None = None
|
68 | 63 | lookup: bool | None = None
|
69 | 64 | differential_base_key: str | None = None
|
70 | 65 |
|
71 | 66 |
|
72 |
| -@dataclass |
73 |
| -class ExtSwitchEntityDescription(SwitchEntityDescription): |
| 67 | +class ExtSwitchEntityDescription(SwitchEntityDescription, frozen_or_thawed=True): |
74 | 68 | is_zero_or_one: bool | None = None
|
75 | 69 | icon_off: str | None = None
|
76 | 70 | idx: int | str | None = None
|
@@ -1681,7 +1675,140 @@ class ExtSwitchEntityDescription(SwitchEntityDescription):
|
1681 | 1675 | # wsc -> later (if at all)
|
1682 | 1676 | # wsm -> later (if at all)
|
1683 | 1677 |
|
| 1678 | + ExtSensorEntityDescription( |
| 1679 | + key=Tag.CARDS.key, |
| 1680 | + tuple_idx=[0, "energy"], |
| 1681 | + entity_category=EntityCategory.DIAGNOSTIC, |
| 1682 | + native_unit_of_measurement=UnitOfEnergy.WATT_HOUR, |
| 1683 | + suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, |
| 1684 | + suggested_display_precision=2, |
| 1685 | + state_class=SensorStateClass.TOTAL_INCREASING, |
| 1686 | + icon="mdi:lightning-bolt", |
| 1687 | + device_class=SensorDeviceClass.ENERGY, |
| 1688 | + entity_registry_enabled_default=True |
| 1689 | + ), |
| 1690 | + ExtSensorEntityDescription( |
| 1691 | + key=Tag.CARDS.key, |
| 1692 | + tuple_idx=[1, "energy"], |
| 1693 | + entity_category=EntityCategory.DIAGNOSTIC, |
| 1694 | + native_unit_of_measurement=UnitOfEnergy.WATT_HOUR, |
| 1695 | + suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, |
| 1696 | + suggested_display_precision=2, |
| 1697 | + state_class=SensorStateClass.TOTAL_INCREASING, |
| 1698 | + icon="mdi:lightning-bolt", |
| 1699 | + device_class=SensorDeviceClass.ENERGY, |
| 1700 | + entity_registry_enabled_default=False |
| 1701 | + ), |
| 1702 | + ExtSensorEntityDescription( |
| 1703 | + key=Tag.CARDS.key, |
| 1704 | + tuple_idx=[2, "energy"], |
| 1705 | + entity_category=EntityCategory.DIAGNOSTIC, |
| 1706 | + native_unit_of_measurement=UnitOfEnergy.WATT_HOUR, |
| 1707 | + suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, |
| 1708 | + suggested_display_precision=2, |
| 1709 | + state_class=SensorStateClass.TOTAL_INCREASING, |
| 1710 | + icon="mdi:lightning-bolt", |
| 1711 | + device_class=SensorDeviceClass.ENERGY, |
| 1712 | + entity_registry_enabled_default=False |
| 1713 | + ), |
| 1714 | + ExtSensorEntityDescription( |
| 1715 | + key=Tag.CARDS.key, |
| 1716 | + tuple_idx=[3, "energy"], |
| 1717 | + entity_category=EntityCategory.DIAGNOSTIC, |
| 1718 | + native_unit_of_measurement=UnitOfEnergy.WATT_HOUR, |
| 1719 | + suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, |
| 1720 | + suggested_display_precision=2, |
| 1721 | + state_class=SensorStateClass.TOTAL_INCREASING, |
| 1722 | + icon="mdi:lightning-bolt", |
| 1723 | + device_class=SensorDeviceClass.ENERGY, |
| 1724 | + entity_registry_enabled_default=False |
| 1725 | + ), |
| 1726 | + ExtSensorEntityDescription( |
| 1727 | + key=Tag.CARDS.key, |
| 1728 | + tuple_idx=[4, "energy"], |
| 1729 | + entity_category=EntityCategory.DIAGNOSTIC, |
| 1730 | + native_unit_of_measurement=UnitOfEnergy.WATT_HOUR, |
| 1731 | + suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, |
| 1732 | + suggested_display_precision=2, |
| 1733 | + state_class=SensorStateClass.TOTAL_INCREASING, |
| 1734 | + icon="mdi:lightning-bolt", |
| 1735 | + device_class=SensorDeviceClass.ENERGY, |
| 1736 | + entity_registry_enabled_default=False |
| 1737 | + ), |
| 1738 | + ExtSensorEntityDescription( |
| 1739 | + key=Tag.CARDS.key, |
| 1740 | + tuple_idx=[5, "energy"], |
| 1741 | + entity_category=EntityCategory.DIAGNOSTIC, |
| 1742 | + native_unit_of_measurement=UnitOfEnergy.WATT_HOUR, |
| 1743 | + suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, |
| 1744 | + suggested_display_precision=2, |
| 1745 | + state_class=SensorStateClass.TOTAL_INCREASING, |
| 1746 | + icon="mdi:lightning-bolt", |
| 1747 | + device_class=SensorDeviceClass.ENERGY, |
| 1748 | + entity_registry_enabled_default=False |
| 1749 | + ), |
| 1750 | + ExtSensorEntityDescription( |
| 1751 | + key=Tag.CARDS.key, |
| 1752 | + tuple_idx=[6, "energy"], |
| 1753 | + entity_category=EntityCategory.DIAGNOSTIC, |
| 1754 | + native_unit_of_measurement=UnitOfEnergy.WATT_HOUR, |
| 1755 | + suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, |
| 1756 | + suggested_display_precision=2, |
| 1757 | + state_class=SensorStateClass.TOTAL_INCREASING, |
| 1758 | + icon="mdi:lightning-bolt", |
| 1759 | + device_class=SensorDeviceClass.ENERGY, |
| 1760 | + entity_registry_enabled_default=False |
| 1761 | + ), |
| 1762 | + ExtSensorEntityDescription( |
| 1763 | + key=Tag.CARDS.key, |
| 1764 | + tuple_idx=[7, "energy"], |
| 1765 | + entity_category=EntityCategory.DIAGNOSTIC, |
| 1766 | + native_unit_of_measurement=UnitOfEnergy.WATT_HOUR, |
| 1767 | + suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, |
| 1768 | + suggested_display_precision=2, |
| 1769 | + state_class=SensorStateClass.TOTAL_INCREASING, |
| 1770 | + icon="mdi:lightning-bolt", |
| 1771 | + device_class=SensorDeviceClass.ENERGY, |
| 1772 | + entity_registry_enabled_default=False |
| 1773 | + ), |
| 1774 | + ExtSensorEntityDescription( |
| 1775 | + key=Tag.CARDS.key, |
| 1776 | + tuple_idx=[8, "energy"], |
| 1777 | + entity_category=EntityCategory.DIAGNOSTIC, |
| 1778 | + native_unit_of_measurement=UnitOfEnergy.WATT_HOUR, |
| 1779 | + suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, |
| 1780 | + suggested_display_precision=2, |
| 1781 | + state_class=SensorStateClass.TOTAL_INCREASING, |
| 1782 | + icon="mdi:lightning-bolt", |
| 1783 | + device_class=SensorDeviceClass.ENERGY, |
| 1784 | + entity_registry_enabled_default=False |
| 1785 | + ), |
| 1786 | + ExtSensorEntityDescription( |
| 1787 | + key=Tag.CARDS.key, |
| 1788 | + tuple_idx=[9, "energy"], |
| 1789 | + entity_category=EntityCategory.DIAGNOSTIC, |
| 1790 | + native_unit_of_measurement=UnitOfEnergy.WATT_HOUR, |
| 1791 | + suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, |
| 1792 | + suggested_display_precision=2, |
| 1793 | + state_class=SensorStateClass.TOTAL_INCREASING, |
| 1794 | + icon="mdi:lightning-bolt", |
| 1795 | + device_class=SensorDeviceClass.ENERGY, |
| 1796 | + entity_registry_enabled_default=False |
| 1797 | + ), |
| 1798 | + ExtSensorEntityDescription( |
| 1799 | + key=Tag.CARDS.key, |
| 1800 | + tuple_idx=[10, "energy"], |
| 1801 | + entity_category=EntityCategory.DIAGNOSTIC, |
| 1802 | + native_unit_of_measurement=UnitOfEnergy.WATT_HOUR, |
| 1803 | + suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, |
| 1804 | + suggested_display_precision=2, |
| 1805 | + state_class=SensorStateClass.TOTAL_INCREASING, |
| 1806 | + icon="mdi:lightning-bolt", |
| 1807 | + device_class=SensorDeviceClass.ENERGY, |
| 1808 | + entity_registry_enabled_default=False |
| 1809 | + ), |
1684 | 1810 | ]
|
| 1811 | + |
1685 | 1812 | SWITCH_SENSORS = [
|
1686 | 1813 | ExtSwitchEntityDescription(
|
1687 | 1814 | key=Tag.ACP.key,
|
|
0 commit comments