Skip to content

Commit

Permalink
Add Stain Type #105
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre0512 committed Oct 2, 2023
1 parent 020ab4b commit 5e17081
Show file tree
Hide file tree
Showing 26 changed files with 920 additions and 3 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Home Assistant integration for [Haier's mobile app hOn](https://hon-smarthome.co
[![Supported Languages](https://img.shields.io/badge/Languages-19-royalblue)](https://github.com/Andre0512/hon#supported-languages)
[![Supported Appliances](https://img.shields.io/badge/Appliances-11-forestgreen)](https://github.com/Andre0512/hon#supported-appliances)
[![Supported Models](https://img.shields.io/badge/Models-72-yellowgreen)](https://github.com/Andre0512/hon#supported-models)
[![Supported Entities](https://img.shields.io/badge/Entities-241-crimson)](https://github.com/Andre0512/hon#appliance-features)
[![Supported Entities](https://img.shields.io/badge/Entities-313-crimson)](https://github.com/Andre0512/hon#appliance-features)

## Supported Appliances
- [Washing Machine](https://github.com/Andre0512/hon#washing-machine)
Expand Down Expand Up @@ -471,6 +471,7 @@ For every device exists a button under diagnostics which can be used to log all
| Rinse Iterations | `rotate-right` | `number` | `startProgram.rinseIterations` |
| Soak Prewash Selection | `tshirt-crew` | `switch` | `startProgram.haier_SoakPrewashSelection` |
| Spin speed | `numeric` | `select` | `startProgram.spinSpeed` |
| Stain Type | `liquid-spot` | `select` | `startProgram.extendedStainType` |
| Steam Type | `weather-dust` | `sensor` | `steamType` |
| Steam level | `weather-dust` | `select` | `startProgram.steamLevel` |
| Sterilization | `lotion-plus` | `switch` | `startProgram.sterilizationStatus` |
Expand Down Expand Up @@ -506,6 +507,7 @@ For every device exists a button under diagnostics which can be used to log all
| Remaining Time | `timer` | `sensor` | `remainingTimeMM` |
| Remote Control | `remote` | `binary_sensor` | `attributes.lastConnEvent.category` |
| Spin Speed | `speedometer` | `sensor` | `spinSpeed` |
| Stain Type | `liquid-spot` | `sensor` | `stainType` |
| Start Time | `clock-start` | `sensor` | `delayTime` |
| Steam level | `weather-dust` | `sensor` | `steamLevel` |
| Temperature level | `thermometer` | `sensor` | `tempLevel` |
Expand Down Expand Up @@ -548,6 +550,7 @@ For every device exists a button under diagnostics which can be used to log all
| Rinse Iterations | `rotate-right` | `number` | `startProgram.rinseIterations` |
| Soak Prewash Selection | `tshirt-crew` | `switch` | `startProgram.haier_SoakPrewashSelection` |
| Spin speed | `numeric` | `select` | `startProgram.spinSpeed` |
| Stain Type | `liquid-spot` | `select` | `startProgram.extendedStainType` |
| Steam level | `weather-dust` | `select` | `startProgram.steamLevel` |
| Suggested Load | `weight-kilogram` | `sensor` | `startProgram.suggestedLoadW` |
| Suggested weight | `weight-kilogram` | `sensor` | `startProgram.weight` |
Expand Down Expand Up @@ -576,6 +579,7 @@ For every device exists a button under diagnostics which can be used to log all
| Remaining Time | `timer` | `sensor` | `remainingTimeMM` |
| Remote Control | `remote` | `binary_sensor` | `attributes.lastConnEvent.category` |
| Spin Speed | `speedometer` | `sensor` | `spinSpeed` |
| Stain Type | `liquid-spot` | `sensor` | `stainType` |
| Steam level | `weather-dust` | `sensor` | `steamLevel` |
| Total Power | | `sensor` | `totalElectricityUsed` |
| Total Wash Cycle | `counter` | `sensor` | `totalWashCycle` |
Expand Down
38 changes: 38 additions & 0 deletions custom_components/hon/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,41 @@
}

REF_HUMIDITY_LEVELS: dict[int, str] = {1: "low", 2: "mid", 3: "high"}

STAIN_TYPES: dict[int, str] = {
0: "unknown",
1: "wine",
2: "grass",
3: "soil",
4: "blood",
5: "milk",
# 6: "butter",
6: "cooking_oil",
7: "tea",
8: "coffee",
# 9: "chocolate",
9: "ice_cream",
10: "lip_gloss",
11: "curry",
12: "milk_tea",
# 13: "chili_oil",
13: "rust",
14: "blue_ink",
# 14: "mech_grease",
# 15: "color_pencil",
# 15: "deodorant",
15: "perfume",
# 16: "glue",
16: "shoe_cream",
17: "oil_pastel",
18: "blueberry",
19: "sweat",
20: "egg",
# 20: "mayonnaise",
21: "ketchup",
22: "baby_food",
23: "soy_sauce",
24: "bean_paste",
25: "chili_sauce",
26: "fruit",
}
4 changes: 2 additions & 2 deletions custom_components/hon/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/Andre0512/hon/issues",
"requirements": [
"pyhOn==0.15.5"
"pyhOn==0.15.8"
],
"version": "0.9.1"
"version": "0.10.0-beta.1"
}
6 changes: 6 additions & 0 deletions custom_components/hon/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ class HonConfigSelectEntityDescription(SelectEntityDescription):
translation_key="dirt_level",
option_list=const.DIRTY_LEVEL,
),
HonConfigSelectEntityDescription(
key="startProgram.extendedStainType",
name="Stain Type",
icon="mdi:liquid-spot",
translation_key="stain_type",
),
),
"TD": (
HonConfigSelectEntityDescription(
Expand Down
8 changes: 8 additions & 0 deletions custom_components/hon/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@ class HonSensorEntityDescription(SensorEntityDescription):
translation_key="steam_level",
option_list=const.STEAM_LEVEL,
),
HonSensorEntityDescription(
key="stainType",
name="Stain Type",
icon="mdi:liquid-spot",
device_class=SensorDeviceClass.ENUM,
translation_key="stain_type",
option_list=const.STAIN_TYPES,
),
),
"TD": (
HonSensorEntityDescription(
Expand Down
43 changes: 43 additions & 0 deletions custom_components/hon/translations/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,49 @@
"unknown": "unknown"
},
"name": "Míra znečištění"
},
"stain_type": {
"state": {
"baby_food": "Dětská výživa",
"bean_paste": "Fazolová polévka",
"blood": "Krev",
"blueberry": "Borůvka",
"blue_ink": "Modrý inkoust",
"butter": "Máslo",
"chili_oil": "Chilli olej",
"chili_sauce": "Chilli omáčka",
"chocolate": "Čokoláda",
"coffe": "Káva",
"coffee": "Káva",
"color_pencil": "Tužka",
"cooking_oil": "Kuchyňský olej",
"curry": "Kari",
"deodorant": "Deodorant",
"egg": "Vejce",
"fruit": "Ovoce",
"glue": "Lepidlo",
"grass": "Tráva",
"ice_cream": "Zmrzlina",
"ketchup": "Kečup",
"lip_gloss": "Lesk na rty",
"mayonnaise": "Majonéza",
"mech_grease": "Strojní mazivo",
"milk": "Mléko",
"milk_tea": "Čaj s mlékem",
"oil": "Olej",
"oil_pastel": "Olejový pastel",
"perfume": "Parfém",
"rust": "Rez",
"shoe_cream": "Krém na obuv",
"soil": "Hlína",
"soy_sauce": "Sójová Omáčka",
"stain_level": "Úroveň znečištění",
"sweat": "Skvrny od potu",
"tea": "Čaj",
"wine": "Víno",
"unknown": "unknown"
},
"name": "Úroveň znečištění"
}
},
"switch": {
Expand Down
43 changes: 43 additions & 0 deletions custom_components/hon/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,49 @@
"unknown": "unknown"
},
"name": "Verschmutzungsgrad"
},
"stain_type": {
"state": {
"baby_food": "Babynahrung",
"bean_paste": "Bohnensuppe",
"blood": "Blut",
"blueberry": "Blaubeere",
"blue_ink": "Blaue Tinte",
"butter": "Butter",
"chili_oil": "Chili-Öl",
"chili_sauce": "Chili-Sauce",
"chocolate": "Schokolade",
"coffe": "Kaffee",
"coffee": "Kaffee",
"color_pencil": "Bleistift",
"cooking_oil": "Speiseöl",
"curry": "Curry",
"deodorant": "Deodorant",
"egg": "Ei",
"fruit": "Obst",
"glue": "Klebstoff",
"grass": "Gras",
"ice_cream": "Eiscreme",
"ketchup": "Ketchup",
"lip_gloss": "Lipgloss",
"mayonnaise": "Mayonaise",
"mech_grease": "Mechanisches Fett",
"milk": "Milch",
"milk_tea": "Milchtee",
"oil": "Öl",
"oil_pastel": "Ölpastell",
"perfume": "Parfüm",
"rust": "Rostflecken",
"shoe_cream": "Schuhcreme",
"soil": "Boden",
"soy_sauce": "Sojasosse",
"stain_level": "Grad der Verschmutzung",
"sweat": "Schweiß",
"tea": "Tee",
"wine": "Wein",
"unknown": "unknown"
},
"name": "Grad der Verschmutzung"
}
},
"switch": {
Expand Down
43 changes: 43 additions & 0 deletions custom_components/hon/translations/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,49 @@
"unknown": "unknown"
},
"name": "Επίπεδο βρωμιάς"
},
"stain_type": {
"state": {
"baby_food": "Βρεφικές τροφές",
"bean_paste": "Σούπα φασολιών",
"blood": "Αίμα",
"blueberry": "Μπλε μύρτιλο (μπλούμπερι)",
"blue_ink": "Μπλε μελάνι",
"butter": "Βούτυρο",
"chili_oil": "Λάδι τσίλι",
"chili_sauce": "Σάλτσα τσίλι",
"chocolate": "Σοκολάτα",
"coffe": "Καφές",
"coffee": "Καφές",
"color_pencil": "Μολύβι",
"cooking_oil": "Μαγειρικό λάδι",
"curry": "Κάρι",
"deodorant": "Αποσμητικό",
"egg": "Αυγό",
"fruit": "Φρουτα",
"glue": "Κόλλα",
"grass": "Γρασίδι",
"ice_cream": "Παγωτό",
"ketchup": "Κέτσαπ",
"lip_gloss": "Lip gloss",
"mayonnaise": "Μαγιονέζα",
"mech_grease": "Λάδι μηχανής",
"milk": "Γάλα",
"milk_tea": "Τσάι με γάλα",
"oil": "Λάδι",
"oil_pastel": "Χρώμα λαδιού",
"perfume": "Άρωμα",
"rust": "Σκουριά",
"shoe_cream": "Βερνίκι παπουτσιών",
"soil": "Χώμα",
"soy_sauce": "Σαλτσα Σογιας",
"stain_level": "Επίπεδο λεκέδων",
"sweat": "Ιδρώτας",
"tea": "Τσάι",
"wine": "Κρασί",
"unknown": "unknown"
},
"name": "Επίπεδο λεκέδων"
}
},
"switch": {
Expand Down
43 changes: 43 additions & 0 deletions custom_components/hon/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1750,6 +1750,49 @@
"unknown": "unknown"
},
"name": "Dirt level"
},
"stain_type": {
"state": {
"baby_food": "Baby food",
"bean_paste": "Bean soup",
"blood": "Blood",
"blueberry": "Blueberry",
"blue_ink": "Blue ink",
"butter": "Butter",
"chili_oil": "Chili oil",
"chili_sauce": "Chili sauce",
"chocolate": "Chocolate",
"coffe": "Coffee",
"coffee": "Coffee",
"color_pencil": "Pencil",
"cooking_oil": "Cooking oil",
"curry": "Curry",
"deodorant": "Deodorant",
"egg": "Egg",
"fruit": "Fruit",
"glue": "Glue",
"grass": "Grass",
"ice_cream": "Ice cream",
"ketchup": "Ketchup",
"lip_gloss": "Lip gloss",
"mayonnaise": "Mayonnaise",
"mech_grease": "Mech grease",
"milk": "Milk",
"milk_tea": "Milk tea",
"oil": "Oil",
"oil_pastel": "Oil pastel",
"perfume": "Perfume",
"rust": "Rust",
"shoe_cream": "Shoe cream",
"soil": "Soil",
"soy_sauce": "Soy sauce",
"stain_level": "Stain level",
"sweat": "Sweat",
"tea": "Tea",
"wine": "Wine",
"unknown": "unknown"
},
"name": "Stain level"
}
},
"switch": {
Expand Down
43 changes: 43 additions & 0 deletions custom_components/hon/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,49 @@
"unknown": "unknown"
},
"name": "Nivel de suciedad"
},
"stain_type": {
"state": {
"baby_food": "Comida de bebé",
"bean_paste": "Sopa de alubias",
"blood": "Sangre",
"blueberry": "Arándano",
"blue_ink": "Tinta azul",
"butter": "Mantequilla",
"chili_oil": "Aceite de chile",
"chili_sauce": "Salsa de chile",
"chocolate": "Chocolate",
"coffe": "Café",
"coffee": "Café",
"color_pencil": "Lápiz",
"cooking_oil": "Aceite de cocina",
"curry": "Curry",
"deodorant": "Desodorante",
"egg": "Huevo",
"fruit": "Fruta",
"glue": "Pegamento",
"grass": "Césped",
"ice_cream": "Helado",
"ketchup": "Kétchup",
"lip_gloss": "Brillo de labios",
"mayonnaise": "Mayonesa",
"mech_grease": "Grasa mecánica",
"milk": "Leche",
"milk_tea": "Té con leche",
"oil": "Aceite",
"oil_pastel": "Pastel al óleo",
"perfume": "Perfume",
"rust": "Óxido",
"shoe_cream": "Betún",
"soil": "Tierra",
"soy_sauce": "Salsa De Soja",
"stain_level": "Nivel de manchas",
"sweat": "Sudor",
"tea": "",
"wine": "Vino",
"unknown": "unknown"
},
"name": "Nivel de manchas"
}
},
"switch": {
Expand Down
Loading

0 comments on commit 5e17081

Please sign in to comment.