mirror of
https://github.com/Andre0512/hon.git
synced 2025-05-13 14:44:23 -04:00
Merge branch 'main' into oven
This commit is contained in:
parent
116f9d5470
commit
6093b57f76
7 changed files with 151 additions and 17 deletions
|
@ -1,3 +1,5 @@
|
|||
import logging
|
||||
|
||||
from dataclasses import dataclass
|
||||
from typing import Any
|
||||
|
||||
|
@ -10,6 +12,7 @@ from pyhon.device import HonDevice
|
|||
from .const import DOMAIN
|
||||
from .hon import HonCoordinator, HonEntity
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@dataclass
|
||||
class HonSwitchEntityDescriptionMixin:
|
||||
|
@ -69,6 +72,22 @@ SWITCHES: dict[str, tuple[HonSwitchEntityDescription, ...]] = {
|
|||
turn_off_key="resumeProgram",
|
||||
),
|
||||
),
|
||||
"WD": (
|
||||
HonSwitchEntityDescription(
|
||||
key="active",
|
||||
name="Washing Machine",
|
||||
icon="mdi:washing-machine",
|
||||
turn_on_key="startProgram",
|
||||
turn_off_key="stopProgram",
|
||||
),
|
||||
HonSwitchEntityDescription(
|
||||
key="pause",
|
||||
name="Pause Washing Machine",
|
||||
icon="mdi:pause",
|
||||
turn_on_key="pauseProgram",
|
||||
turn_off_key="resumeProgram",
|
||||
),
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
|
@ -90,6 +109,8 @@ async def async_setup_entry(hass, entry: ConfigEntry, async_add_entities) -> Non
|
|||
appliances.extend([
|
||||
HonSwitchEntity(hass, coordinator, entry, device, description)]
|
||||
)
|
||||
else:
|
||||
_LOGGER.warning("[%s] Can't setup %s", device.appliance_type, description.key)
|
||||
|
||||
async_add_entities(appliances)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue