Skip to content

Commit

Permalink
fix: humidifiers level 0 handling (#67)
Browse files Browse the repository at this point in the history
This can occure if fan is disabled due to missing watter and no other
mode is enabled.
  • Loading branch information
Michsior14 authored Nov 9, 2024
1 parent e29b1c9 commit 94b0040
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions custom_components/venta/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
DEFAULT_SCAN_INTERVAL = 10
NO_WATER_THRESHOLD = 50000

MODE_LEVEL_0 = "level_0"
MODE_LEVEL_1 = "level_1"
MODE_LEVEL_2 = "level_2"
MODE_LEVEL_3 = "level_3"
Expand All @@ -19,6 +20,7 @@

MODES_3: list[str] = [
MODE_AUTO,
MODE_LEVEL_0,
MODE_LEVEL_1,
MODE_LEVEL_2,
MODE_LEVEL_3,
Expand Down
1 change: 1 addition & 0 deletions custom_components/venta/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"sleep": "Sleep",
"auto": "Auto",
"boost": "Boost",
"level_0": "None",
"level_1": "Level 1",
"level_2": "Level 2",
"level_3": "Level 3",
Expand Down
2 changes: 1 addition & 1 deletion custom_components/venta/venta_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def mode(self) -> str | None:
return MODE_AUTO
if MODE_SLEEP in self._attr_available_modes and data.action.get("SleepMode"):
return MODE_SLEEP
level = data.action.get("FanSpeed", 1)
level = data.action.get("FanSpeed", 0)
return f"level_{level}"

@property
Expand Down

0 comments on commit 94b0040

Please sign in to comment.