Compare commits
	
		
			5 Commits
		
	
	
		
			v0.6.0-bet
			...
			v0.6.0-bet
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 75622e18a2 | |||
| a2d0257410 | |||
| e2c7ca36db | |||
| b33b6a40b2 | |||
| 75859543aa | 
							
								
								
									
										32
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										32
									
								
								README.md
									
									
									
									
									
								
							| @ -1,8 +1,8 @@ | |||||||
| # Haier hOn | # Haier hOn | ||||||
| [](https://hacs.xyz) | [](https://hacs.xyz) | ||||||
| [](https://github.com/Andre0512/hon/releases/latest) | [](https://github.com/Andre0512/hon/releases/latest) | ||||||
|  | [](https://github.com/Andre0512/hon/blob/main/LICENSE) | ||||||
| [](https://analytics.home-assistant.io/)   | [](https://tooomm.github.io/github-release-stats/?username=Andre0512&repository=hon)   | ||||||
| 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 | ||||||
| @ -105,11 +105,12 @@ I tried to create a pull request, but in the structures of these existing repos, | |||||||
| I moved the api related stuff into the package [pyhOn](https://github.com/Andre0512/pyhOn). | I moved the api related stuff into the package [pyhOn](https://github.com/Andre0512/pyhOn). | ||||||
|  |  | ||||||
| ## Appliance Features | ## Appliance Features | ||||||
|  |  | ||||||
| ### Dish washer | ### Dish washer | ||||||
| #### Controls | #### Controls | ||||||
| | Name | Icon | Entity | Key | | | Name | Icon | Entity | Key | | ||||||
| | --- | --- | --- | --- | | | --- | --- | --- | --- | | ||||||
| | Dish Washer | `mdi:dishwasher` | `switch` | `active` | | | Dish Washer | `mdi:dishwasher` | `switch` | `startProgram` / `stopProgram` | | ||||||
| #### Configs | #### Configs | ||||||
| | Name | Icon | Entity | Key | | | Name | Icon | Entity | Key | | ||||||
| | --- | --- | --- | --- | | | --- | --- | --- | --- | | ||||||
| @ -138,6 +139,7 @@ I moved the api related stuff into the package [pyhOn](https://github.com/Andre0 | |||||||
| | Remaining Time | `mdi:timer` | `sensor` | `remainingTimeMM` | | | Remaining Time | `mdi:timer` | `sensor` | `remainingTimeMM` | | ||||||
| | Rinse Aid | `mdi:spray-bottle` | `binary_sensor` | `rinseAidStatus` | | | Rinse Aid | `mdi:spray-bottle` | `binary_sensor` | `rinseAidStatus` | | ||||||
| | Salt | `mdi:shaker-outline` | `binary_sensor` | `saltStatus` | | | Salt | `mdi:shaker-outline` | `binary_sensor` | `saltStatus` | | ||||||
|  |  | ||||||
| ### Hob | ### Hob | ||||||
| #### Controls | #### Controls | ||||||
| | Name | Icon | Entity | Key | | | Name | Icon | Entity | Key | | ||||||
| @ -157,9 +159,12 @@ I moved the api related stuff into the package [pyhOn](https://github.com/Andre0 | |||||||
| | Hob Lock |  | `binary_sensor` | `hobLockStatus` | | | Hob Lock |  | `binary_sensor` | `hobLockStatus` | | ||||||
| | Hot Status |  | `binary_sensor` | `hotStatus` | | | Hot Status |  | `binary_sensor` | `hotStatus` | | ||||||
| | On | `mdi:power-cycle` | `binary_sensor` | `attributes.parameters.onOffStatus` | | | On | `mdi:power-cycle` | `binary_sensor` | `attributes.parameters.onOffStatus` | | ||||||
|  | | Pan Status | `mdi:pot-mix` | `binary_sensor` | `panStatus` | | ||||||
|  | | Power | `mdi:lightning-bolt` | `sensor` | `power` | | ||||||
| | Remaining Time | `mdi:timer` | `sensor` | `remainingTimeMM` | | | Remaining Time | `mdi:timer` | `sensor` | `remainingTimeMM` | | ||||||
| | Remote Control | `mdi:remote` | `binary_sensor` | `attributes.parameters.remoteCtrValid` | | | Remote Control | `mdi:remote` | `binary_sensor` | `attributes.parameters.remoteCtrValid` | | ||||||
| | Temperature | `mdi:thermometer` | `sensor` | `temp` | | | Temperature | `mdi:thermometer` | `sensor` | `temp` | | ||||||
|  |  | ||||||
| ### Oven | ### Oven | ||||||
| #### Controls | #### Controls | ||||||
| | Name | Icon | Entity | Key | | | Name | Icon | Entity | Key | | ||||||
| @ -184,12 +189,13 @@ I moved the api related stuff into the package [pyhOn](https://github.com/Andre0 | |||||||
| | Start Time | `mdi:clock-start` | `sensor` | `delayTime` | | | Start Time | `mdi:clock-start` | `sensor` | `delayTime` | | ||||||
| | Temperature | `mdi:thermometer` | `sensor` | `temp` | | | Temperature | `mdi:thermometer` | `sensor` | `temp` | | ||||||
| | Temperature Selected | `mdi:thermometer` | `sensor` | `tempSel` | | | Temperature Selected | `mdi:thermometer` | `sensor` | `tempSel` | | ||||||
|  |  | ||||||
| ### Tumble dryer | ### Tumble dryer | ||||||
| #### Controls | #### Controls | ||||||
| | Name | Icon | Entity | Key | | | Name | Icon | Entity | Key | | ||||||
| | --- | --- | --- | --- | | | --- | --- | --- | --- | | ||||||
| | Pause Tumble Dryer | `mdi:pause` | `switch` | `pause` | | | Pause Tumble Dryer | `mdi:pause` | `switch` | `pauseProgram` / `resumeProgram` | | ||||||
| | Tumble Dryer | `mdi:tumble-dryer` | `switch` | `active` | | | Tumble Dryer | `mdi:tumble-dryer` | `switch` | `startProgram` / `stopProgram` | | ||||||
| #### Configs | #### Configs | ||||||
| | Name | Icon | Entity | Key | | | Name | Icon | Entity | Key | | ||||||
| | --- | --- | --- | --- | | | --- | --- | --- | --- | | ||||||
| @ -213,24 +219,28 @@ I moved the api related stuff into the package [pyhOn](https://github.com/Andre0 | |||||||
| | Remaining Time | `mdi:timer` | `sensor` | `remainingTimeMM` | | | Remaining Time | `mdi:timer` | `sensor` | `remainingTimeMM` | | ||||||
| | Start Time | `mdi:clock-start` | `sensor` | `delayTime` | | | Start Time | `mdi:clock-start` | `sensor` | `delayTime` | | ||||||
| | Temperature level | `mdi:thermometer` | `sensor` | `tempLevel` | | | Temperature level | `mdi:thermometer` | `sensor` | `tempLevel` | | ||||||
|  |  | ||||||
| ### Washer dryer | ### Washer dryer | ||||||
| #### Controls | #### Controls | ||||||
| | Name | Icon | Entity | Key | | | Name | Icon | Entity | Key | | ||||||
| | --- | --- | --- | --- | | | --- | --- | --- | --- | | ||||||
| | Pause Washing Machine | `mdi:pause` | `switch` | `pause` | | | Pause Washing Machine | `mdi:pause` | `switch` | `pauseProgram` / `resumeProgram` | | ||||||
| | Washing Machine | `mdi:washing-machine` | `switch` | `active` | | | Washing Machine | `mdi:washing-machine` | `switch` | `startProgram` / `stopProgram` | | ||||||
| #### Configs | #### Configs | ||||||
| | Name | Icon | Entity | Key | | | Name | Icon | Entity | Key | | ||||||
| | --- | --- | --- | --- | | | --- | --- | --- | --- | | ||||||
| | Delay Time | `mdi:timer-plus` | `number` | `startProgram.delayTime` | | | Delay Time | `mdi:timer-plus` | `number` | `startProgram.delayTime` | | ||||||
| | Program |  | `select` | `startProgram.program` | | | Program |  | `select` | `startProgram.program` | | ||||||
|  | | Suggested weight | `mdi:weight-kilogram` | `sensor` | `startProgram.weight` | | ||||||
| #### Sensors | #### Sensors | ||||||
| | Name | Icon | Entity | Key | | | Name | Icon | Entity | Key | | ||||||
| | --- | --- | --- | --- | | | --- | --- | --- | --- | | ||||||
| | Acqua Plus |  | `binary_sensor` | `acquaplus` | | | Acqua Plus |  | `binary_sensor` | `acquaplus` | | ||||||
| | Anti-Crease |  | `binary_sensor` | `anticrease` | | | Anti-Crease |  | `binary_sensor` | `anticrease` | | ||||||
|  | | Current Electricity Used | `mdi:lightning-bolt` | `sensor` | `currentElectricityUsed` | | ||||||
| | Current Program | `mdi:tumble-dryer` | `sensor` | `prCode` | | | Current Program | `mdi:tumble-dryer` | `sensor` | `prCode` | | ||||||
| | Current Temperature | `mdi:thermometer` | `sensor` | `temp` | | | Current Temperature | `mdi:thermometer` | `sensor` | `temp` | | ||||||
|  | | Current Water Used | `mdi:water` | `sensor` | `currentWaterUsed` | | ||||||
| | Dirt level | `mdi:liquid-spot` | `sensor` | `dirtyLevel` | | | Dirt level | `mdi:liquid-spot` | `sensor` | `dirtyLevel` | | ||||||
| | Dry level | `mdi:hair-dryer` | `sensor` | `dryLevel` | | | Dry level | `mdi:hair-dryer` | `sensor` | `dryLevel` | | ||||||
| | Extra Rinse 1 |  | `binary_sensor` | `extraRinse1` | | | Extra Rinse 1 |  | `binary_sensor` | `extraRinse1` | | ||||||
| @ -244,12 +254,16 @@ I moved the api related stuff into the package [pyhOn](https://github.com/Andre0 | |||||||
| | Remote Control | `mdi:remote` | `binary_sensor` | `attributes.lastConnEvent.category` | | | Remote Control | `mdi:remote` | `binary_sensor` | `attributes.lastConnEvent.category` | | ||||||
| | Spin Speed | `mdi:fast-forward-outline` | `sensor` | `spinSpeed` | | | Spin Speed | `mdi:fast-forward-outline` | `sensor` | `spinSpeed` | | ||||||
| | Steam level | `mdi:smoke` | `sensor` | `steamLevel` | | | Steam level | `mdi:smoke` | `sensor` | `steamLevel` | | ||||||
|  | | Total Power |  | `sensor` | `totalElectricityUsed` | | ||||||
|  | | Total Wash Cycle | `mdi:counter` | `sensor` | `totalWashCycle` | | ||||||
|  | | Total Water |  | `sensor` | `totalWaterUsed` | | ||||||
|  |  | ||||||
| ### Washing machine | ### Washing machine | ||||||
| #### Controls | #### Controls | ||||||
| | Name | Icon | Entity | Key | | | Name | Icon | Entity | Key | | ||||||
| | --- | --- | --- | --- | | | --- | --- | --- | --- | | ||||||
| | Pause Washing Machine | `mdi:pause` | `switch` | `pause` | | | Pause Washing Machine | `mdi:pause` | `switch` | `pauseProgram` / `resumeProgram` | | ||||||
| | Washing Machine | `mdi:washing-machine` | `switch` | `active` | | | Washing Machine | `mdi:washing-machine` | `switch` | `startProgram` / `stopProgram` | | ||||||
| #### Configs | #### Configs | ||||||
| | Name | Icon | Entity | Key | | | Name | Icon | Entity | Key | | ||||||
| | --- | --- | --- | --- | | | --- | --- | --- | --- | | ||||||
|  | |||||||
| @ -152,6 +152,9 @@ BINARY_SENSORS: dict[str, tuple[HonBinarySensorEntityDescription, ...]] = { | |||||||
|             device_class=BinarySensorDeviceClass.HEAT, |             device_class=BinarySensorDeviceClass.HEAT, | ||||||
|             on_value="1", |             on_value="1", | ||||||
|         ), |         ), | ||||||
|  |         HonBinarySensorEntityDescription( | ||||||
|  |             key="panStatus", name="Pan Status", on_value="1", icon="mdi:pot-mix" | ||||||
|  |         ), | ||||||
|         HonBinarySensorEntityDescription( |         HonBinarySensorEntityDescription( | ||||||
|             key="hobLockStatus", |             key="hobLockStatus", | ||||||
|             name="Hob Lock", |             name="Hob Lock", | ||||||
|  | |||||||
| @ -7,5 +7,5 @@ | |||||||
|   "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.8.0b7"], |   "requirements": ["pyhOn==0.8.0b7"], | ||||||
|   "version": "0.6.0-beta.7" |   "version": "0.6.0-beta.8" | ||||||
| } | } | ||||||
|  | |||||||
| @ -55,7 +55,7 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = { | |||||||
|             name="Current Electricity Used", |             name="Current Electricity Used", | ||||||
|             state_class=SensorStateClass.MEASUREMENT, |             state_class=SensorStateClass.MEASUREMENT, | ||||||
|             device_class=SensorDeviceClass.POWER, |             device_class=SensorDeviceClass.POWER, | ||||||
|             native_unit_of_measurement=UnitOfPower.KILO_WATT, |             native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, | ||||||
|             icon="mdi:lightning-bolt", |             icon="mdi:lightning-bolt", | ||||||
|         ), |         ), | ||||||
|         SensorEntityDescription( |         SensorEntityDescription( | ||||||
| @ -146,6 +146,48 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = { | |||||||
|         ), |         ), | ||||||
|     ), |     ), | ||||||
|     "WD": ( |     "WD": ( | ||||||
|  |         SensorEntityDescription( | ||||||
|  |             key="totalElectricityUsed", | ||||||
|  |             name="Total Power", | ||||||
|  |             device_class=SensorDeviceClass.ENERGY, | ||||||
|  |             state_class=SensorStateClass.TOTAL_INCREASING, | ||||||
|  |             native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, | ||||||
|  |         ), | ||||||
|  |         SensorEntityDescription( | ||||||
|  |             key="totalWaterUsed", | ||||||
|  |             name="Total Water", | ||||||
|  |             device_class=SensorDeviceClass.WATER, | ||||||
|  |             state_class=SensorStateClass.TOTAL_INCREASING, | ||||||
|  |             native_unit_of_measurement=UnitOfVolume.LITERS, | ||||||
|  |         ), | ||||||
|  |         SensorEntityDescription( | ||||||
|  |             key="totalWashCycle", | ||||||
|  |             name="Total Wash Cycle", | ||||||
|  |             state_class=SensorStateClass.TOTAL_INCREASING, | ||||||
|  |             icon="mdi:counter", | ||||||
|  |         ), | ||||||
|  |         SensorEntityDescription( | ||||||
|  |             key="currentElectricityUsed", | ||||||
|  |             name="Current Electricity Used", | ||||||
|  |             state_class=SensorStateClass.MEASUREMENT, | ||||||
|  |             device_class=SensorDeviceClass.POWER, | ||||||
|  |             native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, | ||||||
|  |             icon="mdi:lightning-bolt", | ||||||
|  |         ), | ||||||
|  |         SensorEntityDescription( | ||||||
|  |             key="currentWaterUsed", | ||||||
|  |             name="Current Water Used", | ||||||
|  |             state_class=SensorStateClass.MEASUREMENT, | ||||||
|  |             icon="mdi:water", | ||||||
|  |         ), | ||||||
|  |         SensorEntityDescription( | ||||||
|  |             key="startProgram.weight", | ||||||
|  |             name="Suggested weight", | ||||||
|  |             state_class=SensorStateClass.MEASUREMENT, | ||||||
|  |             entity_category=EntityCategory.CONFIG, | ||||||
|  |             native_unit_of_measurement=UnitOfMass.KILOGRAMS, | ||||||
|  |             icon="mdi:weight-kilogram", | ||||||
|  |         ), | ||||||
|         SensorEntityDescription( |         SensorEntityDescription( | ||||||
|             key="machMode", |             key="machMode", | ||||||
|             name="Machine Status", |             name="Machine Status", | ||||||
| @ -237,6 +279,12 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = { | |||||||
|             native_unit_of_measurement=UnitOfTemperature.CELSIUS, |             native_unit_of_measurement=UnitOfTemperature.CELSIUS, | ||||||
|         ), |         ), | ||||||
|         SensorEntityDescription(key="errors", name="Error", icon="mdi:math-log"), |         SensorEntityDescription(key="errors", name="Error", icon="mdi:math-log"), | ||||||
|  |         SensorEntityDescription( | ||||||
|  |             key="power", | ||||||
|  |             name="Power", | ||||||
|  |             icon="mdi:lightning-bolt", | ||||||
|  |             state_class=SensorStateClass.MEASUREMENT, | ||||||
|  |         ), | ||||||
|     ), |     ), | ||||||
|     "DW": ( |     "DW": ( | ||||||
|         SensorEntityDescription( |         SensorEntityDescription( | ||||||
|  | |||||||
							
								
								
									
										4
									
								
								info.md
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								info.md
									
									
									
									
									
								
							| @ -1,7 +1,7 @@ | |||||||
| # Haier hOn | # Haier hOn | ||||||
| [](https://github.com/Andre0512/hon/releases/latest) | [](https://github.com/Andre0512/hon/releases/latest) | ||||||
|  | [](https://github.com/Andre0512/hon/blob/main/LICENSE) | ||||||
| [](https://analytics.home-assistant.io/)   | [](https://tooomm.github.io/github-release-stats/?username=Andre0512&repository=hon)   | ||||||
| Support for home appliances of Haier's mobile app hOn.  | Support for home appliances of Haier's mobile app hOn.  | ||||||
|  |  | ||||||
| ## Supported Appliances | ## Supported Appliances | ||||||
|  | |||||||
							
								
								
									
										37
									
								
								scripts/sensor_docs.py
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										37
									
								
								scripts/sensor_docs.py
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							| @ -1,9 +1,12 @@ | |||||||
|  | import re | ||||||
|  | from pathlib import Path | ||||||
|  |  | ||||||
| from custom_components.hon.binary_sensor import BINARY_SENSORS | from custom_components.hon.binary_sensor import BINARY_SENSORS | ||||||
| from custom_components.hon.button import BUTTONS | from custom_components.hon.button import BUTTONS | ||||||
| from custom_components.hon.number import NUMBERS | from custom_components.hon.number import NUMBERS | ||||||
| from custom_components.hon.select import SELECTS | from custom_components.hon.select import SELECTS | ||||||
| from custom_components.hon.sensor import SENSORS | from custom_components.hon.sensor import SENSORS | ||||||
| from custom_components.hon.switch import SWITCHES | from custom_components.hon.switch import SWITCHES, HonSwitchEntityDescription | ||||||
|  |  | ||||||
| APPLIANCES = { | APPLIANCES = { | ||||||
|     "AC": "Air conditioner", |     "AC": "Air conditioner", | ||||||
| @ -38,19 +41,37 @@ result = {} | |||||||
| for entity_type, appliances in entities.items(): | for entity_type, appliances in entities.items(): | ||||||
|     for appliance, data in appliances.items(): |     for appliance, data in appliances.items(): | ||||||
|         for entity in data: |         for entity in data: | ||||||
|             attributes = (entity.key, entity.name, entity.icon, entity_type) |             if ( | ||||||
|  |                 isinstance(entity, HonSwitchEntityDescription) | ||||||
|  |                 and entity.entity_category != "config" | ||||||
|  |             ): | ||||||
|  |                 key = f"{entity.turn_on_key}` / `{entity.turn_off_key}" | ||||||
|  |             else: | ||||||
|  |                 key = entity.key | ||||||
|  |             attributes = (key, entity.name, entity.icon, entity_type) | ||||||
|             category = "control" if entity_type in ["switch", "button"] else "sensor" |             category = "control" if entity_type in ["switch", "button"] else "sensor" | ||||||
|             result.setdefault(appliance, {}).setdefault( |             result.setdefault(appliance, {}).setdefault( | ||||||
|                 entity.entity_category or category, [] |                 entity.entity_category or category, [] | ||||||
|             ).append(attributes) |             ).append(attributes) | ||||||
|  | text = "" | ||||||
| for appliance, categories in sorted(result.items()): | for appliance, categories in sorted(result.items()): | ||||||
|     print(f"### {APPLIANCES[appliance]}") |     text += f"\n### {APPLIANCES[appliance]}\n" | ||||||
|     categories = {k: categories[k] for k in ENTITY_CATEGORY_SORT if k in categories} |     categories = {k: categories[k] for k in ENTITY_CATEGORY_SORT if k in categories} | ||||||
|     for category, data in categories.items(): |     for category, data in categories.items(): | ||||||
|         print(f"#### {str(category).capitalize()}s") |         text += f"#### {str(category).capitalize()}s\n" | ||||||
|         print("| Name | Icon | Entity | Key |") |         text += "| Name | Icon | Entity | Key |\n" | ||||||
|         print("| --- | --- | --- | --- |") |         text += "| --- | --- | --- | --- |\n" | ||||||
|         for key, name, icon, entity_type in sorted(data, key=lambda d: d[1]): |         for key, name, icon, entity_type in sorted(data, key=lambda d: d[1]): | ||||||
|             icon = f"`{icon}`" if icon else "" |             icon = f"`{icon}`" if icon else "" | ||||||
|             print(f"| {name} | {icon} | `{entity_type}` | `{key}` |") |             text += f"| {name} | {icon} | `{entity_type}` | `{key}` |\n" | ||||||
|  |  | ||||||
|  | with open(Path(__file__).parent.parent / "README.md", "r") as file: | ||||||
|  |     readme = file.read() | ||||||
|  | readme = re.sub( | ||||||
|  |     "(## Appliance Features\n)(?:.|\\s)+?([^#]## |\\Z)", | ||||||
|  |     f"\\1{text}\\2", | ||||||
|  |     readme, | ||||||
|  |     re.DOTALL, | ||||||
|  | ) | ||||||
|  | with open(Path(__file__).parent.parent / "README.md", "w") as file: | ||||||
|  |     file.write(readme) | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	