Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
simbaja committed Dec 1, 2024
2 parents 4726509 + 955c2f0 commit cfc92be
Show file tree
Hide file tree
Showing 23 changed files with 68 additions and 29 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@

# GE Home Appliances (SmartHQ) Changelog

## 0.6.14

- Bugfix: Error checking socket status [#304]
- Bugfix: Error with setup [#301]
- Bugfix: Logger deprecations

## 0.6.13

- Bugfix: Deprecations [#290] [#297]
Expand Down
13 changes: 11 additions & 2 deletions custom_components/ge_home/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,22 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry):


async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
"""Set up the ge_home component."""
"""Set up ge_home from a config entry."""
hass.data.setdefault(DOMAIN, {})

"""Set up ge_home from a config entry."""
#try to get existing coordinator
existing: GeHomeUpdateCoordinator = dict.get(hass.data[DOMAIN],entry.entry_id)

coordinator = GeHomeUpdateCoordinator(hass, entry)
hass.data[DOMAIN][entry.entry_id] = coordinator

# try to unload the existing coordinator
try:
if existing:
await coordinator.async_reset()
except:
_LOGGER.warning("Could not reset existing coordinator.")

try:
if not await coordinator.async_setup():
return False
Expand Down
7 changes: 7 additions & 0 deletions custom_components/ge_home/devices/oven.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ def get_all_entities(self) -> List[Entity]:
has_upper_raw_temperature = self.has_erd_code(ErdCode.UPPER_OVEN_RAW_TEMPERATURE)
has_lower_raw_temperature = self.has_erd_code(ErdCode.LOWER_OVEN_RAW_TEMPERATURE)

has_upper_probe_temperature = self.has_erd_code(ErdCode.UPPER_OVEN_PROBE_DISPLAY_TEMP)
has_lower_probe_temperature = self.has_erd_code(ErdCode.LOWER_OVEN_PROBE_DISPLAY_TEMP)

upper_light : ErdOvenLightLevel = self.try_get_erd_value(ErdCode.UPPER_OVEN_LIGHT)
upper_light_availability: ErdOvenLightLevelAvailability = self.try_get_erd_value(ErdCode.UPPER_OVEN_LIGHT_AVAILABILITY)
lower_light : ErdOvenLightLevel = self.try_get_erd_value(ErdCode.LOWER_OVEN_LIGHT)
Expand Down Expand Up @@ -78,6 +81,8 @@ def get_all_entities(self) -> List[Entity]:
oven_entities.append(GeOvenLightLevelSelect(self, ErdCode.LOWER_OVEN_LIGHT))
if lower_warm_drawer is not None:
oven_entities.append(GeOvenWarmingStateSelect(self, ErdCode.LOWER_OVEN_WARMING_DRAWER_STATE))
if has_lower_probe_temperature:
oven_entities.append(GeErdSensor(self, ErdCode.LOWER_OVEN_PROBE_DISPLAY_TEMP, ErdCode.LOWER_OVEN_PROBE_DISPLAY_TEMP))

oven_entities.extend([
GeErdSensor(self, ErdCode.UPPER_OVEN_COOK_MODE, self._single_name(ErdCode.UPPER_OVEN_COOK_MODE, ~oven_config.has_lower_oven)),
Expand All @@ -96,6 +101,8 @@ def get_all_entities(self) -> List[Entity]:
oven_entities.append(GeOvenLightLevelSelect(self, ErdCode.UPPER_OVEN_LIGHT, self._single_name(ErdCode.UPPER_OVEN_LIGHT, ~oven_config.has_lower_oven)))
if upper_warm_drawer is not None:
oven_entities.append(GeOvenWarmingStateSelect(self, ErdCode.UPPER_OVEN_WARMING_DRAWER_STATE, self._single_name(ErdCode.UPPER_OVEN_WARMING_DRAWER_STATE, ~oven_config.has_lower_oven)))
if has_upper_probe_temperature:
oven_entities.append(GeErdSensor(self, ErdCode.UPPER_OVEN_PROBE_DISPLAY_TEMP, self._single_name(ErdCode.UPPER_OVEN_PROBE_DISPLAY_TEMP, ~oven_config.has_lower_oven)))

if oven_config.has_warming_drawer and warm_drawer is not None:
oven_entities.append(GeErdSensor(self, ErdCode.WARMING_DRAWER_STATE))
Expand Down
2 changes: 1 addition & 1 deletion custom_components/ge_home/entities/ac/fan_mode_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def from_option_string(self, value: str) -> Any:
try:
return ErdAcFanSetting[value.upper().replace(" ","_")]
except:
_LOGGER.warn(f"Could not set fan mode to {value}")
_LOGGER.warning(f"Could not set fan mode to {value}")
return self._default

def to_option_string(self, value: Any) -> Optional[str]:
Expand Down
4 changes: 2 additions & 2 deletions custom_components/ge_home/entities/ac/ge_biac_climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def from_option_string(self, value: str) -> Any:
HVACMode.FAN_ONLY: ErdAcOperationMode.FAN_ONLY
}.get(value)
except:
_LOGGER.warn(f"Could not set HVAC mode to {value.upper()}")
_LOGGER.warning(f"Could not set HVAC mode to {value.upper()}")
return ErdAcOperationMode.COOL
def to_option_string(self, value: Any) -> Optional[str]:
try:
Expand All @@ -32,7 +32,7 @@ def to_option_string(self, value: Any) -> Optional[str]:
ErdAcOperationMode.FAN_ONLY: HVACMode.FAN_ONLY
}.get(value)
except:
_LOGGER.warn(f"Could not determine operation mode mapping for {value}")
_LOGGER.warning(f"Could not determine operation mode mapping for {value}")
return HVACMode.COOL

class GeBiacClimate(GeClimate):
Expand Down
4 changes: 2 additions & 2 deletions custom_components/ge_home/entities/ac/ge_pac_climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def from_option_string(self, value: str) -> Any:
HVACMode.DRY: ErdAcOperationMode.DRY
}.get(value)
except:
_LOGGER.warn(f"Could not set HVAC mode to {value.upper()}")
_LOGGER.warning(f"Could not set HVAC mode to {value.upper()}")
return ErdAcOperationMode.COOL
def to_option_string(self, value: Any) -> Optional[str]:
try:
Expand All @@ -41,7 +41,7 @@ def to_option_string(self, value: Any) -> Optional[str]:
ErdAcOperationMode.FAN_ONLY: HVACMode.FAN_ONLY
}.get(value)
except:
_LOGGER.warn(f"Could not determine operation mode mapping for {value}")
_LOGGER.warning(f"Could not determine operation mode mapping for {value}")
return HVACMode.COOL

