Skip to content

Commit

Permalink
Add missing thermostat state EMERGENCY_HEAT to econet
Browse files Browse the repository at this point in the history
Also fix broken issue creation
  • Loading branch information
jdanders authored and Jordan Anderson committed Feb 7, 2025
1 parent dd9bd8e commit 4769ab8
Showing 1 changed file with 37 additions and 20 deletions.
57 changes: 37 additions & 20 deletions homeassistant/components/econet/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
ThermostatOperationMode.OFF: HVACMode.OFF,
ThermostatOperationMode.AUTO: HVACMode.HEAT_COOL,
ThermostatOperationMode.FAN_ONLY: HVACMode.FAN_ONLY,
ThermostatOperationMode.EMERGENCY_HEAT: HVACMode.HEAT,
}
HA_STATE_TO_ECONET = {value: key for key, value in ECONET_STATE_TO_HA.items()}

Expand Down Expand Up @@ -209,30 +210,46 @@ def set_fan_mode(self, fan_mode: str) -> None:

def turn_aux_heat_on(self) -> None:
"""Turn auxiliary heater on."""
async_create_issue(
self.hass,
DOMAIN,
"migrate_aux_heat",
breaks_in_ha_version="2025.4.0",
is_fixable=True,
is_persistent=True,
translation_key="migrate_aux_heat",
severity=IssueSeverity.WARNING,
)
# Ensure async_create_issue runs in the event loop
async def create_issue():
# Call async_create_issue without awaiting
async_create_issue(
self.hass,
DOMAIN,
"migrate_aux_heat",
breaks_in_ha_version="2025.4.0",
is_fixable=True,
is_persistent=True,
translation_key="migrate_aux_heat",
severity=IssueSeverity.WARNING,
)

# Schedule the async task
self.hass.loop.call_soon_threadsafe(lambda: self.hass.async_create_task(create_issue()))

# Set the heater mode
self._econet.set_mode(ThermostatOperationMode.EMERGENCY_HEAT)

def turn_aux_heat_off(self) -> None:
"""Turn auxiliary heater off."""
async_create_issue(
self.hass,
DOMAIN,
"migrate_aux_heat",
breaks_in_ha_version="2025.4.0",
is_fixable=True,
is_persistent=True,
translation_key="migrate_aux_heat",
severity=IssueSeverity.WARNING,
)
# Ensure async_create_issue runs in the event loop
async def create_issue():
# Call async_create_issue without awaiting
async_create_issue(
self.hass,
DOMAIN,
"migrate_aux_heat",
breaks_in_ha_version="2025.4.0",
is_fixable=True,
is_persistent=True,
translation_key="migrate_aux_heat",
severity=IssueSeverity.WARNING,
)

# Schedule the async task
self.hass.loop.call_soon_threadsafe(lambda: self.hass.async_create_task(create_issue()))

# Set the heater mode
self._econet.set_mode(ThermostatOperationMode.HEATING)

@property
Expand Down

0 comments on commit 4769ab8

Please sign in to comment.