Skip to content

Commit

Permalink
Merge pull request #540 from asantaga/dev
Browse files Browse the repository at this point in the history
v3.4.14
  • Loading branch information
msp1974 authored Dec 4, 2024
2 parents 2304e26 + 2ddc06a commit 26a7fee
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 55 deletions.
28 changes: 16 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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
Expand Down
72 changes: 39 additions & 33 deletions custom_components/wiser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 4 additions & 0 deletions custom_components/wiser/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
12 changes: 6 additions & 6 deletions custom_components/wiser/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1037,19 +1037,19 @@ 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
):
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

Expand Down
2 changes: 1 addition & 1 deletion custom_components/wiser/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion custom_components/wiser/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions custom_components/wiser/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down

0 comments on commit 26a7fee

Please sign in to comment.