Compare commits
2 Commits
v0.9.0-bet
...
v0.9.0-bet
Author | SHA1 | Date | |
---|---|---|---|
60ed8b4ec1 | |||
6519bef12a |
24
README.md
24
README.md
@ -38,18 +38,18 @@ _If the integration is not in the list, you need to clear the browser cache._
|
|||||||
## Supported Models
|
## Supported Models
|
||||||
Support has been confirmed for these models, but many more will work. Please add already supported devices [with this form to complete the list](https://forms.gle/bTSD8qFotdZFytbf8).
|
Support has been confirmed for these models, but many more will work. Please add already supported devices [with this form to complete the list](https://forms.gle/bTSD8qFotdZFytbf8).
|
||||||
|
|
||||||
| | **Haier** | **Hoover** | **Candy** |
|
| | **Haier** | **Hoover** | **Candy** |
|
||||||
|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
|
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
|
||||||
| **Washing Machine** | HW90-B14TEAM5 <br/> HW100-B14959U1 | H-WASH 500 <br/> H7W4 48MBC-S | CO4 107T1/2-07 <br/> CBWO49TWME-S <br/> RO44 1286DWMC4-07 <br/> HW 68AMC/1-80 <br/> HWPD 69AMBC/1-S |
|
| **Washing Machine** | HW90-B14TEAM5 <br/> HW100-B14959U1 | H-WASH 500 <br/> H7W4 48MBC-S <br/> HW 410AMBCB/1-80 | CO4 107T1/2-07 <br/> CBWO49TWME-S <br/> RO44 1286DWMC4-07 <br/> HW 68AMC/1-80 <br/> HWPD 69AMBC/1-S |
|
||||||
| **Tumble Dryer** | HD80-A3959 | H-DRY 500 <br/> H9A3TCBEXS-S <br/> HLE C10DCE-80 <br/> NDE H10A2TCE-80 <br/> NDE H9A2TSBEXS-S <br/> NDPHY10A2TCBEXSS | BCTDH7A1TE <br/> CSOE C10DE-80 <br/> ROE H9A3TCEX-S |
|
| **Tumble Dryer** | HD80-A3959 | H-DRY 500 <br/> H9A3TCBEXS-S <br/> HLE C10DCE-80 <br/> NDE H10A2TCE-80 <br/> NDE H9A2TSBEXS-S <br/> NDPHY10A2TCBEXSS | BCTDH7A1TE <br/> CSOE C10DE-80 <br/> ROE H9A3TCEX-S |
|
||||||
| **Washer Dryer** | HWD100-B14979 | HWPS4954DAMR-11 | RPW41066BWMR/1-S |
|
| **Washer Dryer** | HWD100-B14979 | HWPS4954DAMR-11 | RPW41066BWMR/1-S |
|
||||||
| **Oven** | HWO60SM2F3XH | HSOT3161WG | |
|
| **Oven** | HWO60SM2F3XH | HSOT3161WG | |
|
||||||
| **Dish Washer** | XIB 3B2SFS-80 <br/> XIB 6B2D3FB | HFB 6B2S3FX | |
|
| **Dish Washer** | XIB 3B2SFS-80 <br/> XIB 6B2D3FB | HFB 6B2S3FX | |
|
||||||
| **Air Conditioner** | AD105S2SM3FA <br/> AS20HPL1HRA <br/> AS25PBAHRA <br/> AS25S2SF1FA-WH <br/> AS25TADHRA-2 <br/> AS35S2SF2FA-3 <br/> AS35TADHRA-2 <br/> AS35TAMHRA-C | | |
|
| **Air Conditioner** | AD105S2SM3FA <br/> AS20HPL1HRA <br/> AS25PBAHRA <br/> AS25S2SF1FA-WH <br/> AS25TADHRA-2 <br/> AS35S2SF2FA-3 <br/> AS35TADHRA-2 <br/> AS35TAMHRA-C | | |
|
||||||
| **Fridge** | HFW7720ENMB | | CCE4T620EWU |
|
| **Fridge** | HFW7720ENMB | | CCE4T620EWU |
|
||||||
| **Hob** | HA2MTSJ68MC | | CIS633SCTTWIFI |
|
| **Hob** | HA2MTSJ68MC | | CIS633SCTTWIFI |
|
||||||
| **Hood** | HADG6DS46BWIFI | | |
|
| **Hood** | HADG6DS46BWIFI | | |
|
||||||
| **Wine Cellar** | HWS247FDU1 | | |
|
| **Wine Cellar** | HWS247FDU1 | | |
|
||||||
|
|
||||||
| Please add your appliances data to our [hon-test-data collection](https://github.com/Andre0512/hon-test-data). <br/>This helps us to develop new features and not to break compatibility in newer versions. |
|
| Please add your appliances data to our [hon-test-data collection](https://github.com/Andre0512/hon-test-data). <br/>This helps us to develop new features and not to break compatibility in newer versions. |
|
||||||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import pkg_resources
|
|
||||||
from homeassistant.components import persistent_notification
|
from homeassistant.components import persistent_notification
|
||||||
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
|
||||||
@ -92,10 +91,14 @@ class HonDeviceInfo(HonEntity, ButtonEntity):
|
|||||||
self._attr_icon = "mdi:information"
|
self._attr_icon = "mdi:information"
|
||||||
self._attr_name = "Show Device Info"
|
self._attr_name = "Show Device Info"
|
||||||
self._attr_entity_category = EntityCategory.DIAGNOSTIC
|
self._attr_entity_category = EntityCategory.DIAGNOSTIC
|
||||||
|
if "beta" not in self.coordinator.info.hon_version:
|
||||||
|
self._attr_entity_registry_enabled_default = False
|
||||||
|
|
||||||
async def async_press(self) -> None:
|
async def async_press(self) -> None:
|
||||||
pyhon_version = pkg_resources.get_distribution("pyhon").version
|
versions = "versions:\n"
|
||||||
info = f"{self._device.diagnose}pyhOnVersion: {pyhon_version}"
|
versions += f" hon: {self.coordinator.info.hon_version}\n"
|
||||||
|
versions += f" pyhOn: {self.coordinator.info.pyhon_version}\n"
|
||||||
|
info = f"{self._device.diagnose}{versions}"
|
||||||
title = f"{self._device.nick_name} Device Info"
|
title = f"{self._device.nick_name} Device Info"
|
||||||
persistent_notification.create(
|
persistent_notification.create(
|
||||||
self._hass, f"````\n```\n{info}\n```\n````", title
|
self._hass, f"````\n```\n{info}\n```\n````", title
|
||||||
@ -111,6 +114,8 @@ class HonDataArchive(HonEntity, ButtonEntity):
|
|||||||
self._attr_icon = "mdi:archive-arrow-down"
|
self._attr_icon = "mdi:archive-arrow-down"
|
||||||
self._attr_name = "Create Data Archive"
|
self._attr_name = "Create Data Archive"
|
||||||
self._attr_entity_category = EntityCategory.DIAGNOSTIC
|
self._attr_entity_category = EntityCategory.DIAGNOSTIC
|
||||||
|
if "beta" not in self.coordinator.info.hon_version:
|
||||||
|
self._attr_entity_registry_enabled_default = False
|
||||||
|
|
||||||
async def async_press(self) -> None:
|
async def async_press(self) -> None:
|
||||||
path = Path(self._hass.config.config_dir) / "www"
|
path = Path(self._hass.config.config_dir) / "www"
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
|
import json
|
||||||
import logging
|
import logging
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import pkg_resources
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||||
@ -37,9 +40,7 @@ class HonEntity(CoordinatorEntity):
|
|||||||
return DeviceInfo(
|
return DeviceInfo(
|
||||||
identifiers={(DOMAIN, self._device.unique_id)},
|
identifiers={(DOMAIN, self._device.unique_id)},
|
||||||
manufacturer=self._device.get("brand", ""),
|
manufacturer=self._device.get("brand", ""),
|
||||||
name=self._device.nick_name
|
name=self._device.nick_name,
|
||||||
if self._device.nick_name
|
|
||||||
else self._device.model_name,
|
|
||||||
model=self._device.model_name,
|
model=self._device.model_name,
|
||||||
sw_version=self._device.get("fwVersion", ""),
|
sw_version=self._device.get("fwVersion", ""),
|
||||||
)
|
)
|
||||||
@ -50,6 +51,31 @@ class HonEntity(CoordinatorEntity):
|
|||||||
self.async_write_ha_state()
|
self.async_write_ha_state()
|
||||||
|
|
||||||
|
|
||||||
|
class HonInfo:
|
||||||
|
def __init__(self):
|
||||||
|
self._manifest = self._get_manifest()
|
||||||
|
self._hon_version = self._manifest.get("version", "")
|
||||||
|
self._pyhon_version = pkg_resources.get_distribution("pyhon").version
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _get_manifest():
|
||||||
|
manifest = Path(__file__).parent / "manifest.json"
|
||||||
|
with open(manifest, "r", encoding="utf-8") as file:
|
||||||
|
return json.loads(file.read())
|
||||||
|
|
||||||
|
@property
|
||||||
|
def manifest(self):
|
||||||
|
return self._manifest
|
||||||
|
|
||||||
|
@property
|
||||||
|
def hon_version(self):
|
||||||
|
return self._hon_version
|
||||||
|
|
||||||
|
@property
|
||||||
|
def pyhon_version(self):
|
||||||
|
return self._pyhon_version
|
||||||
|
|
||||||
|
|
||||||
class HonCoordinator(DataUpdateCoordinator):
|
class HonCoordinator(DataUpdateCoordinator):
|
||||||
def __init__(self, hass, device: HonAppliance):
|
def __init__(self, hass, device: HonAppliance):
|
||||||
"""Initialize my coordinator."""
|
"""Initialize my coordinator."""
|
||||||
@ -60,10 +86,15 @@ class HonCoordinator(DataUpdateCoordinator):
|
|||||||
update_interval=timedelta(seconds=UPDATE_INTERVAL),
|
update_interval=timedelta(seconds=UPDATE_INTERVAL),
|
||||||
)
|
)
|
||||||
self._device = device
|
self._device = device
|
||||||
|
self._info = HonInfo()
|
||||||
|
|
||||||
async def _async_update_data(self):
|
async def _async_update_data(self):
|
||||||
await self._device.update()
|
await self._device.update()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def info(self) -> HonInfo:
|
||||||
|
return self._info
|
||||||
|
|
||||||
|
|
||||||
def unique_entities(base_entities, new_entities):
|
def unique_entities(base_entities, new_entities):
|
||||||
result = list(base_entities)
|
result = list(base_entities)
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
"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": [
|
"requirements": [
|
||||||
"pyhOn==0.14.1"
|
"pyhOn==0.14.6"
|
||||||
],
|
],
|
||||||
"version": "0.9.0-beta.5"
|
"version": "0.9.0-beta.7"
|
||||||
}
|
}
|
||||||
|
24
info.md
24
info.md
@ -27,18 +27,18 @@ _If the integration is not in the list, you need to clear the browser cache._
|
|||||||
## Supported Models
|
## Supported Models
|
||||||
Support has been confirmed for these models, but many more will work. Please add already supported devices [with this form to complete the list](https://forms.gle/bTSD8qFotdZFytbf8).
|
Support has been confirmed for these models, but many more will work. Please add already supported devices [with this form to complete the list](https://forms.gle/bTSD8qFotdZFytbf8).
|
||||||
|
|
||||||
| | **Haier** | **Hoover** | **Candy** |
|
| | **Haier** | **Hoover** | **Candy** |
|
||||||
|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
|
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
|
||||||
| **Washing Machine** | HW90-B14TEAM5 <br/> HW100-B14959U1 | H-WASH 500 <br/> H7W4 48MBC-S | CO4 107T1/2-07 <br/> CBWO49TWME-S <br/> RO44 1286DWMC4-07 <br/> HW 68AMC/1-80 <br/> HWPD 69AMBC/1-S |
|
| **Washing Machine** | HW90-B14TEAM5 <br/> HW100-B14959U1 <br/> HW 410AMBCB/1-80 | H-WASH 500 <br/> H7W4 48MBC-S <br/> | CO4 107T1/2-07 <br/> CBWO49TWME-S <br/> RO44 1286DWMC4-07 <br/> HW 68AMC/1-80 <br/> HWPD 69AMBC/1-S |
|
||||||
| **Tumble Dryer** | HD80-A3959 | H-DRY 500 <br/> H9A3TCBEXS-S <br/> HLE C10DCE-80 <br/> NDE H10A2TCE-80 <br/> NDE H9A2TSBEXS-S <br/> NDPHY10A2TCBEXSS | BCTDH7A1TE <br/> CSOE C10DE-80 <br/> ROE H9A3TCEX-S |
|
| **Tumble Dryer** | HD80-A3959 | H-DRY 500 <br/> H9A3TCBEXS-S <br/> HLE C10DCE-80 <br/> NDE H10A2TCE-80 <br/> NDE H9A2TSBEXS-S <br/> NDPHY10A2TCBEXSS | BCTDH7A1TE <br/> CSOE C10DE-80 <br/> ROE H9A3TCEX-S |
|
||||||
| **Washer Dryer** | HWD100-B14979 | HWPS4954DAMR-11 | RPW41066BWMR/1-S |
|
| **Washer Dryer** | HWD100-B14979 | HWPS4954DAMR-11 | RPW41066BWMR/1-S |
|
||||||
| **Oven** | HWO60SM2F3XH | HSOT3161WG | |
|
| **Oven** | HWO60SM2F3XH | HSOT3161WG | |
|
||||||
| **Dish Washer** | XIB 3B2SFS-80 <br/> XIB 6B2D3FB | HFB 6B2S3FX | |
|
| **Dish Washer** | XIB 3B2SFS-80 <br/> XIB 6B2D3FB | HFB 6B2S3FX | |
|
||||||
| **Air Conditioner** | AD105S2SM3FA <br/> AS20HPL1HRA <br/> AS25PBAHRA <br/> AS25S2SF1FA-WH <br/> AS25TADHRA-2 <br/> AS35S2SF2FA-3 <br/> AS35TADHRA-2 <br/> AS35TAMHRA-C | | |
|
| **Air Conditioner** | AD105S2SM3FA <br/> AS20HPL1HRA <br/> AS25PBAHRA <br/> AS25S2SF1FA-WH <br/> AS25TADHRA-2 <br/> AS35S2SF2FA-3 <br/> AS35TADHRA-2 <br/> AS35TAMHRA-C | | |
|
||||||
| **Fridge** | HFW7720ENMB | | CCE4T620EWU |
|
| **Fridge** | HFW7720ENMB | | CCE4T620EWU |
|
||||||
| **Hob** | HA2MTSJ68MC | | CIS633SCTTWIFI |
|
| **Hob** | HA2MTSJ68MC | | CIS633SCTTWIFI |
|
||||||
| **Hood** | HADG6DS46BWIFI | | |
|
| **Hood** | HADG6DS46BWIFI | | |
|
||||||
| **Wine Cellar** | HWS247FDU1 | | |
|
| **Wine Cellar** | HWS247FDU1 | | |
|
||||||
|
|
||||||
| Please add your appliances data to our [hon-test-data collection](https://github.com/Andre0512/hon-test-data). <br/>This helps us to develop new features and not to break compatibility in newer versions. |
|
| Please add your appliances data to our [hon-test-data collection](https://github.com/Andre0512/hon-test-data). <br/>This helps us to develop new features and not to break compatibility in newer versions. |
|
||||||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
Reference in New Issue
Block a user