Skip to content

Commit

Permalink
Use the Home+Control /setstate API to modify room heating if home has…
Browse files Browse the repository at this point in the history
… a BNS (#496)

* Added function to check if any room has a BNS device

* Use _async_therm_set instead if home has a BNS

Use _async_therm_set instead of _async_set_thermpoint if the home has a BNS (Smarther with Netatmo thermostat)

---------

Co-authored-by: Tobias Sauerwein <[email protected]>
  • Loading branch information
fabianocattaneo and cgtobi authored Aug 18, 2024
1 parent 3247837 commit 07fb2b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/pyatmo/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ def has_otm(self) -> bool:

return any("OTM" in room.device_types for room in self.rooms.values())

def has_bns(self) -> bool:
"""Check if any room has a BNS device."""

return any("BNS" in room.device_types for room in self.rooms.values())

def get_hg_temp(self) -> float | None:
"""Return frost guard temperature value for given home."""

Expand Down
4 changes: 3 additions & 1 deletion src/pyatmo/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ async def async_therm_set(
mode = MODE_MAP.get(mode, mode)

if "NATherm1" in self.device_types or (
"NRV" in self.device_types and not self.home.has_otm()
"NRV" in self.device_types
and not self.home.has_otm()
and not self.home.has_bns()
):
await self._async_set_thermpoint(mode, temp, end_time)

Expand Down

0 comments on commit 07fb2b6

Please sign in to comment.