Skip to content

Commit

Permalink
Merge pull request #451 from asantaga/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
msp1974 committed Mar 5, 2024
2 parents 6d27d21 + ec863f1 commit 3cff816
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 21 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Wiser Home Assistant Integration v3.4.4
# Wiser Home Assistant Integration v3.4.5

[![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 All @@ -24,6 +24,14 @@ For more information checkout the AMAZING community thread available on

## Change log

- v3.4.5
- Bump api to v1.5.12 to improve performance of improved retry handling
- Fixed issue caused by v3.4.4 that heating actuators and power tags error on load (issue [#449](https://github.com/asantaga/wiserHomeAssistantPlatform/issues/449), [#450](https://github.com/asantaga/wiserHomeAssistantPlatform/issues/450))
- Fixed error setting up integration in config flow caused by session parameter being passed when no longer required (issue [#446](https://github.com/asantaga/wiserHomeAssistantPlatform/issues/446))
- Fixed issue on 3 channel hubs with Heating sensor names
- Fixed issue with signal sensor showing unknown on startup until first refresh
- Changed preset icon to HA standard

- v3.4.4
- Bump api to v1.5.11
- Improved api retry handling for inconsitant errors coming from the hub causing errors in the log and entities to go unavailable (issues [#434](https://github.com/asantaga/wiserHomeAssistantPlatform/issues/434), #436, #439)
Expand Down
1 change: 0 additions & 1 deletion custom_components/wiser/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ async def validate_input(hass: HomeAssistant, data):
host=data[CONF_HOST],
port=data[CONF_PORT],
secret=data[CONF_PASSWORD],
session=async_get_clientsession(hass),
extra_config_file=hass.config.config_dir + CUSTOM_DATA_STORE,
enable_automations=False,
)
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 @@ -5,7 +5,7 @@
[email protected]
"""
VERSION = "3.4.4"
VERSION = "3.4.5"
DOMAIN = "wiser"
DATA_WISER_CONFIG = "wiser_config"
URL_BASE = "/wiser"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/wiser/icons.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"wiser": {
"state_attributes": {
"preset_mode": {
"default": "mdi:home-thermometer",
"default": "mdi:tune-variant",
"state": {
"Advance Schedule": "mdi:calendar-arrow-right",
"Cancel Overrides": "mdi:close-circle",
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.5.11"
"aioWiserHeatAPI==1.5.12"
],
"version": "3.4.3",
"version": "3.4.5",
"zeroconf": [
{
"type": "_http._tcp.local.",
Expand Down
54 changes: 39 additions & 15 deletions custom_components/wiser/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ def __init__(self, data, device_id=0, sensor_type="") -> None:
self._device = self._data.wiserhub.system
else:
self._device = self._data.wiserhub.devices.get_by_id(self._device_id)
self._state = self._device.signal.displayed_signal_strength

@callback
def _handle_coordinator_update(self) -> None:
Expand Down Expand Up @@ -540,6 +541,18 @@ def _handle_coordinator_update(self) -> None:
self._state = self._device.current_state
self.async_write_ha_state()

@property
def name(self):
"""Return name of sensor."""
if (
self._sensor_type == "Heating"
and len(self._data.wiserhub.heating_channels.all) > 1
):
return get_device_name(
self._data, 0, self._sensor_type + " Channel " + str(self._device_id)
)
return get_device_name(self._data, 0, self._sensor_type)

@property
def icon(self):
"""Return icon."""
Expand Down Expand Up @@ -1193,25 +1206,36 @@ def _handle_coordinator_update(self) -> None:
"""Fetch new state data for the sensor."""
super()._handle_coordinator_update()
if self._lts_sensor_type == "Power":
self._state = self._data.wiserhub.devices.get_by_id(self._device_id).get(
"instantaneous_power", 0
)
if self._data.wiserhub.devices.get_by_id(
self._device_id
).instantaneous_power:
self._state = self._data.wiserhub.devices.get_by_id(
self._device_id
).instantaneous_power
else:
self._state = 0
elif self._lts_sensor_type == "Energy":
self._state = round(
self._data.wiserhub.devices.get_by_id(self._device_id).get(
"delivered_power", 0
if self._data.wiserhub.devices.get_by_id(self._device_id).delivered_power:
self._state = round(
self._data.wiserhub.devices.get_by_id(
self._device_id
).delivered_power
/ 1000,
2,
)
/ 1000,
2,
)
else:
self._state = 0
elif self._lts_sensor_type == "EnergyReceived":
self._state = round(
self._data.wiserhub.devices.get_by_id(self._device_id).get(
"received_power", 0
if self._data.wiserhub.devices.get_by_id(self._device_id).received_power:
self._state = round(
self._data.wiserhub.devices.get_by_id(
self._device_id
).received_power
/ 1000,
2,
)
/ 1000,
2,
)
else:
self._state = 0
self.async_write_ha_state()

@property
Expand Down

0 comments on commit 3cff816

Please sign in to comment.