Skip to content

Commit

Permalink
Merge pull request #29 from msp1974/dev
Browse files Browse the repository at this point in the history
v1.6.5
  • Loading branch information
msp1974 authored Dec 8, 2024
2 parents 72e84f5 + 52d8a14 commit 67b0c74
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion aioWiserHeatAPI/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
name = "aioWiserHeatAPI"
__all__ = ["wiserAPI", "wiserDiscovery"]

__VERSION__ = "1.6.4"
__VERSION__ = "1.6.5"

_LOGGER = logging.getLogger(__name__)
24 changes: 17 additions & 7 deletions aioWiserHeatAPI/hot_water.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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

Expand Down Expand Up @@ -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"""
Expand Down Expand Up @@ -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:
"""
Expand Down

0 comments on commit 67b0c74

Please sign in to comment.