ha_gehome/custom_components/ge_home/devices/wac.py

34 lines
1.3 KiB
Python
Raw Normal View History

import logging
from typing import List
from homeassistant.helpers.entity import Entity
from gehomesdk.erd import ErdCode, ErdApplianceType
from .base import ApplianceApi
from ..entities import GeWacClimate, GeErdSensor, GeErdBinarySensor, GeErdOnOffSwitch
_LOGGER = logging.getLogger(__name__)
class WacApi(ApplianceApi):
"""API class for window AC objects"""
APPLIANCE_TYPE = ErdApplianceType.AIR_CONDITIONER
def get_all_entities(self) -> List[Entity]:
base_entities = super().get_all_entities()
wac_entities = [
GeWacClimate(self),
GeErdSensor(self, ErdCode.AC_TARGET_TEMPERATURE),
GeErdSensor(self, ErdCode.AC_AMBIENT_TEMPERATURE),
GeErdSensor(self, ErdCode.AC_FAN_SETTING, icon_override="mdi:fan"),
GeErdSensor(self, ErdCode.AC_OPERATION_MODE),
GeErdOnOffSwitch(self, ErdCode.AC_POWER_STATUS, icon_on_override="mdi:power-on", icon_off_override="mdi:power-off"),
GeErdBinarySensor(self, ErdCode.AC_FILTER_STATUS, device_class_override="problem"),
GeErdSensor(self, ErdCode.WAC_DEMAND_RESPONSE_STATE),
GeErdSensor(self, ErdCode.WAC_DEMAND_RESPONSE_POWER),
]
entities = base_entities + wac_entities
return entities