mirror of
https://github.com/Andre0512/hon.git
synced 2026-05-09 02:21:13 +02:00
Added WD device type sensors.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
|
||||
from pyhon import HonConnection
|
||||
from pyhon.device import HonDevice
|
||||
from pyhon.parameter import HonParameterFixed
|
||||
@@ -13,6 +15,8 @@ from homeassistant.helpers.entity import EntityCategory
|
||||
from .const import DOMAIN
|
||||
from .hon import HonEntity, HonCoordinator
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
SELECTS = {
|
||||
"WM": (
|
||||
SelectEntityDescription(
|
||||
@@ -50,7 +54,15 @@ SELECTS = {
|
||||
icon="mdi:timer",
|
||||
unit_of_measurement=UnitOfTime.MINUTES
|
||||
),
|
||||
)
|
||||
),
|
||||
"WD": (
|
||||
SelectEntityDescription(
|
||||
key="startProgram.program",
|
||||
name="Program",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
translation_key="programs"
|
||||
),
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +81,7 @@ async def async_setup_entry(hass, entry: ConfigEntry, async_add_entities) -> Non
|
||||
if descriptions := SELECTS.get(device.appliance_type):
|
||||
for description in descriptions:
|
||||
if not device.get(description.key):
|
||||
_LOGGER.warning("[%s] Can't setup %s", device.appliance_type, description.key)
|
||||
continue
|
||||
appliances.extend([
|
||||
HonSelectEntity(hass, coordinator, entry, device, description)]
|
||||
|
||||
Reference in New Issue
Block a user