Add sensors, renamed repo
This commit is contained in:
parent
5682149ecc
commit
9d8b17b2cf
17 changed files with 70 additions and 28 deletions
17
.github/workflows/hacs_check.yml
vendored
Normal file
17
.github/workflows/hacs_check.yml
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
name: HACS Action
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
jobs:
|
||||
hacs:
|
||||
name: HACS Action
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- name: HACS Action
|
||||
uses: "hacs/action@main"
|
||||
with:
|
||||
category: "integration"
|
14
.github/workflows/validate.yml
vendored
Normal file
14
.github/workflows/validate.yml
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
name: Validate with hassfest
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
jobs:
|
||||
validate:
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- uses: "actions/checkout@v3"
|
||||
- uses: "home-assistant/actions/hassfest@master"
|
|
@ -1,10 +1,11 @@
|
|||
# hOn
|
||||
# Haier hOn
|
||||
Home Assistant component supporting hOn cloud.
|
||||
|
||||
## Installation
|
||||
1. Installing via HACS
|
||||
#### Installing via HACS
|
||||
1. You need to have installed [HACS](https://hacs.xyz/)
|
||||
2. Go to HACS->Integrations
|
||||
3. Add this repo into your HACS custom repositories
|
||||
3. Add this repo (`https://github.com/Andre0512/haier.git`) into your HACS custom repositories
|
||||
4. Search for Haier hOn and Download it
|
||||
5. Restart your HomeAssistant
|
||||
6. Go to Settings->Devices & Services
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"domain": "hon",
|
||||
"name": "hOn",
|
||||
"config_flow": true,
|
||||
"version": "0.1.0",
|
||||
"codeowners": ["@Andre0512"],
|
||||
"iot_class": "cloud_polling",
|
||||
"requirements": ["pyhOn==0.2.4"],
|
||||
"documentation": "https://github.com/Andre0512/hOn/"
|
||||
}
|
|
@ -35,7 +35,7 @@ BINARY_SENSORS: dict[str, tuple[HonBinarySensorEntityDescription, ...]] = {
|
|||
key="doorLockStatus",
|
||||
name="Door Locked",
|
||||
device_class=BinarySensorDeviceClass.DOOR,
|
||||
on_value="1",
|
||||
on_value="0",
|
||||
),
|
||||
)
|
||||
}
|
1
custom_components/hOn/config_flow.py → custom_components/haier/config_flow.py
Executable file → Normal file
1
custom_components/hOn/config_flow.py → custom_components/haier/config_flow.py
Executable file → Normal file
|
@ -11,7 +11,6 @@ _LOGGER = logging.getLogger(__name__)
|
|||
|
||||
|
||||
class HonFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
|
||||
VERSION = 1
|
||||
CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_POLL
|
||||
|
2
custom_components/hOn/const.py → custom_components/haier/const.py
Executable file → Normal file
2
custom_components/hOn/const.py → custom_components/haier/const.py
Executable file → Normal file
|
@ -1,4 +1,4 @@
|
|||
DOMAIN = "hon"
|
||||
DOMAIN = "haier"
|
||||
|
||||
PLATFORMS = [
|
||||
"sensor",
|
0
custom_components/hOn/hon.py → custom_components/haier/hon.py
Executable file → Normal file
0
custom_components/hOn/hon.py → custom_components/haier/hon.py
Executable file → Normal file
11
custom_components/haier/manifest.json
Normal file
11
custom_components/haier/manifest.json
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"domain": "haier",
|
||||
"name": "Haier hOn",
|
||||
"codeowners": ["@Andre0512"],
|
||||
"config_flow": true,
|
||||
"documentation": "https://github.com/Andre0512/haier/",
|
||||
"iot_class": "cloud_polling",
|
||||
"issue_tracker": "https://github.com/Andre0512/haier/issues",
|
||||
"requirements": ["pyhOn==0.2.4"],
|
||||
"version": "0.1.1"
|
||||
}
|
|
@ -1,4 +1,3 @@
|
|||
"""Support for Tuya select."""
|
||||
from __future__ import annotations
|
||||
|
||||
from pyhon import HonConnection
|
||||
|
@ -11,10 +10,9 @@ from homeassistant.const import UnitOfTemperature, REVOLUTIONS_PER_MINUTE
|
|||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.entity import EntityCategory
|
||||
|
||||
from .const import DOMAIN
|
||||
from .hon import HonEntity, HonCoordinator
|
||||
|
||||
DOMAIN = "hon"
|
||||
|
||||
SELECTS = {
|
||||
"WM": (
|
||||
SelectEntityDescription(
|
|
@ -9,7 +9,7 @@ from homeassistant.components.sensor import (
|
|||
SensorEntityDescription,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import UnitOfEnergy, UnitOfVolume, UnitOfMass, UnitOfPower
|
||||
from homeassistant.const import UnitOfEnergy, UnitOfVolume, UnitOfMass, UnitOfPower, UnitOfTime
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.entity import EntityCategory
|
||||
from homeassistant.helpers.typing import StateType
|
||||
|
@ -75,7 +75,20 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = {
|
|||
icon="mdi:math-log",
|
||||
translation_key="errors"
|
||||
),
|
||||
|
||||
SensorEntityDescription(
|
||||
key="remainingTimeMM",
|
||||
name="Remaining Time",
|
||||
icon="mdi:timer",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
native_unit_of_measurement=UnitOfTime.MINUTES,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="spinSpeed",
|
||||
name="Spin Speed",
|
||||
icon="mdi:timer",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
native_unit_of_measurement=UnitOfTime.MINUTES,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
@ -1,13 +1,11 @@
|
|||
from collections.abc import Callable, Coroutine
|
||||
from dataclasses import dataclass
|
||||
from typing import Any
|
||||
|
||||
from pyhon import HonConnection
|
||||
from pyhon.device import HonDevice
|
||||
|
||||
from homeassistant.components.switch import SwitchEntityDescription, SwitchEntity
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import EntityCategory
|
||||
from pyhon import HonConnection
|
||||
from pyhon.device import HonDevice
|
||||
|
||||
from .const import DOMAIN
|
||||
from .hon import HonCoordinator, HonEntity
|
|
@ -2,7 +2,6 @@
|
|||
"config": {
|
||||
"step": {
|
||||
"user": {
|
||||
"title": "hOn",
|
||||
"description": "Please enters your hOn credentials",
|
||||
"data": {
|
||||
"email": "Email Address",
|
||||
|
@ -15,8 +14,10 @@
|
|||
"sensor": {
|
||||
"mode": {
|
||||
"state": {
|
||||
"0": "Disconnected",
|
||||
"1": "Ready",
|
||||
"2": "Running",
|
||||
"3": "Paused",
|
||||
"5": "Scheduled",
|
||||
"6": "Error",
|
||||
"7": "Finished"
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "hOn",
|
||||
"render_readme": false,
|
||||
"name": "Haier hOn",
|
||||
"render_readme": true,
|
||||
"homeassistant": "2023.2.0"
|
||||
}
|
Loading…
Reference in a new issue