Skip to content

Commit

Permalink
Add first fridge sensors #41
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre0512 committed May 10, 2023
1 parent 0afbfe9 commit 146e710
Show file tree
Hide file tree
Showing 32 changed files with 730 additions and 75 deletions.
37 changes: 33 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Home Assistant integration for Haier hOn: support for Haier/Candy/Hoover home ap
- [Hob](https://github.com/Andre0512/hon#hob)
- [Dish Washer](https://github.com/Andre0512/hon#dish-washer)
- [Air conditioner](https://github.com/Andre0512/hon#air-conditioner) [BETA]
- [Fridge](https://github.com/Andre0512/hon#fridge) [BETA]

## Installation
**Method 1:** [![Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=Andre0512&repository=hon&category=integration)
Expand All @@ -32,15 +33,28 @@ _If the integration is not in the list, you need to clear the browser cache._


## Supported Models
Support was confirmed for these models. If a supported model is missing, please [add it with this form](https://forms.gle/bTSD8qFotdZFytbf8).
- Haier WD90-B14TEAM5
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 EG9012B19SU1JD
- Haier HD80-A3959
- Haier HW90-B14TEAM5
- Haier HWD100-B14979
- Haier HWO60SM2F3XH
- Hoover H-WASH 500
- Candy CIS633SCTTWIFI
- Haier XIB 3B2SFS-80
- Haier XIB 6B2D3FB
- Candy CIS633SCTTWIFI
- Candy CSOE C10DE-80
- Candy ROE H9A3TCEX-S
- Candy RPW41066BWMR/1-S
- Hoover H-WASH 500
- Hoover H-DRY 500
- Hoover H7W4 48MBC-S
- Hoover H9A3TCBEXS-S
- Hoover HFB 6B2S3FX
- Hoover HLE C10DCE-80
- Hoover HSOT3161WG
- Hoover HWPD 69AMBC/1-S
- Hoover NDE H10A2TCE-80
- Hoover NDPHY10A2TCBEXSS

## Supported Languages
Translation of internal names like programs are available for all languages which are official supported by the hOn app:
Expand Down Expand Up @@ -136,6 +150,10 @@ I moved the api related stuff into the package [pyhOn](https://github.com/Andre0
## Appliance Features

### Air conditioner
#### Controls
| Name | Icon | Entity | Key |
| --- | --- | --- | --- |
| Air Conditioner | `air-conditioner` | `climate` | `settings` |
#### Configs
| Name | Icon | Entity | Key |
| --- | --- | --- | --- |
Expand Down Expand Up @@ -235,6 +253,17 @@ I moved the api related stuff into the package [pyhOn](https://github.com/Andre0
| Temperature | `thermometer` | `sensor` | `temp` |
| Temperature Selected | `thermometer` | `sensor` | `tempSel` |

### Fridge
#### Configs
| Name | Icon | Entity | Key |
| --- | --- | --- | --- |
| Program | | `select` | `startProgram.program` |
#### Sensors
| Name | Icon | Entity | Key |
| --- | --- | --- | --- |
| Room Humidity | `water-percent` | `sensor` | `humidityEnv` |
| Room Temperature | `thermometer` | `sensor` | `tempEnv` |

### Tumble dryer
#### Controls
| Name | Icon | Entity | Key |
Expand Down
4 changes: 2 additions & 2 deletions custom_components/hon/binary_sensor.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import logging
from dataclasses import dataclass

from pyhon import Hon

from homeassistant.components.binary_sensor import (
BinarySensorEntityDescription,
BinarySensorDeviceClass,
BinarySensorEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import callback
from pyhon import Hon

from .const import DOMAIN
from .hon import HonCoordinator, HonEntity, unique_entities

Expand Down
4 changes: 1 addition & 3 deletions custom_components/hon/button.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import logging
import urllib
from urllib.parse import quote

import pkg_resources
from homeassistant.components.button import ButtonEntityDescription, ButtonEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import EntityCategory
from pyhon import Hon
from pyhon.appliance import HonAppliance

from homeassistant.const import EntityCategory
from .const import DOMAIN
from .hon import HonCoordinator, HonEntity

Expand Down
9 changes: 8 additions & 1 deletion custom_components/hon/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@
_LOGGER = logging.getLogger(__name__)

CLIMATES = {
"AC": (ClimateEntityDescription(key="startProgram", icon="mdi:air-conditioner"),),
"AC": (
ClimateEntityDescription(
key="settings",
name="Air Conditioner",
icon="mdi:air-conditioner",
translation_key="air_conditioner",
),
),
}


Expand Down
1 change: 0 additions & 1 deletion custom_components/hon/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import logging

import voluptuous as vol

from homeassistant import config_entries
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD

Expand Down
44 changes: 0 additions & 44 deletions custom_components/hon/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,50 +180,6 @@
"2": "AC.PROGRAM_DETAIL.FOLLOW_TOUCH",
}

TUMBLE_DRYER_PROGRAMS = [
"hqd_baby_care"
"hqd_bath_towel"
"hqd_bed_sheets"
"hqd_bulky"
"hqd_casual"
"hqd_cold_wind_30"
"hqd_cold_wind_timing"
"hqd_cotton"
"hqd_curtain"
"hqd_delicate"
"hqd_diaper"
"hqd_duvet"
"hqd_feather"
"hqd_hot_wind_timing"
"hqd_hygienic"
"hqd_i_refresh"
"hqd_i_refresh_pro"
"hqd_jacket"
"hqd_jeans"
"hqd_luxury"
"hqd_mix"
"hqd_night_dry"
"hqd_outdoor"
"hqd_precious_cure"
"hqd_quick_20"
"hqd_quick_30"
"hqd_quick_dry"
"hqd_quilt"
"hqd_refresh"
"hqd_school_uniform"
"hqd_shirt"
"hqd_shoes"
"hqd_silk"
"hqd_sports"
"hqd_synthetics"
"hqd_timer"
"hqd_towel"
"hqd_underwear"
"hqd_warm_up"
"hqd_wool"
"hqd_working_suit"
]

PROGRAMS_TD = [
"active_dry",
"allergy_care",
Expand Down
3 changes: 1 addition & 2 deletions custom_components/hon/hon.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import logging
from datetime import timedelta

from pyhon.appliance import HonAppliance

from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
from pyhon.appliance import HonAppliance

from .const import DOMAIN

Expand Down
9 changes: 4 additions & 5 deletions custom_components/hon/number.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
from __future__ import annotations

from pyhon import Hon
from pyhon.parameter.base import HonParameter
from pyhon.parameter.fixed import HonParameterFixed
from pyhon.parameter.range import HonParameterRange

from homeassistant.components.number import (
NumberEntity,
NumberEntityDescription,
Expand All @@ -13,6 +8,10 @@
from homeassistant.const import UnitOfTime, UnitOfTemperature
from homeassistant.core import callback
from homeassistant.helpers.entity import EntityCategory
from pyhon import Hon
from pyhon.parameter.base import HonParameter
from pyhon.parameter.fixed import HonParameterFixed
from pyhon.parameter.range import HonParameterRange

from .const import DOMAIN
from .hon import HonEntity, HonCoordinator, unique_entities
Expand Down
16 changes: 11 additions & 5 deletions custom_components/hon/select.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
from __future__ import annotations

import logging
import time

from pyhon import Hon
from pyhon.appliance import HonAppliance
from pyhon.parameter.fixed import HonParameterFixed

from homeassistant.components.select import SelectEntity, SelectEntityDescription
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import UnitOfTemperature, UnitOfTime, REVOLUTIONS_PER_MINUTE
from homeassistant.core import callback
from homeassistant.helpers.entity import EntityCategory
from pyhon import Hon
from pyhon.appliance import HonAppliance
from pyhon.parameter.fixed import HonParameterFixed

from .const import DOMAIN
from .hon import HonEntity, HonCoordinator, unique_entities
Expand Down Expand Up @@ -105,6 +103,14 @@
translation_key="eco_pilot",
),
),
"REF": (
SelectEntityDescription(
key="startProgram.program",
name="Program",
entity_category=EntityCategory.CONFIG,
translation_key="programs_ref",
),
),
}

SELECTS["WD"] = unique_entities(SELECTS["WM"], SELECTS["TD"])
Expand Down
25 changes: 22 additions & 3 deletions custom_components/hon/sensor.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import logging

from pyhon import Hon

from homeassistant.components.sensor import (
SensorEntity,
SensorDeviceClass,
SensorStateClass,
SensorEntityDescription,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import PERCENTAGE
from homeassistant.const import (
REVOLUTIONS_PER_MINUTE,
UnitOfEnergy,
Expand All @@ -21,7 +20,7 @@
from homeassistant.core import callback
from homeassistant.helpers.entity import EntityCategory
from homeassistant.helpers.typing import StateType
from homeassistant.const import PERCENTAGE
from pyhon import Hon

from . import const
from .const import DOMAIN
Expand Down Expand Up @@ -400,6 +399,26 @@
options=list(const.DISHWASHER_PR_PHASE),
),
),
"REF": (
SensorEntityDescription(
key="humidityEnv",
name="Room Humidity",
icon="mdi:water-percent",
device_class=SensorDeviceClass.HUMIDITY,
native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT,
translation_key="humidity",
),
SensorEntityDescription(
key="tempEnv",
name="Room Temperature",
icon="mdi:thermometer",
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
translation_key="room_temperature",
),
),
}
SENSORS["WD"] = unique_entities(SENSORS["WM"], SENSORS["TD"])

Expand Down
33 changes: 33 additions & 0 deletions custom_components/hon/translations/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,12 @@
"xxl_load": "XXL náplň",
"zoom_59": "Zoom 59"
}
},
"room_temperature": {
"name": "Pokojová teplota"
},
"humidity": {
"name": "Vlhkost"
}
},
"select": {
Expand Down Expand Up @@ -1013,6 +1019,28 @@
"iot_uv_and_fan": "UV + ventilátor",
"iot_uv_and_heat": "UV + ohřev"
}
},
"programs_ref": {
"state": {
"auto_set": "AUTOMATICKÉ NASTAVENÍ",
"cheese": "Sýr",
"chiller": "Quick cool",
"cold_drinks": "Soft chill",
"eco": "Eco",
"eco_mode": "Režim Eco",
"fruits_and_veg": "Fruit&Veg",
"fruit_and_veg": "Fruit & Veg",
"holiday": "DOVOLENÁ",
"keep_fresh": "0° Fresh",
"no_mode_selected": "Není vybrán žádný režim",
"quick_cool": "QUICK COOL",
"sea_food": "Ready to cook meal",
"soft_frozen": "Soft freezing",
"super_cool": "SUPER CHLAZENÍ",
"super_freeze": "SUPER MRAZENÍ",
"tea": "Cold drinks or Beverages",
"zero_fresh": "0° Fresh"
}
}
},
"switch": {
Expand Down Expand Up @@ -1220,6 +1248,11 @@
"induction_hob": {
"name": "Indukční varná deska"
}
},
"climate": {
"air_conditioner": {
"name": "Klimatizační jednotka"
}
}
},
"config": {
Expand Down
Loading

0 comments on commit 146e710

Please sign in to comment.