Bump to v0.4.0

This commit is contained in:
Andre Basche 2023-04-08 06:15:33 +02:00
parent c78aeb1fbb
commit e1a2af70e9
6 changed files with 23 additions and 34 deletions

View File

@ -1,26 +1,27 @@
# Haier hOn # Haier hOn
[![hacs_badge](https://img.shields.io/badge/HACS-Default-41BDF5.svg)](https://github.com/hacs/integration) [![hacs_badge](https://img.shields.io/badge/HACS-Default-41BDF5.svg)](https://github.com/hacs/integration)
[![GitHub manifest version (path)](https://img.shields.io/github/manifest-json/v/andre0512/hon?color=g&filename=custom_components%2Fhon%2Fmanifest.json)](https://github.com/Andre0512/hon/releases/latest)
[![Home Assistant installs](https://img.shields.io/badge/dynamic/json?color=41BDF5&label=usage&suffix=%20installs&cacheSeconds=15600&url=https://analytics.home-assistant.io/custom_integrations.json&query=$.hon.total)](https://analytics.home-assistant.io/)
Home Assistant integration for Haier hOn: support for Haier/Candy/Hoover home appliances like washing machines. Home Assistant integration for Haier hOn: support for Haier/Candy/Hoover home appliances like washing machines.
## Supported Appliances ## Supported Appliances
- Washing Machine
- Tumble Dryer - Tumble Dryer
- Washer Dryer
- Washing Machine
- Oven
## Installation ## Installation
[![Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=Andre0512&repository=hon&category=integration) **Method 1:** [![Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=Andre0512&repository=hon&category=integration)
**Method 1:** [HACS](https://hacs.xyz/) > Integrations > Add Integration > **Haier hOn** > Install **Method 2:** [HACS](https://hacs.xyz/) > Integrations > Add Integration > **Haier hOn** > Install
**Method 2.** Manually copy `hon` folder from [latest release](https://github.com/Andre0512/hon/releases/latest) to `/config/custom_components` folder. **Method 3:** Manually copy `hon` folder from [latest release](https://github.com/Andre0512/hon/releases/latest) to `config/custom_components` folder.
## Configuration ## Configuration
[![Open your Home Assistant instance and start setting up a new integration.](https://my.home-assistant.io/badges/config_flow_start.svg)](https://my.home-assistant.io/redirect/config_flow_start/?domain=hon) **Method 1**: [![Open your Home Assistant instance and start setting up a new integration.](https://my.home-assistant.io/badges/config_flow_start.svg)](https://my.home-assistant.io/redirect/config_flow_start/?domain=hon)
Settings > Devices & Services > Add Integration > **Haier hOn** **Method 2**: Settings > Devices & Services > Add Integration > **Haier hOn**
_If the integration is not in the list, you need to clear the browser cache._
If the integration is not in the list, you need to clear the browser cache.
## Contribute ## Contribute
Any kind of contribution is welcome! Any kind of contribution is welcome!
@ -70,6 +71,8 @@ Any kind of contribution is welcome!
## Tested Devices ## Tested Devices
- Haier WD90-B14TEAM5 - Haier WD90-B14TEAM5
- Haier HD80-A3959 - Haier HD80-A3959
- Haier HWO60SM2F3XH
- Hoover H-WASH 500
## About this Repo ## About this Repo
The existing integrations missed some features from the app I liked to have in HomeAssistant. The existing integrations missed some features from the app I liked to have in HomeAssistant.

View File

@ -1,26 +1,12 @@
from pyhon import HonConnection
from pyhon.device import HonDevice
from homeassistant.components.button import ButtonEntityDescription, ButtonEntity from homeassistant.components.button import ButtonEntityDescription, ButtonEntity
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from pyhon import HonConnection
from pyhon.device import HonDevice
from .const import DOMAIN from .const import DOMAIN
from .hon import HonCoordinator, HonEntity from .hon import HonCoordinator, HonEntity
BUTTONS: dict[str, tuple[ButtonEntityDescription, ...]] = { BUTTONS: dict[str, tuple[ButtonEntityDescription, ...]] = {
"WM": (
# ButtonEntityDescription(
# key="pauseProgram",
# name="Pause Program",
# icon="mdi:pause",
# ),
# ButtonEntityDescription(
# key="resumeProgram",
# name="Resume Program",
# icon="mdi:play-pause",
# ),
),
"OV": ( "OV": (
ButtonEntityDescription( ButtonEntityDescription(
key="startProgram", key="startProgram",

View File

@ -7,6 +7,6 @@
"iot_class": "cloud_polling", "iot_class": "cloud_polling",
"issue_tracker": "https://github.com/Andre0512/hon/issues", "issue_tracker": "https://github.com/Andre0512/hon/issues",
"requirements": ["pyhOn==0.4.1"], "requirements": ["pyhOn==0.4.1"],
"version": "0.3.0" "version": "0.4.0"
} }

View File

@ -124,6 +124,8 @@ async def async_setup_entry(hass, entry: ConfigEntry, async_add_entities) -> Non
if descriptions := NUMBERS.get(device.appliance_type): if descriptions := NUMBERS.get(device.appliance_type):
for description in descriptions: for description in descriptions:
if not device.settings.get(description.key):
continue
appliances.extend([ appliances.extend([
HonNumberEntity(hass, coordinator, entry, device, description)] HonNumberEntity(hass, coordinator, entry, device, description)]
) )

View File

@ -92,8 +92,7 @@ async def async_setup_entry(hass, entry: ConfigEntry, async_add_entities) -> Non
if descriptions := SELECTS.get(device.appliance_type): if descriptions := SELECTS.get(device.appliance_type):
for description in descriptions: for description in descriptions:
if not device.get(description.key): if not device.settings.get(description.key):
_LOGGER.warning("[%s] Can't setup %s", device.appliance_type, description.key)
continue continue
appliances.extend([ appliances.extend([
HonSelectEntity(hass, coordinator, entry, device, description)] HonSelectEntity(hass, coordinator, entry, device, description)]

View File

@ -14,6 +14,7 @@ from .hon import HonCoordinator, HonEntity
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@dataclass @dataclass
class HonSwitchEntityDescriptionMixin: class HonSwitchEntityDescriptionMixin:
turn_on_key: str = "" turn_on_key: str = ""
@ -153,5 +154,3 @@ class HonSwitchEntity(HonEntity, SwitchEntity):
self.async_write_ha_state() self.async_write_ha_state()
else: else:
await self._device.commands[self.entity_description.turn_off_key].send() await self._device.commands[self.entity_description.turn_off_key].send()