1 """Platform to control a Renson ventilation unit."""
3 from __future__
import annotations
7 from renson_endura_delta.field_enum
import FILTER_PRESET_FIELD, DataType
8 from renson_endura_delta.renson
import RensonVentilation
13 NumberEntityDescription,
20 from .const
import DOMAIN
21 from .coordinator
import RensonCoordinator
22 from .entity
import RensonEntity
24 _LOGGER = logging.getLogger(__name__)
29 translation_key=
"filter_change",
33 entity_category=EntityCategory.CONFIG,
35 device_class=NumberDeviceClass.DURATION,
36 native_unit_of_measurement=UnitOfTime.DAYS,
42 config_entry: ConfigEntry,
43 async_add_entities: AddEntitiesCallback,
45 """Set up the Renson number platform."""
47 api: RensonVentilation = hass.data[DOMAIN][config_entry.entry_id].api
48 coordinator: RensonCoordinator = hass.data[DOMAIN][
56 """Representation of the Renson number platform."""
60 description: NumberEntityDescription,
61 api: RensonVentilation,
62 coordinator: RensonCoordinator,
64 """Initialize the Renson number."""
65 super().
__init__(description.key, api, coordinator)
71 """Handle updated data from the coordinator."""
73 self.
apiapiapi.get_field_value(self.coordinator.data, FILTER_PRESET_FIELD.name),
80 """Update the current value."""
82 await self.
hasshasshass.async_add_executor_job(self.
apiapiapi.set_filter_days, value)
None async_set_native_value(self, float value)
None __init__(self, NumberEntityDescription description, RensonVentilation api, RensonCoordinator coordinator)
None _handle_coordinator_update(self)
None async_request_refresh(self)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)