1 """Allows reading temperatures from ecoal/esterownik.pl controller."""
3 from __future__
import annotations
11 from .
import AVAILABLE_SENSORS, DATA_ECOAL_BOILER
17 add_entities: AddEntitiesCallback,
18 discovery_info: DiscoveryInfoType |
None =
None,
20 """Set up the ecoal sensors."""
21 if discovery_info
is None:
24 ecoal_contr = hass.data[DATA_ECOAL_BOILER]
25 for sensor_id
in discovery_info:
26 name = AVAILABLE_SENSORS[sensor_id]
32 """Representation of a temperature sensor using ecoal status data."""
34 _attr_device_class = SensorDeviceClass.TEMPERATURE
35 _attr_native_unit_of_measurement = UnitOfTemperature.CELSIUS
37 def __init__(self, ecoal_contr, name, status_attr):
38 """Initialize the sensor."""
44 """Fetch new state data for the sensor.
46 This is the only method that should fetch new data for Home Assistant.
49 status = self.
_ecoal_contr_ecoal_contr.get_cached_status()
def __init__(self, ecoal_contr, name, status_attr)
None setup_platform(HomeAssistant hass, ConfigType config, AddEntitiesCallback add_entities, DiscoveryInfoType|None discovery_info=None)
def add_entities(account, async_add_entities, tracked)