forked from ajmarks/ha_components
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from simbaja/dev
v0.5.0 Dev -> Master
- Loading branch information
Showing
36 changed files
with
662 additions
and
47 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
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
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
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,52 @@ | ||
import logging | ||
from typing import List | ||
|
||
from homeassistant.helpers.entity import Entity | ||
from gehomesdk import ( | ||
ErdCode, | ||
ErdApplianceType, | ||
ErdHoodFanSpeedAvailability, | ||
ErdHoodLightLevelAvailability, | ||
ErdOnOff | ||
) | ||
|
||
from .base import ApplianceApi | ||
from ..entities import ( | ||
GeHoodLightLevelSelect, | ||
GeHoodFanSpeedSelect, | ||
GeErdSensor, | ||
GeErdSwitch, | ||
ErdOnOffBoolConverter | ||
) | ||
|
||
_LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
class HoodApi(ApplianceApi): | ||
"""API class for Oven Hood objects""" | ||
APPLIANCE_TYPE = ErdApplianceType.HOOD | ||
|
||
def get_all_entities(self) -> List[Entity]: | ||
base_entities = super().get_all_entities() | ||
|
||
#get the availabilities | ||
fan_availability: ErdHoodFanSpeedAvailability = self.try_get_erd_value(ErdCode.HOOD_FAN_SPEED_AVAILABILITY) | ||
light_availability: ErdHoodLightLevelAvailability = self.try_get_erd_value(ErdCode.HOOD_LIGHT_LEVEL_AVAILABILITY) | ||
timer_availability: ErdOnOff = self.try_get_erd_value(ErdCode.HOOD_TIMER_AVAILABILITY) | ||
|
||
hood_entities = [ | ||
#looks like this is always available? | ||
GeErdSwitch(self, ErdCode.HOOD_DELAY_OFF, bool_converter=ErdOnOffBoolConverter(), icon_on_override="mdi:power-on", icon_off_override="mdi:power-off"), | ||
] | ||
|
||
if fan_availability and fan_availability.is_available: | ||
hood_entities.append(GeHoodFanSpeedSelect(self, ErdCode.HOOD_FAN_SPEED)) | ||
#for now, represent as a select | ||
if light_availability and light_availability.is_available: | ||
hood_entities.append(GeHoodLightLevelSelect(self, ErdCode.HOOD_LIGHT_LEVEL)) | ||
if timer_availability == ErdOnOff.ON: | ||
hood_entities.append(GeErdSensor(self, ErdCode.HOOD_TIMER)) | ||
|
||
entities = base_entities + hood_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
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,3 +1,4 @@ | ||
from .ge_wac_climate import GeWacClimate | ||
from .ge_sac_climate import GeSacClimate | ||
from .ge_pac_climate import GePacClimate | ||
from .ge_pac_climate import GePacClimate | ||
from .ge_sac_temperature_sensor import GeSacTemperatureSensor |
15 changes: 15 additions & 0 deletions
15
custom_components/ge_home/entities/ac/ge_sac_temperature_sensor.py
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,15 @@ | ||
import logging | ||
from typing import Any, List, Optional | ||
|
||
from homeassistant.const import ( | ||
TEMP_FAHRENHEIT | ||
) | ||
from ..common import GeErdSensor | ||
|
||
class GeSacTemperatureSensor(GeErdSensor): | ||
"""Class for Split A/C temperature sensors""" | ||
|
||
@property | ||
def _temp_units(self) -> Optional[str]: | ||
#SAC appears to be hard coded to use Fahrenheit internally, no matter what the display shows | ||
return TEMP_FAHRENHEIT |
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
Oops, something went wrong.