Skip to content

Commit

Permalink
Formatting updates
Browse files Browse the repository at this point in the history
  • Loading branch information
MrD3y5eL committed Dec 24, 2024
1 parent 9db3207 commit 0cb0570
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions custom_components/actronair_neo/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
DOMAIN,
MIN_TEMP,
MAX_TEMP,
BASE_FAN_MODES,
ADVANCE_FAN_MODES,
ADVANCE_SERIES_MODELS,
)
from .coordinator import ActronDataCoordinator
Expand Down
2 changes: 1 addition & 1 deletion custom_components/actronair_neo/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,4 @@
"MED": 0x02,
"HIGH": 0x04,
"AUTO": 0x08
}
}
13 changes: 11 additions & 2 deletions custom_components/actronair_neo/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,16 @@ async def _parse_data(self, data: Dict[str, Any]) -> Dict[str, Any]:
raise UpdateFailed(f"Failed to parse API response: {e}") from e

def _validate_fan_modes(self, modes: Any) -> list[str]:
"""Validate and normalize supported fan modes."""
"""Validate and normalize supported fan modes.
Note on Actron Quirks:
- NV_SupportedFanModes is a bitmap where:
1=LOW, 2=MED, 4=HIGH, 8=AUTO
- Some devices omit HIGH from NV_SupportedFanModes even though
they support it. If we detect HIGH mode in current settings,
we add it to supported modes regardless of bitmap.
- When in doubt, we fall back to [LOW, MED, HIGH] as safe defaults.
"""
valid_modes = {"LOW", "MED", "HIGH", "AUTO"}
default_modes = ["LOW", "MED", "HIGH"]

Expand All @@ -341,7 +350,7 @@ def _validate_fan_modes(self, modes: Any) -> list[str]:
modes, bin(modes), modes
)

# Get current fan mode from settings - safely handle None case
# Get current fan mode to check for HIGH support
current_mode = None
if hasattr(self, 'data') and self.data is not None:
user_settings = self.data.get("raw_data", {}).get("lastKnownState", {}).get(
Expand Down
2 changes: 1 addition & 1 deletion custom_components/actronair_neo/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ force_update:
entity:
integration: actronair_neo
domain: climate
fields: {}
fields: {}

0 comments on commit 0cb0570

Please sign in to comment.