1 """Support for the for Danfoss Air HRV sensors."""
3 from __future__
import annotations
7 from pydanfossair.commands
import ReadCommand
19 from .
import DOMAIN
as DANFOSS_AIR_DOMAIN
21 _LOGGER = logging.getLogger(__name__)
27 add_entities: AddEntitiesCallback,
28 discovery_info: DiscoveryInfoType |
None =
None,
30 """Set up the available Danfoss Air sensors etc."""
31 data = hass.data[DANFOSS_AIR_DOMAIN]
35 "Danfoss Air Exhaust Temperature",
36 UnitOfTemperature.CELSIUS,
37 ReadCommand.exhaustTemperature,
38 SensorDeviceClass.TEMPERATURE,
39 SensorStateClass.MEASUREMENT,
42 "Danfoss Air Outdoor Temperature",
43 UnitOfTemperature.CELSIUS,
44 ReadCommand.outdoorTemperature,
45 SensorDeviceClass.TEMPERATURE,
46 SensorStateClass.MEASUREMENT,
49 "Danfoss Air Supply Temperature",
50 UnitOfTemperature.CELSIUS,
51 ReadCommand.supplyTemperature,
52 SensorDeviceClass.TEMPERATURE,
53 SensorStateClass.MEASUREMENT,
56 "Danfoss Air Extract Temperature",
57 UnitOfTemperature.CELSIUS,
58 ReadCommand.extractTemperature,
59 SensorDeviceClass.TEMPERATURE,
60 SensorStateClass.MEASUREMENT,
63 "Danfoss Air Remaining Filter",
65 ReadCommand.filterPercent,
70 "Danfoss Air Humidity",
73 SensorDeviceClass.HUMIDITY,
74 SensorStateClass.MEASUREMENT,
76 [
"Danfoss Air Fan Step", PERCENTAGE, ReadCommand.fan_step,
None,
None],
78 "Danfoss Air Exhaust Fan Speed",
79 REVOLUTIONS_PER_MINUTE,
80 ReadCommand.exhaust_fan_speed,
85 "Danfoss Air Supply Fan Speed",
86 REVOLUTIONS_PER_MINUTE,
87 ReadCommand.supply_fan_speed,
92 "Danfoss Air Dial Battery",
94 ReadCommand.battery_percent,
95 SensorDeviceClass.BATTERY,
102 DanfossAir(data, sensor[0], sensor[1], sensor[2], sensor[3], sensor[4])
103 for sensor
in sensors
110 """Representation of a Sensor."""
112 def __init__(self, data, name, sensor_unit, sensor_type, device_class, state_class):
113 """Initialize the sensor."""
123 """Update the new state of the sensor.
125 This is done through the DanfossAir object that does the actual
126 communication with the Air CCM.
132 _LOGGER.debug(
"Could not get data for %s", self.
_type_type)
def __init__(self, data, name, sensor_unit, sensor_type, device_class, state_class)
_attr_native_unit_of_measurement
None setup_platform(HomeAssistant hass, ConfigType config, AddEntitiesCallback add_entities, DiscoveryInfoType|None discovery_info=None)
def add_entities(account, async_add_entities, tracked)
float|int|str|None get_value(Sensor sensor, str field)