1 """Support for Vallox ventilation unit numbers."""
3 from __future__
import annotations
5 from dataclasses
import dataclass
7 from vallox_websocket_api
import Vallox
12 NumberEntityDescription,
19 from .const
import DOMAIN
20 from .coordinator
import ValloxDataUpdateCoordinator
21 from .entity
import ValloxEntity
25 """Representation of a Vallox number entity."""
27 entity_description: ValloxNumberEntityDescription
28 _attr_entity_category = EntityCategory.CONFIG
33 coordinator: ValloxDataUpdateCoordinator,
34 description: ValloxNumberEntityDescription,
37 """Initialize the Vallox number entity."""
47 """Return the value reported by the sensor."""
49 value := self.coordinator.data.get(self.
entity_descriptionentity_description.metric_key)
56 """Update the current value."""
57 await self.
_client_client.set_values(
63 @dataclass(frozen=True, kw_only=True)
65 """Describes Vallox number entity."""
70 NUMBER_ENTITIES: tuple[ValloxNumberEntityDescription, ...] = (
72 key=
"supply_air_target_home",
73 translation_key=
"supply_air_target_home",
74 metric_key=
"A_CYC_HOME_AIR_TEMP_TARGET",
75 device_class=NumberDeviceClass.TEMPERATURE,
76 native_unit_of_measurement=UnitOfTemperature.CELSIUS,
78 native_max_value=25.0,
82 key=
"supply_air_target_away",
83 translation_key=
"supply_air_target_away",
84 metric_key=
"A_CYC_AWAY_AIR_TEMP_TARGET",
85 device_class=NumberDeviceClass.TEMPERATURE,
86 native_unit_of_measurement=UnitOfTemperature.CELSIUS,
88 native_max_value=25.0,
92 key=
"supply_air_target_boost",
93 translation_key=
"supply_air_target_boost",
94 metric_key=
"A_CYC_BOOST_AIR_TEMP_TARGET",
95 device_class=NumberDeviceClass.TEMPERATURE,
96 native_unit_of_measurement=UnitOfTemperature.CELSIUS,
98 native_max_value=25.0,
105 hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
107 """Set up the sensors."""
108 data = hass.data[DOMAIN][entry.entry_id]
112 data[
"name"], data[
"coordinator"], description, data[
"client"]
114 for description
in NUMBER_ENTITIES
None async_set_native_value(self, float value)
float|None native_value(self)
None __init__(self, str name, ValloxDataUpdateCoordinator coordinator, ValloxNumberEntityDescription description, Vallox client)
None async_request_refresh(self)
None async_setup_entry(HomeAssistant hass, ConfigEntry entry, AddEntitiesCallback async_add_entities)