1 """Flame height number sensors."""
3 from __future__
import annotations
5 from dataclasses
import dataclass
9 NumberEntityDescription,
16 from .const
import DOMAIN, LOGGER
17 from .coordinator
import IntellifireDataUpdateCoordinator
18 from .entity
import IntellifireEntity
24 async_add_entities: AddEntitiesCallback,
26 """Set up the fans."""
27 coordinator: IntellifireDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
31 translation_key=
"flame_control",
37 coordinator=coordinator, description=description
45 """Flame height control entity."""
47 _attr_native_max_value: float = 5
48 _attr_native_min_value: float = 1
49 _attr_native_step: float = 1
50 _attr_mode: NumberMode = NumberMode.SLIDER
54 coordinator: IntellifireDataUpdateCoordinator,
55 description: NumberEntityDescription,
57 """Initialize Flame height Sensor."""
58 super().
__init__(coordinator, description)
62 """Return the current Flame Height segment number value."""
64 return self.coordinator.read_api.data.flameheight + 1
68 value_to_send: int =
int(value) - 1
70 "%s set flame height to %d with raw value %s",
75 await self.coordinator.control_api.set_flame_height(height=value_to_send)
76 await self.coordinator.async_refresh()
float|None native_value(self)
None __init__(self, IntellifireDataUpdateCoordinator coordinator, NumberEntityDescription description)
None async_set_native_value(self, float value)
str|UndefinedType|None name(self)
None async_setup_entry(HomeAssistant hass, ConfigEntry entry, AddEntitiesCallback async_add_entities)