- fixed advantium imports

- added wac support to the appliance creation
- added ac sensor icon to base entity
This commit is contained in:
Jack Simbach 2021-08-07 14:36:40 -04:00
parent 284ae75343
commit f4f402e70a
7 changed files with 44 additions and 3 deletions

View File

@ -1,3 +1,4 @@
from custom_components.ge_home.devices.wac import WacApi
import logging
from typing import Type
@ -35,6 +36,8 @@ def get_appliance_api_type(appliance_type: ErdApplianceType) -> Type:
return WaterFilterApi
if appliance_type == ErdApplianceType.ADVANTIUM:
return AdvantiumApi
if appliance_type == ErdApplianceType.AIR_CONDITIONER:
return WacApi
# Fallback
return ApplianceApi

View File

@ -1,4 +1,3 @@
from custom_components.ge_home.entities.advantium.ge_advantium import GeAdvantium
import logging
from typing import List
@ -6,7 +5,7 @@ from homeassistant.helpers.entity import Entity
from gehomesdk.erd import ErdCode, ErdApplianceType
from .base import ApplianceApi
from ..entities import GeErdSensor, GeErdBinarySensor, GeErdPropertySensor, GeErdPropertyBinarySensor, UPPER_OVEN
from ..entities import GeAdvantium, GeErdSensor, GeErdBinarySensor, GeErdPropertySensor, GeErdPropertyBinarySensor, UPPER_OVEN
_LOGGER = logging.getLogger(__name__)

View File

@ -0,0 +1,33 @@
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, GeErdSwitch
_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),
GeErdSwitch(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

View File

@ -3,3 +3,5 @@ from .dishwasher import *
from .fridge import *
from .oven import *
from .water_filter import *
from .advantium import *
from .ac import *

View File

@ -0,0 +1 @@
from .ge_wac_climate import GeWacClimate

View File

@ -0,0 +1 @@
from .ge_advantium import GeAdvantium

View File

@ -131,5 +131,7 @@ class GeErdEntity(GeEntity):
return "mdi:water"
if self.erd_code_class == ErdCodeClass.LIQUID_VOLUME:
return "mdi:water"
if self.erd_code_class == ErdCodeClass.AC_SENSOR:
return "mdi:air-conditioner"
return None