class GePacClimate(GeClimate):
Expand Down
4 changes: 2 additions & 2 deletions custom_components/ge_home/entities/ac/ge_sac_climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def from_option_string(self, value: str) -> Any:
HVACMode.DRY: ErdAcOperationMode.DRY
}.get(value)
except:
_LOGGER.warn(f"Could not set HVAC mode to {value.upper()}")
_LOGGER.warning(f"Could not set HVAC mode to {value.upper()}")
return ErdAcOperationMode.COOL
def to_option_string(self, value: Any) -> Optional[str]:
try:
Expand All @@ -45,7 +45,7 @@ def to_option_string(self, value: Any) -> Optional[str]:
ErdAcOperationMode.FAN_ONLY: HVACMode.FAN_ONLY
}.get(value)
except:
_LOGGER.warn(f"Could not determine operation mode mapping for {value}")
_LOGGER.warning(f"Could not determine operation mode mapping for {value}")
return HVACMode.COOL

class GeSacClimate(GeClimate):
Expand Down
4 changes: 2 additions & 2 deletions custom_components/ge_home/entities/ac/ge_wac_climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def from_option_string(self, value: str) -> Any:
HVACMode.FAN_ONLY: ErdAcOperationMode.FAN_ONLY
}.get(value)
except:
_LOGGER.warn(f"Could not set HVAC mode to {value.upper()}")
_LOGGER.warning(f"Could not set HVAC mode to {value.upper()}")
return ErdAcOperationMode.COOL
def to_option_string(self, value: Any) -> Optional[str]:
try:
Expand All @@ -32,7 +32,7 @@ def to_option_string(self, value: Any) -> Optional[str]:
ErdAcOperationMode.FAN_ONLY: HVACMode.FAN_ONLY
}.get(value)
except:
_LOGGER.warn(f"Could not determine operation mode mapping for {value}")
_LOGGER.warning(f"Could not determine operation mode mapping for {value}")
return HVACMode.COOL

