Skip to content

Commit

Permalink
Merge pull request #408 from asantaga/dev
Browse files Browse the repository at this point in the history
v3.4.0beta
  • Loading branch information
msp1974 authored Dec 7, 2023
2 parents 80eb457 + 5c58dee commit 2da86c0
Show file tree
Hide file tree
Showing 8 changed files with 191 additions and 39 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Wiser Home Assistant Integration v3.3.11
# Wiser Home Assistant Integration v3.4.0beta

[![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 @@ -15,17 +15,19 @@ Detailed information about this integration has now been moved to our [Wiki page
For more information checkout the AMAZING community thread available on
[https://community.home-assistant.io/t/drayton-wiser-home-assistant-integration/80965](https://community.home-assistant.io/t/drayton-wiser-home-assistant-integration/80965)

## What's New in 3.3?
## What's New in 3.4?

- Improved support for Opentherm boilers with flow and return temp sensors and many attributes.
- Support of heating actuator floor sensors
- TRV passive mode (inspired by @robertwigley). An inbuilt automation in the integration to create passive TRVs that will only heat when other rooms are heating. Integration automations must be enabled to support this.
- Improved data in Wiser events
- Improved error handling for setting schedules from YAML files
- Improved zigbee network card
- Added support for v2 hub
- Added PowerTagE support

## Change log

- v3.4.0beta
- Fixed issue in HA 2023.12 with errors reading hub
- Add PowerTagE support (v2 hub)
- Add tilt functions for shutters (v2 hub)
- Fixed issue whereby non ASCII chars are removed in device/room names - issues #396

- v3.3.11
- Add check for overrides to prevent turning off away modewhen selecting cancel overrides when none exist (Wiser hub bug)
- Correct sensor device class and native values to fix history not displaying issue in HA 2023.11
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 @@ -10,7 +10,7 @@
URL_BASE = "/wiser"
WISER_CARD_FILENAMES = ["wiser-schedule-card.js", "wiser-zigbee-card.js"]

VERSION = "3.3.11"
VERSION = "3.4.0"
WISER_PLATFORMS = [
"climate",
"sensor",
Expand Down
2 changes: 2 additions & 0 deletions custom_components/wiser/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def __init__(self, hass: HomeAssistant, config_entry: ConfigEntry) -> None:
),
)

self.hub_version = 0
self.last_update_time = datetime.now()
self.last_update_status = ""
self.minimum_temp = TEMP_MINIMUM
Expand Down Expand Up @@ -134,6 +135,7 @@ def __init__(self, hass: HomeAssistant, config_entry: ConfigEntry) -> None:
async def async_update_data(self) -> WiserData:
try:
await self.wiserhub.read_hub_data()
self.hub_version = self.wiserhub.system.hardware_generation
self.last_update_time = datetime.now()
self.last_update_status = "Success"

Expand Down
50 changes: 47 additions & 3 deletions custom_components/wiser/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
"""
import asyncio
import logging
from typing import Any

from homeassistant.components.cover import (
ATTR_POSITION,
ATTR_TILT_POSITION,
CoverEntity,
CoverEntityFeature,
)
Expand All @@ -25,8 +28,6 @@
)
from .helpers import get_device_name, get_identifier

import logging

MANUFACTURER = MANUFACTURER_SCHNEIDER

_LOGGER = logging.getLogger(__name__)
Expand All @@ -38,6 +39,8 @@
| CoverEntityFeature.STOP
)

TILT_SUPPORT_FLAGS = (CoverEntityFeature.OPEN_TILT | CoverEntityFeature.CLOSE_TILT | CoverEntityFeature.SET_TILT_POSITION | CoverEntityFeature.STOP_TILT)


async def async_setup_entry(hass: HomeAssistant, config_entry, async_add_entities):
"""Set up Wiser shutter device."""
Expand Down Expand Up @@ -80,6 +83,8 @@ def _handle_coordinator_update(self) -> None:
@property
def supported_features(self):
"""Flag supported features."""
if self._device.is_tilt_supported:
return SUPPORT_FLAGS + TILT_SUPPORT_FLAGS
return SUPPORT_FLAGS

@property
Expand All @@ -89,7 +94,7 @@ def device_info(self):
"name": get_device_name(self._data, self._device_id),
"identifiers": {(DOMAIN, get_identifier(self._data, self._device_id))},
"manufacturer": MANUFACTURER,
"model": self._data.wiserhub.devices.get_by_id(self._device_id).model,
"model": self._data.wiserhub.devices.get_by_id(self._device_id).product_type,
"via_device": (DOMAIN, self._data.wiserhub.system.name),
}

Expand All @@ -108,6 +113,11 @@ def current_cover_position(self):
"""Return current position from data."""
return self._device.current_lift

@property
def current_cover_tilt_position(self) -> int | None:
"""Return current position of cover tilt."""
return self._device.current_tilt

@property
def is_closed(self):
return self._device.is_closed
Expand Down Expand Up @@ -174,6 +184,16 @@ def extra_state_attributes(self):
attrs["target_lift"] = self._device.target_lift
attrs["scheduled_lift"] = self._device.scheduled_lift

if self._device.is_tilt_supported:
# Tilt settings
attrs["current_tilt"] = self._device.current_tilt
attrs["manual_tilt"] = self._device.manual_tilt
attrs["target_tilt"] = self._device.target_tilt
attrs["tilt_time"] = self._device.drive_config.tilt_time
attrs["tilt_angle_closed"] = self._device.drive_config.tilt_angle_closed
attrs["tilt_angle_open"] = self._device.drive_config.tilt_angle_open
attrs["tilt_movement"] = self._device.tilt_movement

# Schedule
attrs["schedule_id"] = self._device.schedule_id
if self._device.schedule:
Expand Down Expand Up @@ -209,3 +229,27 @@ async def async_stop_cover(self, **kwargs):
_LOGGER.debug(f"Stopping {self.name}")
await self._device.stop()
await self.async_force_update()

async def async_set_cover_tilt_position(self, **kwargs: Any) -> None:
"""Move the cover tilt to a specific position."""
position = kwargs[ATTR_TILT_POSITION]
_LOGGER.debug(f"Setting cover tilt position for {self.name} to {position}")
await self._device.open_tilt(position)
await self.async_force_update()

async def async_close_cover_tilt(self, **kwargs):
"""Close shutter"""
_LOGGER.debug(f"Closing tilt {self.name}")
await self._device.close_tilt()
await self.async_force_update()

async def async_open_cover_tilt(self, **kwargs: Any) -> None:
"""Open the cover tilt."""
await self._device.open_tilt()
await self.async_force_update()

async def async_stop_cover_tilt(self, **kwargs):
"""Stop shutter"""
_LOGGER.debug(f"Stopping tilt {self.name}")
await self._device.stop_tilt()
await self.async_force_update()
3 changes: 3 additions & 0 deletions custom_components/wiser/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ def get_device_name(data, device_id, device_type="device"):
if device.product_type == "SmartPlug":
return f"{ENTITY_PREFIX} {device.name}"

if device.product_type == "PowerTagE":
return f"{ENTITY_PREFIX} {device.name}"

if device.product_type in ["Shutter", "OnOffLight", "DimmableLight"]:
device_room = data.wiserhub.rooms.get_by_device_id(device_id)
# If device not allocated to a room return type and id only
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.3.9"
"aioWiserHeatAPI==1.5.0"
],
"version": "3.3.11",
"version": "3.4.0",
"zeroconf": [
{
"type": "_http._tcp.local.",
Expand Down
Loading

0 comments on commit 2da86c0

Please sign in to comment.