forked from ajmarks/ha_components
-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added support for split AC devices
- Loading branch information
Showing
4 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
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 GeSacClimate, GeErdSensor, GeErdBinarySensor, GeErdSwitch, ErdOnOffBoolConverter | ||
|
||
_LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
class SacApi(ApplianceApi): | ||
"""API class for Split AC objects""" | ||
APPLIANCE_TYPE = ErdApplianceType.SPLIT_AIR_CONDITIONER | ||
|
||
def get_all_entities(self) -> List[Entity]: | ||
base_entities = super().get_all_entities() | ||
|
||
sac_entities = [ | ||
GeSacClimate(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, bool_converter=ErdOnOffBoolConverter(), icon_on_override="mdi:power-on", icon_off_override="mdi:power-off"), | ||
] | ||
|
||
if self.has_erd_code(ErdCode.SAC_SLEEP_MODE): | ||
GeErdSwitch(self, ErdCode.SAC_SLEEP_MODE, bool_converter=ErdOnOffBoolConverter(), icon_on_override="mdi:sleep", icon_off_override="mdi:sleep-off"), | ||
if self.has_erd_code(ErdCode.SAC_AUTO_SWING_MODE): | ||
GeErdSwitch(self, ErdCode.SAC_AUTO_SWING_MODE, bool_converter=ErdOnOffBoolConverter(), icon_on_override="mdi:arrow-decision-auto", icon_off_override="mdi:arrow-decision-auto-outline"), | ||
|
||
|
||
entities = base_entities + sac_entities | ||
return entities | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from .ge_wac_climate import GeWacClimate | ||
from .ge_wac_climate import GeWacClimate | ||
from .ge_sac_climate import GeSacClimate |