diff --git a/README.md b/README.md index 2509e9e..6964696 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Wiser Home Assistant Integration v3.4.13 +# Wiser Home Assistant Integration v3.4.14 [![hacs_badge](https://img.shields.io/badge/HACS-Default-orange.svg?style=for-the-badge)](https://github.com/hacs/integration) [![downloads](https://shields.io/github/downloads/asantaga/wiserHomeAssistantPlatform/latest/total?style=for-the-badge)](https://github.com/asantaga/wiserHomeAssistantPlatform) @@ -29,18 +29,22 @@ For more information checkout the AMAZING community thread available on ## Change log +- v3.4.14 + - Fixed issue causing integration not to load in some circumstances due to failed config entry migration - issue #539 + - Added binary sensor active state sensor + - v3.4.13 - - Added support for PowerTag C - issue #528 - - BREAKING CHANGE - refactored HW climate automation - issues #481, #490. See wiki for updated instructions - - Added illuminance, humidity and temp sensors to devices with threshold sensors - issue #531 - - Added support for 2 gang light switch - issue #529 - - Added interacts with room climate switch to supported devices - - Fixed support for Binary sensors with threshold sensors - issue #530 - - Fixed incompatibility with Python3.13 and HA2024.12 - issue #535 - - Fixed events not correctly firing for climate changes - issue #526 - - Fixed error when saving schedule with an off slot - issue #536 - - Changed all hot water related sensors to now belong to a hot water device - - Bumped aiowiserheatapi to v1.6.3 + - Added support for PowerTag C - issue #528 + - BREAKING CHANGE - refactored HW climate automation - issues #481, #490. See wiki for updated instructions + - Added illuminance, humidity and temp sensors to devices with threshold sensors - issue #531 + - Added support for 2 gang light switch - issue #529 + - Added interacts with room climate switch to supported devices + - Fixed support for Binary sensors with threshold sensors - issue #530 + - Fixed incompatibility with Python3.13 and HA2024.12 - issue #535 + - Fixed events not correctly firing for climate changes - issue #526 + - Fixed error when saving schedule with an off slot - issue #536 + - Changed all hot water related sensors to now belong to a hot water device + - Bumped aiowiserheatapi to v1.6.3 - v3.4.12 - Fixed issue assigning schedules with non ascii characters in name - issue #509 diff --git a/custom_components/wiser/__init__.py b/custom_components/wiser/__init__.py index 0657e88..ea13310 100755 --- a/custom_components/wiser/__init__.py +++ b/custom_components/wiser/__init__.py @@ -48,44 +48,50 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> if config_entry.version == 1: new_options = {**config_entry.options} - if config_entry.minor_version < 2: + if config_entry.minor_version < 3: # move passive mode options into new section - if new_options.get(CONF_AUTOMATIONS_PASSIVE): - new_options[CONF_AUTOMATIONS_PASSIVE] = { - CONF_AUTOMATIONS_PASSIVE: new_options[CONF_AUTOMATIONS_PASSIVE] - } - for item in [ - CONF_AUTOMATIONS_PASSIVE_TEMP_INCREMENT, - ]: - if new_options.get(item): - new_options[CONF_AUTOMATIONS_PASSIVE][item] = new_options[item] - del new_options[item] + if new_options.get(CONF_AUTOMATIONS_PASSIVE) is not None: + # detect if failed last upgrade to minor version 2 + if isinstance(new_options.get(CONF_AUTOMATIONS_PASSIVE), bool): + new_options[CONF_AUTOMATIONS_PASSIVE] = { + CONF_AUTOMATIONS_PASSIVE: new_options[CONF_AUTOMATIONS_PASSIVE] + } + for item in [ + CONF_AUTOMATIONS_PASSIVE_TEMP_INCREMENT, + ]: + if new_options.get(item): + new_options[CONF_AUTOMATIONS_PASSIVE][item] = new_options[ + item + ] + del new_options[item] # hw climate - if new_options.get(CONF_AUTOMATIONS_HW_CLIMATE): - if new_options.get(CONF_DEPRECATED_HW_TARGET_TEMP): - del new_options[CONF_DEPRECATED_HW_TARGET_TEMP] - - new_options[CONF_AUTOMATIONS_HW_CLIMATE] = { - CONF_AUTOMATIONS_HW_CLIMATE: new_options[ - CONF_AUTOMATIONS_HW_CLIMATE - ] - } - for item in [ - CONF_AUTOMATIONS_HW_AUTO_MODE, - CONF_AUTOMATIONS_HW_HEAT_MODE, - CONF_AUTOMATIONS_HW_SENSOR_ENTITY_ID, - ]: - if value := new_options.get(item): - if value == "Normal": - value = HWCycleModes.CONTINUOUS - if value == "Override": - value = HWCycleModes.ONCE - new_options[CONF_AUTOMATIONS_HW_CLIMATE][item] = value - del new_options[item] + if new_options.get(CONF_AUTOMATIONS_HW_CLIMATE) is not None: + # detect if failed last upgrade to minor version 2 + if isinstance(new_options.get(CONF_AUTOMATIONS_HW_CLIMATE), bool): + if new_options.get(CONF_DEPRECATED_HW_TARGET_TEMP): + del new_options[CONF_DEPRECATED_HW_TARGET_TEMP] + + new_options[CONF_AUTOMATIONS_HW_CLIMATE] = { + CONF_AUTOMATIONS_HW_CLIMATE: new_options[ + CONF_AUTOMATIONS_HW_CLIMATE + ] + } + for item in [ + CONF_AUTOMATIONS_HW_AUTO_MODE, + CONF_AUTOMATIONS_HW_HEAT_MODE, + CONF_AUTOMATIONS_HW_SENSOR_ENTITY_ID, + ]: + if value := new_options.get(item): + if value == "Normal": + value = HWCycleModes.CONTINUOUS + if value == "Override": + value = HWCycleModes.ONCE + new_options[CONF_AUTOMATIONS_HW_CLIMATE][item] = value + del new_options[item] hass.config_entries.async_update_entry( - config_entry, options=new_options, minor_version=2, version=1 + config_entry, options=new_options, minor_version=3, version=1 ) _LOGGER.debug( diff --git a/custom_components/wiser/binary_sensor.py b/custom_components/wiser/binary_sensor.py index b16d483..bf114ab 100644 --- a/custom_components/wiser/binary_sensor.py +++ b/custom_components/wiser/binary_sensor.py @@ -62,6 +62,10 @@ async def async_setup_entry(hass: HomeAssistant, config_entry, async_add_entitie ] ) + # Binary sensors active + for device in data.wiserhub.devices.binary_sensor.all: + binary_sensors.extend([BaseBinarySensor(data, device.id, "Active")]) + async_add_entities(binary_sensors, True) diff --git a/custom_components/wiser/climate.py b/custom_components/wiser/climate.py index 8e7430b..676cdff 100755 --- a/custom_components/wiser/climate.py +++ b/custom_components/wiser/climate.py @@ -1037,7 +1037,12 @@ async def run_automation(self) -> bool: updated = False should_heat = self.hotwater.is_heating - # Reasons it shoudl heat + if self.hvac_mode == HVACMode.OFF: + # HW is off. Just return here as if turned on by app or hub, will go + # into manual mode. + return False + + # Reasons it should heat if self.current_temperature <= self.target_temperature_low or ( self.current_temperature <= self.target_temperature_high and self.hotwater.is_heating @@ -1045,11 +1050,6 @@ async def run_automation(self) -> bool: should_heat = True # Now all reasons it should not heat - if self.hvac_mode == HVACMode.OFF: - # HW is off. Just return here as if turned on by app or hub, will go - # into manual mode. - return False - if not self.hotwater.is_boosted: # Boost overrides all other mode settings diff --git a/custom_components/wiser/config_flow.py b/custom_components/wiser/config_flow.py index 704640b..7563d40 100755 --- a/custom_components/wiser/config_flow.py +++ b/custom_components/wiser/config_flow.py @@ -104,7 +104,7 @@ class WiserFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): """ VERSION = 1 - MINOR_VERSION = 2 + MINOR_VERSION = 3 CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_POLL def __init__(self) -> None: diff --git a/custom_components/wiser/const.py b/custom_components/wiser/const.py index 258404d..92e4a4e 100755 --- a/custom_components/wiser/const.py +++ b/custom_components/wiser/const.py @@ -9,7 +9,7 @@ from enum import StrEnum -VERSION = "3.4.13" +VERSION = "3.4.14" DOMAIN = "wiser" DATA_WISER_CONFIG = "wiser_config" URL_BASE = "/wiser" diff --git a/custom_components/wiser/manifest.json b/custom_components/wiser/manifest.json index 6299a9e..aeb4788 100755 --- a/custom_components/wiser/manifest.json +++ b/custom_components/wiser/manifest.json @@ -16,9 +16,9 @@ "iot_class": "local_polling", "issue_tracker": "https://github.com/asantaga/wiserHomeAssistantPlatform/issues", "requirements": [ - "aioWiserHeatAPI==1.6.3" + "aioWiserHeatAPI==1.6.4" ], - "version": "3.4.13", + "version": "3.4.14", "zeroconf": [ { "type": "_http._tcp.local.",