1 """Support for an Intergas boiler via an InComfort/Intouch Lan2RF gateway."""
3 from __future__
import annotations
8 from incomfortclient
import Heater
as InComfortHeater
15 from .
import InComfortConfigEntry
16 from .coordinator
import InComfortDataCoordinator
17 from .entity
import IncomfortBoilerEntity
19 _LOGGER = logging.getLogger(__name__)
21 HEATER_ATTRS = [
"display_code",
"display_text",
"is_burning"]
26 entry: InComfortConfigEntry,
27 async_add_entities: AddEntitiesCallback,
29 """Set up an InComfort/InTouch water_heater device."""
30 incomfort_coordinator = entry.runtime_data
31 heaters = incomfort_coordinator.data.heaters
36 """Representation of an InComfort/Intouch water_heater device."""
41 _attr_temperature_unit = UnitOfTemperature.CELSIUS
42 _attr_translation_key =
"boiler"
45 self, coordinator: InComfortDataCoordinator, heater: InComfortHeater
47 """Initialize the water_heater device."""
48 super().
__init__(coordinator, heater)
53 """Return the device state attributes."""
54 return {k: v
for k, v
in self.
_heater_heater.status.items()
if k
in HEATER_ATTRS}
58 """Return the current temperature."""
59 if self.
_heater_heater.is_tapping:
60 return self.
_heater_heater.tap_temp
61 if self.
_heater_heater.is_pumping:
62 return self.
_heater_heater.heater_temp
63 if self.
_heater_heater.heater_temp
is None:
64 return self.
_heater_heater.tap_temp
65 if self.
_heater_heater.tap_temp
is None:
66 return self.
_heater_heater.heater_temp
71 """Return the current operation mode."""
72 return self.
_heater_heater.display_text
None __init__(self, InComfortDataCoordinator coordinator, InComfortHeater heater)
float|None current_temperature(self)
str|None current_operation(self)
dict[str, Any] extra_state_attributes(self)
None async_setup_entry(HomeAssistant hass, InComfortConfigEntry entry, AddEntitiesCallback async_add_entities)