-
-
Notifications
You must be signed in to change notification settings - Fork 37.3k
fix Myneomitis sub-devices #168631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
fix Myneomitis sub-devices #168631
Changes from all commits
3ec7ca5
4d20ed7
64e7a75
7f4b3bb
257ef2e
7c41f3d
f10b7f1
73713ef
4264d3f
6047c16
c5b49f9
2d74032
01bbe98
daf7758
3e133ba
82a6546
89e987e
d1cf319
24cd411
e188940
daf293f
321c0f5
7dafd40
74a23ba
d4426ba
189f330
1df0f45
9f20db5
da736da
9f9b168
d4a0747
4bf6cff
acba73e
0a90b50
5c6f328
feba344
b034557
029d768
5c2c709
1f858eb
42b2ffb
0c74ab5
39421a6
3ab9b2c
53831de
00a7052
8c62f88
8cee654
97a4ba0
53edd7e
5810ea7
e4e053b
52161bb
afcce0f
f1785dd
310b4a3
7c4dbea
a889d7a
bd40bb5
013621a
f1f8484
f5f1c5c
ea70dfd
4da2a66
41d4259
195c823
8e8d77f
6478b4e
831bf54
02aa014
3d0c871
6d65f86
fedafe2
1b58b0e
ba4293d
8ea9658
06a038d
5ee42dc
4a7c074
ec2e541
4b8659a
039bfa7
c6838d3
3e5ba84
72843c8
bdc1591
cacc0da
031bdd6
ef75bb8
5369cdd
fe1c2ea
3484691
77a833c
f666d29
95820f3
4cb86e8
bea8e38
090bfc1
c6dbc85
fa7ad28
252639a
9a14c02
8edcb80
0e4f97a
904ec88
834b610
ed530e8
35375f7
4c6d6a7
66f5d53
eb41eb1
5995df0
b881c42
bfd42c8
70dd771
cbc4e24
082d894
1fb9c6b
1ab1361
d1e080a
9a2c8cc
1738537
456a473
7a812c9
261c1e7
37788a0
dc912f2
af9cd83
e2d3e43
74b2c78
4813d73
a0b6caa
9335f5c
0072f19
f232194
2f701f6
cf83f12
1bc1bba
fefe4fc
bbeaa31
7a7b04a
03ee89d
8b6574d
dac2b57
4432479
a02ee49
64a2f1e
d782290
bc7d5e6
ab8c4e1
73d9a93
1f68bfb
91df773
8bf7de0
36ecc94
121f4c3
5f79736
9d3c1ea
3a77ea0
6f1d662
8df1a65
49f15c9
a54f7e1
ce453bd
5c703d1
c00ddf0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -93,7 +93,7 @@ def __init__(self, api: PyAxencoAPI, device: dict[str, Any]) -> None: | |||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| state = device.get("state", {}) | ||||||||||||||||||||||||||
| self._is_sub_device = model in SUPPORTED_SUB_MODELS | ||||||||||||||||||||||||||
| self._parents = device.get("parents") or {} | ||||||||||||||||||||||||||
| self._parents = device.get("parents") | ||||||||||||||||||||||||||
| if model in PRESET_MODE_MODELS: | ||||||||||||||||||||||||||
| self._attr_preset_modes = PRESET_MODE_MODELS[model] | ||||||||||||||||||||||||||
| else: | ||||||||||||||||||||||||||
|
|
@@ -122,7 +122,7 @@ def __init__(self, api: PyAxencoAPI, device: dict[str, Any]) -> None: | |||||||||||||||||||||||||
| if self._attr_preset_mode and self._attr_preset_mode != "standby" | ||||||||||||||||||||||||||
| else None | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
| if model == "NTD" and state.get("changeOverUser") == 1: | ||||||||||||||||||||||||||
| if model == "NTD" and state.get("comfTemp") < state.get("ecoTemp"): | ||||||||||||||||||||||||||
| self._attr_hvac_modes = [HVACMode.COOL, HVACMode.OFF] | ||||||||||||||||||||||||||
| self._attr_hvac_mode = ( | ||||||||||||||||||||||||||
| HVACMode.OFF | ||||||||||||||||||||||||||
|
|
@@ -315,7 +315,11 @@ async def _set_device_mode(self, mode: str) -> bool: | |||||||||||||||||||||||||
| return False | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| if self._is_sub_device: | ||||||||||||||||||||||||||
| gateway = self._parents.get("gateway") | ||||||||||||||||||||||||||
| gateway = ( | ||||||||||||||||||||||||||
| self._parents.split(",")[1] | ||||||||||||||||||||||||||
| if isinstance(self._parents, str) | ||||||||||||||||||||||||||
| else None | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
|
Comment on lines
+318
to
+322
|
||||||||||||||||||||||||||
| rfid = self._device.get("rfid") | ||||||||||||||||||||||||||
| if not gateway or not rfid: | ||||||||||||||||||||||||||
| _LOGGER.error( | ||||||||||||||||||||||||||
|
|
@@ -336,7 +340,11 @@ async def _set_device_temperature(self, temperature: float) -> bool: | |||||||||||||||||||||||||
| """Set the device temperature via API.""" | ||||||||||||||||||||||||||
| try: | ||||||||||||||||||||||||||
| if self._is_sub_device: | ||||||||||||||||||||||||||
| gateway = self._parents.get("gateway") | ||||||||||||||||||||||||||
| gateway = ( | ||||||||||||||||||||||||||
| self._parents.split(",")[1] | ||||||||||||||||||||||||||
| if isinstance(self._parents, str) | ||||||||||||||||||||||||||
| else None | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
|
Comment on lines
+343
to
+347
|
||||||||||||||||||||||||||
| gateway = ( | |
| self._parents.split(",")[1] | |
| if isinstance(self._parents, str) | |
| else None | |
| ) | |
| gateway = None | |
| if isinstance(self._parents, str): | |
| parent_parts = [ | |
| part.strip() for part in self._parents.split(",") if part.strip() | |
| ] | |
| if parent_parts: | |
| gateway = parent_parts[-1] |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -9,10 +9,12 @@ | |||||||||||||||||||||||||
| import logging | ||||||||||||||||||||||||||
| from typing import Any | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| import aiohttp | ||||||||||||||||||||||||||
| from pyaxencoapi import PyAxencoAPI | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| from homeassistant.components.select import SelectEntity, SelectEntityDescription | ||||||||||||||||||||||||||
| from homeassistant.core import HomeAssistant, callback | ||||||||||||||||||||||||||
| from homeassistant.exceptions import HomeAssistantError | ||||||||||||||||||||||||||
| from homeassistant.helpers import device_registry as dr | ||||||||||||||||||||||||||
| from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
@@ -141,6 +143,7 @@ def __init__( | |||||||||||||||||||||||||
| self.entity_description = description | ||||||||||||||||||||||||||
| self._api = api | ||||||||||||||||||||||||||
| self._device = device | ||||||||||||||||||||||||||
| self._parents = device.get("parents") | ||||||||||||||||||||||||||
| self._attr_unique_id = device["_id"] | ||||||||||||||||||||||||||
| self._attr_available = device["connected"] | ||||||||||||||||||||||||||
| self._attr_device_info = dr.DeviceInfo( | ||||||||||||||||||||||||||
|
|
@@ -199,6 +202,29 @@ async def async_select_option(self, option: str) -> None: | |||||||||||||||||||||||||
| _LOGGER.warning("Unknown mode selected: %s", option) | ||||||||||||||||||||||||||
| return | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| await self._api.set_device_mode(self._device["_id"], mode_code) | ||||||||||||||||||||||||||
| try: | ||||||||||||||||||||||||||
| if self._device["model"] in SUPPORTED_MODELS: | ||||||||||||||||||||||||||
| await self._api.set_device_mode(self._device["_id"], mode_code) | ||||||||||||||||||||||||||
| else: # UFH | ||||||||||||||||||||||||||
| gateway = ( | ||||||||||||||||||||||||||
| self._parents.split(",")[1] | ||||||||||||||||||||||||||
| if isinstance(self._parents, str) | ||||||||||||||||||||||||||
| else None | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
|
Comment on lines
+209
to
+213
|
||||||||||||||||||||||||||
| gateway = ( | |
| self._parents.split(",")[1] | |
| if isinstance(self._parents, str) | |
| else None | |
| ) | |
| gateway = None | |
| if isinstance(self._parents, str): | |
| parent_parts = [ | |
| part.strip() for part in self._parents.split(",") if part.strip() | |
| ] | |
| if len(parent_parts) >= 2: | |
| gateway = parent_parts[-1] |
Copilot
AI
Apr 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a test that exercises the UFH sub-device path in async_select_option (including the parents/rfid handling and the set_sub_device_mode_ufh call), since current tests only cover the non-sub-device set_device_mode branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guard the NTD COOL/OFF detection against missing/non-numeric
comfTemp/ecoTempvalues (or make them required) to avoid aTypeErrorwhen comparingNoneto a number.