class GeWacClimate(GeClimate):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def from_option_string(self, value: str) -> Any:
try:
return ErdCcmBrewStrength[value.upper()]
except:
_LOGGER.warn(f"Could not set brew strength to {value.upper()}")
_LOGGER.warning(f"Could not set brew strength to {value.upper()}")
return self._default

def to_option_string(self, value: ErdCcmBrewStrength) -> Optional[str]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ async def set_timer(self, duration: timedelta):
try:
await self.appliance.async_set_erd_value(self.erd_code, duration)
except:
_LOGGER.warn("Could not set timer value", exc_info=1)
_LOGGER.warning("Could not set timer value", exc_info=1)

async def clear_timer(self):
try:
#There's a stupid issue in that if the timer has already expired, the beeping
#won't turn off... I don't see any way around it though.
await self.appliance.async_set_erd_value(self.erd_code, timedelta(seconds=0))
except:
_LOGGER.warn("Could not clear timer value", exc_info=1)
_LOGGER.warning("Could not clear timer value", exc_info=1)
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def from_option_string(self, value: str) -> Any:
return ErdAcFanSetting.DEFAULT
return ErdAcFanSetting[value.upper()]
except:
_LOGGER.warn(f"Could not set fan setting to {value.upper()}")
_LOGGER.warning(f"Could not set fan setting to {value.upper()}")
return ErdAcFanSetting.DEFAULT
def to_option_string(self, value: ErdAcFanSetting) -> Optional[str]:
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def from_option_string(self, value: str) -> Any:
v = value.split(" ")[0]
return ErdConvertableDrawerMode[v.upper()]
except:
_LOGGER.warn(f"Could not set drawer mode to {value.upper()}")
_LOGGER.warning(f"Could not set drawer mode to {value.upper()}")
return ErdConvertableDrawerMode.NA
def to_option_string(self, value: ErdConvertableDrawerMode) -> Optional[str]:
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def from_option_string(self, value: str) -> Any:
try:
return ErdHoodFanSpeed[value.upper()]
except:
_LOGGER.warn(f"Could not set hood fan speed to {value.upper()}")
_LOGGER.warning(f"Could not set hood fan speed to {value.upper()}")
return ErdHoodFanSpeed.OFF
def to_option_string(self, value: ErdHoodFanSpeed) -> Optional[str]:
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def from_option_string(self, value: str) -> Any:
try:
return ErdHoodLightLevel[value.upper()]
except:
_LOGGER.warn(f"Could not set hood light level to {value.upper()}")
_LOGGER.warning(f"Could not set hood light level to {value.upper()}")
return ErdHoodLightLevel.OFF
def to_option_string(self, value: ErdHoodLightLevel) -> Optional[str]:
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def from_option_string(self, value: str) -> Any:
try:
return ErdOimLightLevel[value.upper()]
except:
_LOGGER.warn(f"Could not set hood light level to {value.upper()}")
_LOGGER.warning(f"Could not set hood light level to {value.upper()}")
return ErdOimLightLevel.OFF
def to_option_string(self, value: ErdOimLightLevel) -> Optional[str]:
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def from_option_string(self, value: str) -> Any:
try:
return ErdOvenLightLevel[value.upper()]
except:
_LOGGER.warn(f"Could not set Oven light level to {value.upper()}")
_LOGGER.warning(f"Could not set Oven light level to {value.upper()}")
return ErdOvenLightLevel.OFF
def to_option_string(self, value: ErdOvenLightLevel) -> Optional[str]:
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def from_option_string(self, value: str) -> Any:
try:
return ErdOvenWarmingState[value.upper()]
except:
_LOGGER.warn(f"Could not set Oven warming state to {value.upper()}")
_LOGGER.warning(f"Could not set Oven warming state to {value.upper()}")
return ErdOvenWarmingState.OFF
def to_option_string(self, value: ErdOvenWarmingState) -> Optional[str]:
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def from_option_string(self, value: str) -> Any:
try:
return ErdWaterFilterPosition[value.upper()]
except:
_LOGGER.warn(f"Could not set filter position to {value.upper()}")
_LOGGER.warning(f"Could not set filter position to {value.upper()}")
return ErdWaterFilterPosition.UNKNOWN
def to_option_string(self, value: Any) -> Optional[str]:
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def from_option_string(self, value: str) -> Any:
try:
return ErdWaterHeaterMode[enum_val]
except:
_LOGGER.warn(f"Could not heater mode to {enum_val}")
_LOGGER.warning(f"Could not heater mode to {enum_val}")
return ErdWaterHeaterMode.UNKNOWN
def to_option_string(self, value: ErdWaterHeaterMode) -> Optional[str]:
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def from_option_string(self, value: str) -> Any:
try:
return ErdWaterSoftenerShutoffValveState[value.upper()]
except:
_LOGGER.warn(f"Could not set filter position to {value.upper()}")
_LOGGER.warning(f"Could not set filter position to {value.upper()}")
return ErdWaterSoftenerShutoffValveState.UNKNOWN
def to_option_string(self, value: Any) -> Optional[str]:
try:
Expand Down
4 changes: 2 additions & 2 deletions custom_components/ge_home/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"integration_type": "hub",
"iot_class": "cloud_push",
"documentation": "https://github.com/simbaja/ha_gehome",
"requirements": ["gehomesdk==0.5.29","magicattr==0.1.6","slixmpp==1.8.3"],
"requirements": ["gehomesdk==0.5.30","magicattr==0.1.6","slixmpp==1.8.3"],
"codeowners": ["@simbaja"],
"version": "0.6.13"
"version": "0.6.14"
}
6 changes: 3 additions & 3 deletions custom_components/ge_home/update_coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ async def get_client(self) -> GeWebsocketClient:
self.client.clear_event_handlers()
await self.client.disconnect()
except Exception as err:
_LOGGER.warn(f"exception while disconnecting client {err}")
_LOGGER.warning(f"exception while disconnecting client {err}")
finally:
self._reset_initialization()

