Bump to v0.4.0
This commit is contained in:
		
							
								
								
									
										23
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								README.md
									
									
									
									
									
								
							| @ -1,26 +1,27 @@ | ||||
| # Haier hOn | ||||
| [](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. | ||||
| ## Supported Appliances | ||||
| - Washing Machine | ||||
| - Tumble Dryer | ||||
|  | ||||
| - Washer Dryer | ||||
| - Washing Machine | ||||
| - Oven | ||||
|  | ||||
| ## 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 | ||||
|  | ||||
| [](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** | ||||
|  | ||||
| If the integration is not in the list, you need to clear the browser cache. | ||||
| **Method 2**: Settings > Devices & Services > Add Integration > **Haier hOn**   | ||||
| _If the integration is not in the list, you need to clear the browser cache._ | ||||
|  | ||||
| ## Contribute | ||||
| Any kind of contribution is welcome! | ||||
| @ -70,6 +71,8 @@ Any kind of contribution is welcome! | ||||
| ## Tested Devices | ||||
| - Haier WD90-B14TEAM5 | ||||
| - Haier HD80-A3959 | ||||
| - Haier HWO60SM2F3XH | ||||
| - Hoover H-WASH 500 | ||||
|  | ||||
| ## About this Repo | ||||
| 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.config_entries import ConfigEntry | ||||
| from pyhon import HonConnection | ||||
| from pyhon.device import HonDevice | ||||
|  | ||||
| from .const import DOMAIN | ||||
| from .hon import HonCoordinator, HonEntity | ||||
|  | ||||
| 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( | ||||
|             key="startProgram", | ||||
|             name="Start Program", | ||||
|  | ||||
| @ -7,6 +7,6 @@ | ||||
|   "iot_class": "cloud_polling", | ||||
|   "issue_tracker": "https://github.com/Andre0512/hon/issues", | ||||
|   "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): | ||||
|             for description in descriptions: | ||||
|                 if not device.settings.get(description.key): | ||||
|                     continue | ||||
|                 appliances.extend([ | ||||
|                     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): | ||||
|             for description in descriptions: | ||||
|                 if not device.get(description.key): | ||||
|                     _LOGGER.warning("[%s] Can't setup %s", device.appliance_type, description.key) | ||||
|                 if not device.settings.get(description.key): | ||||
|                     continue | ||||
|                 appliances.extend([ | ||||
|                     HonSelectEntity(hass, coordinator, entry, device, description)] | ||||
|  | ||||
| @ -14,6 +14,7 @@ from .hon import HonCoordinator, HonEntity | ||||
|  | ||||
| _LOGGER = logging.getLogger(__name__) | ||||
|  | ||||
|  | ||||
| @dataclass | ||||
| class HonSwitchEntityDescriptionMixin: | ||||
|     turn_on_key: str = "" | ||||
| @ -22,8 +23,8 @@ class HonSwitchEntityDescriptionMixin: | ||||
|  | ||||
| @dataclass | ||||
| class HonSwitchEntityDescription(HonSwitchEntityDescriptionMixin, | ||||
|     SwitchEntityDescription | ||||
| ): | ||||
|                                  SwitchEntityDescription | ||||
|                                  ): | ||||
|     pass | ||||
|  | ||||
|  | ||||
| @ -153,5 +154,3 @@ class HonSwitchEntity(HonEntity, SwitchEntity): | ||||
|             self.async_write_ha_state() | ||||
|         else: | ||||
|             await self._device.commands[self.entity_description.turn_off_key].send() | ||||
|  | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user