2021-12-10 22:57:41 -07:00
|
|
|
import logging
|
|
|
|
from typing import List
|
|
|
|
|
|
|
|
from homeassistant.helpers.entity import Entity
|
|
|
|
from gehomesdk import (
|
|
|
|
ErdCode,
|
|
|
|
ErdApplianceType,
|
|
|
|
ErdOnOff
|
|
|
|
)
|
|
|
|
|
|
|
|
from .base import ApplianceApi
|
|
|
|
from ..entities import (
|
|
|
|
OimLightLevelOptionsConverter,
|
|
|
|
GeErdSensor,
|
2021-12-12 10:45:04 -07:00
|
|
|
GeErdBinarySensor,
|
2021-12-10 22:57:41 -07:00
|
|
|
GeErdSelect,
|
|
|
|
GeErdSwitch,
|
|
|
|
ErdOnOffBoolConverter
|
|
|
|
)
|
|
|
|
|
|
|
|
_LOGGER = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
|
|
|
|
class OimApi(ApplianceApi):
|
|
|
|
"""API class for Oven Hood objects"""
|
|
|
|
APPLIANCE_TYPE = ErdApplianceType.HOOD
|
|
|
|
|
|
|
|
def get_all_entities(self) -> List[Entity]:
|
|
|
|
base_entities = super().get_all_entities()
|
|
|
|
|
|
|
|
oim_entities = [
|
|
|
|
GeErdSensor(self, ErdCode.OIM_STATUS),
|
2021-12-12 10:45:04 -07:00
|
|
|
GeErdBinarySensor(self, ErdCode.OIM_FILTER_STATUS, device_class_override="problem"),
|
2021-12-10 22:57:41 -07:00
|
|
|
GeErdSelect(self, ErdCode.OIM_LIGHT_LEVEL, OimLightLevelOptionsConverter()),
|
|
|
|
GeErdSwitch(self, ErdCode.OIM_POWER, bool_converter=ErdOnOffBoolConverter(), icon_on_override="mdi:power-on", icon_off_override="mdi:power-off"),
|
|
|
|
]
|
|
|
|
|
|
|
|
entities = base_entities + oim_entities
|
|
|
|
return entities
|
|
|
|
|