ha_gehome/custom_components/ge_home/devices/oim.py

41 lines
1.1 KiB
Python
Raw Normal View History

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,
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),
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