Skip to content

Commit 54f3734

Browse files
committed
Handle Loria WP without cooling capabilities
1 parent 1569338 commit 54f3734

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

plugwise/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def __init__(
6565
self._elga = False
6666
self._is_thermostat = False
6767
self._last_active: dict[str, str | None] = {}
68+
self._loria = False
6869
self._loc_data: dict[str, ThermoLoc] = {}
6970
self._on_off_device = False
7071
self._opentherm_device = False
@@ -153,6 +154,7 @@ async def connect(self) -> Version:
153154
self._elga,
154155
self._is_thermostat,
155156
self._last_active,
157+
self._loria,
156158
self._loc_data,
157159
self._on_off_device,
158160
self._opentherm_device,
@@ -259,10 +261,13 @@ async def _smile_detect(
259261

260262
# Determine the presence of special features
261263
locator_1 = "./gateway/features/cooling"
262-
locator_2 = "./gateway/features/elga_support"
264+
locator_2 = "./gateway/features/loria_support"
265+
locator_3 = "./gateway/features/elga_support"
263266
if result.find(locator_1) is not None:
264267
self._cooling_present = True
265268
if result.find(locator_2) is not None:
269+
self._loria = True
270+
if result.find(locator_3) is not None:
266271
self._elga = True
267272

268273
async def _smile_detect_legacy(

plugwise/helper.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,9 @@ def _get_measurement_data(self, entity_id: str) -> GwEntityData:
383383
data.pop("c_heating_state")
384384
self._count -= 1
385385

386+
if self._loria and "modulation_level" not in data:
387+
self._cooling_present = False
388+
386389
if self._is_thermostat and self.smile(ANNA):
387390
self._update_anna_cooling(entity_id, data)
388391

@@ -597,7 +600,10 @@ def _process_c_heating_state(self, data: GwEntityData) -> None:
597600
self._process_on_off_device_c_heating_state(data)
598601

599602
# Anna + Elga: use central_heating_state to show heating_state
600-
if self._elga:
603+
if (
604+
self._elga
605+
or (self._loria and "modulation_level" not in data["sensors"])
606+
):
601607
data["binary_sensors"]["heating_state"] = data["c_heating_state"]
602608

603609
def _process_on_off_device_c_heating_state(self, data: GwEntityData) -> None:
@@ -634,7 +640,7 @@ def _update_anna_cooling(self, entity_id: str, data: GwEntityData) -> None:
634640

635641
if "elga_status_code" in data:
636642
self._update_elga_cooling(data)
637-
elif self._cooling_present and "cooling_state" in data["binary_sensors"]:
643+
if self._cooling_present and "cooling_state" in data["binary_sensors"]:
638644
self._update_loria_cooling(data)
639645

640646
def _update_elga_cooling(self, data: GwEntityData) -> None:

plugwise/smile.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def __init__(
4949
_elga: bool,
5050
_is_thermostat: bool,
5151
_last_active: dict[str, str | None],
52+
_loria: bool,
5253
_loc_data: dict[str, ThermoLoc],
5354
_on_off_device: bool,
5455
_opentherm_device: bool,
@@ -69,6 +70,7 @@ def __init__(
6970
self._elga = _elga
7071
self._is_thermostat = _is_thermostat
7172
self._last_active = _last_active
73+
self._loria = _loria
7274
self._loc_data = _loc_data
7375
self._on_off_device = _on_off_device
7476
self._opentherm_device = _opentherm_device

0 commit comments

Comments
 (0)