Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add external handling in Overkiz AtlanticElectricalHeaterWithAdjustableTemperatureSetPoint #84010

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
PRESET_COMFORT2 = "comfort-2"
PRESET_FROST_PROTECTION = "frost_protection"
PRESET_PROG = "prog"
PRESET_EXTERNAL = "external"


# Map Overkiz presets to Home Assistant presets
Expand All @@ -36,6 +37,7 @@
OverkizCommandParam.COMFORT_2: PRESET_COMFORT2,
OverkizCommandParam.AUTO: PRESET_AUTO,
OverkizCommandParam.BOOST: PRESET_BOOST,
OverkizCommandParam.EXTERNAL: PRESET_EXTERNAL,
OverkizCommandParam.INTERNAL: PRESET_PROG,
}

Expand All @@ -48,6 +50,7 @@
OverkizCommandParam.AUTO: HVACMode.AUTO,
OverkizCommandParam.BASIC: HVACMode.HEAT,
OverkizCommandParam.STANDBY: HVACMode.OFF,
OverkizCommandParam.EXTERNAL: HVACMode.AUTO,
OverkizCommandParam.INTERNAL: HVACMode.AUTO,
}

Expand Down Expand Up @@ -96,15 +99,26 @@ async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
@property
def preset_mode(self) -> str | None:
"""Return the current preset mode, e.g., home, away, temp."""

states = self.device.states

if (
state := self.device.states[OverkizState.IO_TARGET_HEATING_LEVEL]
operating_mode := states[OverkizState.CORE_OPERATING_MODE]
) and operating_mode.value_as_str == OverkizCommandParam.EXTERNAL:
return PRESET_EXTERNAL

if (
state := states[OverkizState.IO_TARGET_HEATING_LEVEL]
) and state.value_as_str:
return OVERKIZ_TO_PRESET_MODE[state.value_as_str]
return None

async def async_set_preset_mode(self, preset_mode: str) -> None:
"""Set new preset mode."""
if preset_mode in [PRESET_AUTO, PRESET_PROG]:

if preset_mode == PRESET_EXTERNAL:
command = OverkizCommand.SET_SCHEDULING_TYPE
elif preset_mode in [PRESET_AUTO, PRESET_PROG]:
command = OverkizCommand.SET_OPERATING_MODE
else:
command = OverkizCommand.SET_HEATING_LEVEL
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/overkiz/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"config_flow": true,
"integration_type": "hub",
"documentation": "https://www.home-assistant.io/integrations/overkiz",
"requirements": ["pyoverkiz==1.7.2"],
"requirements": ["pyoverkiz==1.7.3"],
"zeroconf": [
{
"type": "_kizbox._tcp.local.",
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1820,7 +1820,7 @@ pyotgw==2.1.3
pyotp==2.7.0

# homeassistant.components.overkiz
pyoverkiz==1.7.2
pyoverkiz==1.7.3

# homeassistant.components.openweathermap
pyowm==3.2.0
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,7 @@ pyotgw==2.1.3
pyotp==2.7.0

# homeassistant.components.overkiz
pyoverkiz==1.7.2
pyoverkiz==1.7.3

# homeassistant.components.openweathermap
pyowm==3.2.0
Expand Down