Skip to content

Commit

Permalink
Add sensors, renamed repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre0512 committed Mar 5, 2023
1 parent 5682149 commit 767a921
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 23 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Validate

on:
push:
pull_request:

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: home-assistant/actions/hassfest@master
- name: HACS validation
uses: hacs/action@main
with:
category: integration
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class HonBinarySensorEntityDescription(HonBinarySensorEntityDescriptionMixin, Bi
key="doorLockStatus",
name="Door Locked",
device_class=BinarySensorDeviceClass.DOOR,
on_value="1",
on_value="0",
),
)
}
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion custom_components/hOn/config_flow.py → custom_components/haier/config_flow.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


class HonFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):

VERSION = 1
CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_POLL

Expand Down
2 changes: 1 addition & 1 deletion custom_components/hOn/const.py → custom_components/haier/const.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DOMAIN = "hon"
DOMAIN = "haier"

PLATFORMS = [
"sensor",
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions custom_components/hOn/manifest.json → custom_components/haier/manifest.json
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"domain": "hon",
"name": "hOn",
"config_flow": true,
"version": "0.1.0",
"domain": "haier",
"name": "Haier hOn",
"codeowners": ["@Andre0512"],
"config_flow": true,
"documentation": "https://github.com/Andre0512/haier/",
"iot_class": "cloud_polling",
"requirements": ["pyhOn==0.2.4"],
"documentation": "https://github.com/Andre0512/hOn/"
"version": "0.1.1"
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"""Support for Tuya select."""
from __future__ import annotations

from pyhon import HonConnection
Expand All @@ -11,10 +10,9 @@
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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
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
Expand Down Expand Up @@ -75,7 +75,20 @@
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,
),
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"config": {
"step": {
"user": {
"title": "hOn",
"title": "Haier hOn",
"description": "Please enters your hOn credentials",
"data": {
"email": "Email Address",
Expand All @@ -15,8 +15,10 @@
"sensor": {
"mode": {
"state": {
"0": "Disconnected",
"1": "Ready",
"2": "Running",
"3": "Paused",
"5": "Scheduled",
"6": "Error",
"7": "Finished"
Expand Down
4 changes: 2 additions & 2 deletions hacs.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "hOn",
"render_readme": false,
"name": "Haier hOn",
"render_readme": true,
"homeassistant": "2023.2.0"
}

0 comments on commit 767a921

Please sign in to comment.