diff --git a/custom_components/solaredge_modbus_multi/binary_sensor.py b/custom_components/solaredge_modbus_multi/binary_sensor.py index 26869115..ecfa051d 100644 --- a/custom_components/solaredge_modbus_multi/binary_sensor.py +++ b/custom_components/solaredge_modbus_multi/binary_sensor.py @@ -34,6 +34,8 @@ async def async_setup_entry( class SolarEdgeBinarySensorBase(CoordinatorEntity, BinarySensorEntity): + """Base class for SolarEdge binary sensor entities.""" + should_poll = False _attr_has_entity_name = True @@ -66,11 +68,9 @@ def _handle_coordinator_update(self) -> None: class AdvPowerControlEnabled(SolarEdgeBinarySensorBase): - entity_category = EntityCategory.DIAGNOSTIC + """Grid Control boolean status. This is "AdvancedPwrControlEn" in specs.""" - def __init__(self, platform, config_entry, coordinator): - super().__init__(platform, config_entry, coordinator) - """Initialize the sensor.""" + entity_category = EntityCategory.DIAGNOSTIC @property def available(self) -> bool: diff --git a/custom_components/solaredge_modbus_multi/button.py b/custom_components/solaredge_modbus_multi/button.py index bd299c7d..0d4dbffe 100644 --- a/custom_components/solaredge_modbus_multi/button.py +++ b/custom_components/solaredge_modbus_multi/button.py @@ -33,6 +33,8 @@ async def async_setup_entry( class SolarEdgeButtonBase(CoordinatorEntity, ButtonEntity): + """Base class for SolarEdge button entities.""" + _attr_has_entity_name = True def __init__(self, platform, config_entry, coordinator): @@ -64,11 +66,9 @@ def _handle_coordinator_update(self) -> None: class SolarEdgeRefreshButton(SolarEdgeButtonBase): - entity_category = EntityCategory.CONFIG + """Button to request an immediate device data update.""" - def __init__(self, platform, config_entry, coordinator): - super().__init__(platform, config_entry, coordinator) - """Initialize the sensor.""" + entity_category = EntityCategory.CONFIG @property def unique_id(self) -> str: