Bump to v0.4.0
This commit is contained in:
		
							
								
								
									
										23
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								README.md
									
									
									
									
									
								
							| @ -1,26 +1,27 @@ | |||||||
| # Haier hOn | # Haier hOn | ||||||
| [](https://github.com/hacs/integration) | [](https://github.com/hacs/integration) | ||||||
|  | [](https://github.com/Andre0512/hon/releases/latest) | ||||||
|  | [](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 | ||||||
| [](https://my.home-assistant.io/redirect/hacs_repository/?owner=Andre0512&repository=hon&category=integration) | **Method 1:** [](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 | ||||||
|  |  | ||||||
| [](https://my.home-assistant.io/redirect/config_flow_start/?domain=hon) | **Method 1**: [](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. | ||||||
|  | |||||||
| @ -1,27 +1,13 @@ | |||||||
| 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": ( |     "OV": ( | ||||||
|         # ButtonEntityDescription( |  | ||||||
|         #     key="pauseProgram", |  | ||||||
|         #     name="Pause Program", |  | ||||||
|         #     icon="mdi:pause", |  | ||||||
|         # ), |  | ||||||
|         # ButtonEntityDescription( |  | ||||||
|         #     key="resumeProgram", |  | ||||||
|         #     name="Resume Program", |  | ||||||
|         #     icon="mdi:play-pause", |  | ||||||
|         # ), |  | ||||||
|     ), |  | ||||||
|  |  | ||||||
|     "OV":( |  | ||||||
|         ButtonEntityDescription( |         ButtonEntityDescription( | ||||||
|             key="startProgram", |             key="startProgram", | ||||||
|             name="Start Program", |             name="Start Program", | ||||||
|  | |||||||
| @ -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" | ||||||
| } | } | ||||||
|  |  | ||||||
|  | |||||||
| @ -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)] | ||||||
|                 ) |                 ) | ||||||
|  | |||||||
| @ -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)] | ||||||
|  | |||||||
| @ -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 = "" | ||||||
| @ -22,8 +23,8 @@ class HonSwitchEntityDescriptionMixin: | |||||||
|  |  | ||||||
| @dataclass | @dataclass | ||||||
| class HonSwitchEntityDescription(HonSwitchEntityDescriptionMixin, | class HonSwitchEntityDescription(HonSwitchEntityDescriptionMixin, | ||||||
|     SwitchEntityDescription |                                  SwitchEntityDescription | ||||||
| ): |                                  ): | ||||||
|     pass |     pass | ||||||
|  |  | ||||||
|  |  | ||||||
| @ -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() | ||||||
|  |  | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user