diff --git a/README.md b/README.md index 18c29f4..6901f4d 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Drayton Wiser Hub API Async v1.6.4 +# Drayton Wiser Hub API Async v1.6.5 This repository contains a simple API which queries the Drayton Wiser Heating sysystem used in the UK. @@ -52,6 +52,9 @@ Documentation available in [info.md](https://github.com/msp1974/wiserHeatAPIv2/b ## Changelog +### v1.6.5 +* Fix: improve status handling of hot water for hw climate mode + ### v1.6.4 * Fix: fix issue of default extra config values not being provided diff --git a/aioWiserHeatAPI/__init__.py b/aioWiserHeatAPI/__init__.py index 4681174..526327c 100755 --- a/aioWiserHeatAPI/__init__.py +++ b/aioWiserHeatAPI/__init__.py @@ -3,6 +3,6 @@ name = "aioWiserHeatAPI" __all__ = ["wiserAPI", "wiserDiscovery"] -__VERSION__ = "1.6.4" +__VERSION__ = "1.6.5" _LOGGER = logging.getLogger(__name__) diff --git a/aioWiserHeatAPI/hot_water.py b/aioWiserHeatAPI/hot_water.py index f846e89..3630e28 100755 --- a/aioWiserHeatAPI/hot_water.py +++ b/aioWiserHeatAPI/hot_water.py @@ -52,6 +52,8 @@ def __init__( "manual_heat": False, } + self._current_temperature: float = 0.0 + # Add device id to schedule if self._schedule: self.schedule._assignments.append({"id": self.id, "name": self.name}) @@ -103,8 +105,8 @@ def available_modes(self) -> list[str]: @property def available_presets(self) -> list: """Get available preset modes""" - # Remove advance schedule if no schedule exists or in passive mode - if not self.schedule: + # Remove advance schedule if no schedule exists or in climate mode + if not self.schedule or self.is_climate_mode: return [ mode.value for mode in WiserPresetOptionsEnum @@ -183,14 +185,13 @@ def is_climate_mode_off(self) -> bool: if self.is_climate_mode: if ( (self._extra_config and self._extra_config.get("climate_off", False)) - and self._data.get("Mode") - in [WiserDeviceModeEnum.manual.value, WiserDeviceModeEnum.auto.value] + and self._data.get("Mode") == WiserDeviceModeEnum.manual.value and not self.is_heating ): return True # If not off but extr_config says it is, update extra config. - elif self._extra_config: + elif not self.is_boosted and self._extra_config: if self._extra_config.get("climate_off"): asyncio.get_running_loop().create_task( self._update_extra_config("climate_off", False) @@ -215,7 +216,11 @@ async def set_manual_heat(self, enabled: bool): def mode(self) -> str | None: """Get or set the current hot water mode (On, Off or Auto)""" try: - return TEXT_OFF if self.is_climate_mode_off else self._data.get("Mode") + return ( + TEXT_OFF + if self.is_climate_mode_off and not self.is_boosted + else self._data.get("Mode") + ) except KeyError: return None @@ -304,6 +309,11 @@ def setpoint_origin(self) -> str: """Get the origin of the current status for the hotwater""" return self._data.get("HotWaterDescription", TEXT_UNKNOWN) + @property + def current_temperature(self) -> float: + """Return current temperature.""" + return self._current_temperature + @property def current_target_temperature(self) -> float: """Return current saved target temperature if in climate mode""" @@ -372,7 +382,7 @@ async def boost(self, duration: int, state: str = TEXT_ON) -> bool: param duration: the duration to turn on for in minutes return: boolean """ - return await self.override_state_for_duration(TEXT_ON, duration) + return await self.override_state_for_duration(state, duration) async def cancel_boost(self) -> bool | None: """