Expand Down Expand Up @@ -252,7 +252,7 @@ async def async_reconnect(self) -> None:
with async_timeout.timeout(ASYNC_TIMEOUT):
await self.async_start_client()
except Exception as err:
_LOGGER.warn(f"could not reconnect: {err}, will retry in {self._get_retry_delay()} seconds")
_LOGGER.warning(f"could not reconnect: {err}, will retry in {self._get_retry_delay()} seconds")
self.hass.loop.call_later(self._get_retry_delay(), self.reconnect)
_LOGGER.debug("forcing a state refresh while disconnected")
try:
Expand Down Expand Up @@ -304,7 +304,7 @@ def _update_entity_state(self, entities: List[Entity]):
_LOGGER.debug(f"Refreshing state for {entity} ({entity.unique_id}, {entity.entity_id}")
entity.async_write_ha_state()
except:
_LOGGER.warn(f"Could not refresh state for {entity} ({entity.unique_id}, {entity.entity_id}", exc_info=1)
_LOGGER.warning(f"Could not refresh state for {entity} ({entity.unique_id}, {entity.entity_id}", exc_info=1)

@property
def all_appliances_updated(self) -> bool:
Expand Down
17 changes: 17 additions & 0 deletions info.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,23 @@ A/C Controls:

#### Bugfixes

{% if version_installed.split('.') | map('int') < '0.6.14'.split('.') | map('int') %}

- Bugfix: Error checking socket status [#304]
- Bugfix: Error with setup [#301]
- Bugfix: Logger deprecations
{% endif %}


{% if version_installed.split('.') | map('int') < '0.6.13'.split('.') | map('int') %}
- Bugfix: Deprecations [#290] [#297]
{% endif %}


{% if version_installed.split('.') | map('int') < '0.6.12'.split('.') | map('int') %}
- Bugfix: Deprecations [#271]
{% endif %}


{% if version_installed.split('.') | map('int') < '0.6.13'.split('.') | map('int') %}
- Bugfix: Deprecations [#290] [#297]
Expand Down

0 comments on commit cfc92be

Please sign in to comment.