diff options
-rw-r--r-- | .github/workflows/validate.yml | 16 | ||||
-rw-r--r-- | README.md | 7 | ||||
-rw-r--r-- | custom_components/haier/__init__.py (renamed from custom_components/hOn/__init__.py) | 0 | ||||
-rw-r--r-- | custom_components/haier/binary_sensor.py (renamed from custom_components/hOn/binary_sensor.py) | 2 | ||||
-rw-r--r-- | custom_components/haier/button.py (renamed from custom_components/hOn/button.py) | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | custom_components/haier/config_flow.py (renamed from custom_components/hOn/config_flow.py) | 1 | ||||
-rw-r--r--[-rwxr-xr-x] | custom_components/haier/const.py (renamed from custom_components/hOn/const.py) | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | custom_components/haier/hon.py (renamed from custom_components/hOn/hon.py) | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | custom_components/haier/manifest.json (renamed from custom_components/hOn/manifest.json) | 10 | ||||
-rw-r--r-- | custom_components/haier/number.py (renamed from custom_components/hOn/number.py) | 0 | ||||
-rw-r--r-- | custom_components/haier/select.py (renamed from custom_components/hOn/select.py) | 4 | ||||
-rw-r--r-- | custom_components/haier/sensor.py (renamed from custom_components/hOn/sensor.py) | 17 | ||||
-rw-r--r-- | custom_components/haier/switch.py (renamed from custom_components/hOn/switch.py) | 6 | ||||
-rw-r--r-- | custom_components/haier/translations/en.json (renamed from custom_components/hOn/translations/en.json) | 4 | ||||
-rw-r--r-- | hacs.json | 4 |
15 files changed, 50 insertions, 23 deletions
diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..2014ad0 --- /dev/null +++ b/.github/workflows/validate.yml | |||
@@ -0,0 +1,16 @@ | |||
1 | name: Validate | ||
2 | |||
3 | on: | ||
4 | push: | ||
5 | pull_request: | ||
6 | |||
7 | jobs: | ||
8 | validate: | ||
9 | runs-on: ubuntu-latest | ||
10 | steps: | ||
11 | - uses: actions/checkout@v2 | ||
12 | - uses: home-assistant/actions/hassfest@master | ||
13 | - name: HACS validation | ||
14 | uses: hacs/action@main | ||
15 | with: | ||
16 | category: integration \ No newline at end of file | ||
@@ -1,10 +1,11 @@ | |||
1 | # hOn | 1 | # Haier hOn |
2 | Home Assistant component supporting hOn cloud. | 2 | Home Assistant component supporting hOn cloud. |
3 | 3 | ||
4 | ## Installation | 4 | ## Installation |
5 | 1. Installing via HACS | 5 | #### Installing via HACS |
6 | 1. You need to have installed [HACS](https://hacs.xyz/) | ||
6 | 2. Go to HACS->Integrations | 7 | 2. Go to HACS->Integrations |
7 | 3. Add this repo into your HACS custom repositories | 8 | 3. Add this repo (`https://github.com/Andre0512/haier.git`) into your HACS custom repositories |
8 | 4. Search for Haier hOn and Download it | 9 | 4. Search for Haier hOn and Download it |
9 | 5. Restart your HomeAssistant | 10 | 5. Restart your HomeAssistant |
10 | 6. Go to Settings->Devices & Services | 11 | 6. Go to Settings->Devices & Services |
diff --git a/custom_components/hOn/__init__.py b/custom_components/haier/__init__.py index 8c3917b..8c3917b 100644 --- a/custom_components/hOn/__init__.py +++ b/custom_components/haier/__init__.py | |||
diff --git a/custom_components/hOn/binary_sensor.py b/custom_components/haier/binary_sensor.py index 55f907c..fad7a8e 100644 --- a/custom_components/hOn/binary_sensor.py +++ b/custom_components/haier/binary_sensor.py | |||
@@ -35,7 +35,7 @@ BINARY_SENSORS: dict[str, tuple[HonBinarySensorEntityDescription, ...]] = { | |||
35 | key="doorLockStatus", | 35 | key="doorLockStatus", |
36 | name="Door Locked", | 36 | name="Door Locked", |
37 | device_class=BinarySensorDeviceClass.DOOR, | 37 | device_class=BinarySensorDeviceClass.DOOR, |
38 | on_value="1", | 38 | on_value="0", |
39 | ), | 39 | ), |
40 | ) | 40 | ) |
41 | } | 41 | } |
diff --git a/custom_components/hOn/button.py b/custom_components/haier/button.py index 8f48fa9..8f48fa9 100644 --- a/custom_components/hOn/button.py +++ b/custom_components/haier/button.py | |||
diff --git a/custom_components/hOn/config_flow.py b/custom_components/haier/config_flow.py index ea30fbc..e4ec404 100755..100644 --- a/custom_components/hOn/config_flow.py +++ b/custom_components/haier/config_flow.py | |||
@@ -11,7 +11,6 @@ _LOGGER = logging.getLogger(__name__) | |||
11 | 11 | ||
12 | 12 | ||
13 | class HonFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): | 13 | class HonFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): |
14 | |||
15 | VERSION = 1 | 14 | VERSION = 1 |
16 | CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_POLL | 15 | CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_POLL |
17 | 16 | ||
diff --git a/custom_components/hOn/const.py b/custom_components/haier/const.py index 5dae56e..6e99520 100755..100644 --- a/custom_components/hOn/const.py +++ b/custom_components/haier/const.py | |||
@@ -1,4 +1,4 @@ | |||
1 | DOMAIN = "hon" | 1 | DOMAIN = "haier" |
2 | 2 | ||
3 | PLATFORMS = [ | 3 | PLATFORMS = [ |
4 | "sensor", | 4 | "sensor", |
diff --git a/custom_components/hOn/hon.py b/custom_components/haier/hon.py index 3c2b548..3c2b548 100755..100644 --- a/custom_components/hOn/hon.py +++ b/custom_components/haier/hon.py | |||
diff --git a/custom_components/hOn/manifest.json b/custom_components/haier/manifest.json index 8701ffa..8871847 100755..100644 --- a/custom_components/hOn/manifest.json +++ b/custom_components/haier/manifest.json | |||
@@ -1,10 +1,10 @@ | |||
1 | { | 1 | { |
2 | "domain": "hon", | 2 | "domain": "haier", |
3 | "name": "hOn", | 3 | "name": "Haier hOn", |
4 | "config_flow": true, | ||
5 | "version": "0.1.0", | ||
6 | "codeowners": ["@Andre0512"], | 4 | "codeowners": ["@Andre0512"], |
5 | "config_flow": true, | ||
6 | "documentation": "https://github.com/Andre0512/haier/", | ||
7 | "iot_class": "cloud_polling", | 7 | "iot_class": "cloud_polling", |
8 | "requirements": ["pyhOn==0.2.4"], | 8 | "requirements": ["pyhOn==0.2.4"], |
9 | "documentation": "https://github.com/Andre0512/hOn/" | 9 | "version": "0.1.1" |
10 | } | 10 | } |
diff --git a/custom_components/hOn/number.py b/custom_components/haier/number.py index 0c41648..0c41648 100644 --- a/custom_components/hOn/number.py +++ b/custom_components/haier/number.py | |||
diff --git a/custom_components/hOn/select.py b/custom_components/haier/select.py index 7c0406a..acd4162 100644 --- a/custom_components/hOn/select.py +++ b/custom_components/haier/select.py | |||
@@ -1,4 +1,3 @@ | |||
1 | """Support for Tuya select.""" | ||
2 | from __future__ import annotations | 1 | from __future__ import annotations |
3 | 2 | ||
4 | from pyhon import HonConnection | 3 | from pyhon import HonConnection |
@@ -11,10 +10,9 @@ from homeassistant.const import UnitOfTemperature, REVOLUTIONS_PER_MINUTE | |||
11 | from homeassistant.core import callback | 10 | from homeassistant.core import callback |
12 | from homeassistant.helpers.entity import EntityCategory | 11 | from homeassistant.helpers.entity import EntityCategory |
13 | 12 | ||
13 | from .const import DOMAIN | ||
14 | from .hon import HonEntity, HonCoordinator | 14 | from .hon import HonEntity, HonCoordinator |
15 | 15 | ||
16 | DOMAIN = "hon" | ||
17 | |||
18 | SELECTS = { | 16 | SELECTS = { |
19 | "WM": ( | 17 | "WM": ( |
20 | SelectEntityDescription( | 18 | SelectEntityDescription( |
diff --git a/custom_components/hOn/sensor.py b/custom_components/haier/sensor.py index 2dbd0c4..d957283 100644 --- a/custom_components/hOn/sensor.py +++ b/custom_components/haier/sensor.py | |||
@@ -9,7 +9,7 @@ from homeassistant.components.sensor import ( | |||
9 | SensorEntityDescription, | 9 | SensorEntityDescription, |
10 | ) | 10 | ) |
11 | from homeassistant.config_entries import ConfigEntry | 11 | from homeassistant.config_entries import ConfigEntry |
12 | from homeassistant.const import UnitOfEnergy, UnitOfVolume, UnitOfMass, UnitOfPower | 12 | from homeassistant.const import UnitOfEnergy, UnitOfVolume, UnitOfMass, UnitOfPower, UnitOfTime |
13 | from homeassistant.core import callback | 13 | from homeassistant.core import callback |
14 | from homeassistant.helpers.entity import EntityCategory | 14 | from homeassistant.helpers.entity import EntityCategory |
15 | from homeassistant.helpers.typing import StateType | 15 | from homeassistant.helpers.typing import StateType |
@@ -75,7 +75,20 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = { | |||
75 | icon="mdi:math-log", | 75 | icon="mdi:math-log", |
76 | translation_key="errors" | 76 | translation_key="errors" |
77 | ), | 77 | ), |
78 | 78 | SensorEntityDescription( | |
79 | key="remainingTimeMM", | ||
80 | name="Remaining Time", | ||
81 | icon="mdi:timer", | ||
82 | state_class=SensorStateClass.MEASUREMENT, | ||
83 | native_unit_of_measurement=UnitOfTime.MINUTES, | ||
84 | ), | ||
85 | SensorEntityDescription( | ||
86 | key="spinSpeed", | ||
87 | name="Spin Speed", | ||
88 | icon="mdi:timer", | ||
89 | state_class=SensorStateClass.MEASUREMENT, | ||
90 | native_unit_of_measurement=UnitOfTime.MINUTES, | ||
91 | ), | ||
79 | ) | 92 | ) |
80 | } | 93 | } |
81 | 94 | ||
diff --git a/custom_components/hOn/switch.py b/custom_components/haier/switch.py index 28e7887..00f4cb0 100644 --- a/custom_components/hOn/switch.py +++ b/custom_components/haier/switch.py | |||
@@ -1,13 +1,11 @@ | |||
1 | from collections.abc import Callable, Coroutine | ||
2 | from dataclasses import dataclass | 1 | from dataclasses import dataclass |
3 | from typing import Any | 2 | from typing import Any |
4 | 3 | ||
5 | from pyhon import HonConnection | ||
6 | from pyhon.device import HonDevice | ||
7 | |||
8 | from homeassistant.components.switch import SwitchEntityDescription, SwitchEntity | 4 | from homeassistant.components.switch import SwitchEntityDescription, SwitchEntity |
9 | from homeassistant.config_entries import ConfigEntry | 5 | from homeassistant.config_entries import ConfigEntry |
10 | from homeassistant.const import EntityCategory | 6 | from homeassistant.const import EntityCategory |
7 | from pyhon import HonConnection | ||
8 | from pyhon.device import HonDevice | ||
11 | 9 | ||
12 | from .const import DOMAIN | 10 | from .const import DOMAIN |
13 | from .hon import HonCoordinator, HonEntity | 11 | from .hon import HonCoordinator, HonEntity |
diff --git a/custom_components/hOn/translations/en.json b/custom_components/haier/translations/en.json index c4d9edd..7053903 100644 --- a/custom_components/hOn/translations/en.json +++ b/custom_components/haier/translations/en.json | |||
@@ -2,7 +2,7 @@ | |||
2 | "config": { | 2 | "config": { |
3 | "step": { | 3 | "step": { |
4 | "user": { | 4 | "user": { |
5 | "title": "hOn", | 5 | "title": "Haier hOn", |
6 | "description": "Please enters your hOn credentials", | 6 | "description": "Please enters your hOn credentials", |
7 | "data": { | 7 | "data": { |
8 | "email": "Email Address", | 8 | "email": "Email Address", |
@@ -15,8 +15,10 @@ | |||
15 | "sensor": { | 15 | "sensor": { |
16 | "mode": { | 16 | "mode": { |
17 | "state": { | 17 | "state": { |
18 | "0": "Disconnected", | ||
18 | "1": "Ready", | 19 | "1": "Ready", |
19 | "2": "Running", | 20 | "2": "Running", |
21 | "3": "Paused", | ||
20 | "5": "Scheduled", | 22 | "5": "Scheduled", |
21 | "6": "Error", | 23 | "6": "Error", |
22 | "7": "Finished" | 24 | "7": "Finished" |
@@ -1,5 +1,5 @@ | |||
1 | { | 1 | { |
2 | "name": "hOn", | 2 | "name": "Haier hOn", |
3 | "render_readme": false, | 3 | "render_readme": true, |
4 | "homeassistant": "2023.2.0" | 4 | "homeassistant": "2023.2.0" |
5 | } \ No newline at end of file | 5 | } \ No newline at end of file |