Skip to content
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
16 changes: 6 additions & 10 deletions .github/workflows/python_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,15 @@ jobs:
fail-fast: false
matrix:
include:
- home-assistant: "2024.2.0"
python-version: "3.11"
- home-assistant: "2024.2.0"
python-version: "3.12"
- home-assistant: "2024.3.0"
python-version: "3.11"
- home-assistant: "2024.3.0"
python-version: "3.12"
- home-assistant: "2026.5.4"
python-version: "3.14"
- home-assistant: "2026.6.0"
python-version: "3.14"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion custom_components/hon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pathlib import Path
from typing import Any

import voluptuous as vol # type: ignore[import-untyped]
import voluptuous as vol
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
from homeassistant.helpers import config_validation as cv, aiohttp_client
Expand Down
5 changes: 2 additions & 3 deletions custom_components/hon/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,13 +428,12 @@ class HonBinarySensorEntity(HonEntity, BinarySensorEntity):
def is_on(self) -> bool:
attr = self._device.get(self.entity_description.key, None)
value = attr.value if hasattr(attr, "value") else attr
return value == self.entity_description.on_value

return bool(value == self.entity_description.on_value)

@callback
def _handle_coordinator_update(self, update: bool = True) -> None:
attr = self._device.get(self.entity_description.key, None)
value = attr.value if hasattr(attr, "value") else attr
self._attr_native_value = (value == self.entity_description.on_value)
self._attr_native_value = value == self.entity_description.on_value
if update:
self.schedule_update_ha_state()
2 changes: 1 addition & 1 deletion custom_components/hon/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ async def async_press(self) -> None:
persistent_notification.create(
self._hass, f"````\n```\n{self._device.diagnose}\n```\n````", title
)
_LOGGER.info(self._device.diagnose.replace(" ", "\u200B "))
_LOGGER.info(self._device.diagnose.replace(" ", "\u200b "))


class HonDataArchive(HonEntity, ButtonEntity):
Expand Down
35 changes: 24 additions & 11 deletions custom_components/hon/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,15 @@ async def async_set_temperature(self, **kwargs: Any) -> None:
if "settings.machMode" in self._device.settings:
current_mach = self._device.get("machMode")
if current_mach is not None:
self._device.settings["settings.machMode"].value = str(int(current_mach))
self._device.settings["settings.machMode"].value = str(
int(current_mach)
)
if "settings.onOffStatus" in self._device.settings:
current_onoff = self._device.get("onOffStatus")
if current_onoff is not None:
self._device.settings["settings.onOffStatus"].value = str(int(current_onoff))
self._device.settings["settings.onOffStatus"].value = str(
int(current_onoff)
)

self._device.settings["settings.tempSel"].value = str(int(temperature))
await self._device.commands["settings"].send()
Expand All @@ -211,12 +215,13 @@ def hvac_mode(self) -> HVACMode:

mode = HON_HVAC_MODE[mach]

if mode == HVACMode.AUTO and getattr(self, "_attr_hvac_mode", None) not in (
None,
HVACMode.OFF,
HVACMode.AUTO,
attr_mode: HVACMode | None = getattr(self, "_attr_hvac_mode", None)
if (
mode == HVACMode.AUTO
and attr_mode is not None
and attr_mode not in (HVACMode.OFF, HVACMode.AUTO)
):
return self._attr_hvac_mode
return attr_mode

return mode

Expand Down Expand Up @@ -314,11 +319,15 @@ async def async_set_fan_mode(self, fan_mode: str) -> None:
if "settings.machMode" in self._device.settings:
current_mach = self._device.get("machMode")
if current_mach is not None:
self._device.settings["settings.machMode"].value = str(int(current_mach))
self._device.settings["settings.machMode"].value = str(
int(current_mach)
)
if "settings.onOffStatus" in self._device.settings:
current_onoff = self._device.get("onOffStatus")
if current_onoff is not None:
self._device.settings["settings.onOffStatus"].value = str(int(current_onoff))
self._device.settings["settings.onOffStatus"].value = str(
int(current_onoff)
)

fan_modes: dict[str, str] = {}
for mode in reversed(self._device.settings["settings.windSpeed"].values):
Expand All @@ -345,11 +354,15 @@ async def async_set_swing_mode(self, swing_mode: str) -> None:
if "settings.machMode" in self._device.settings:
current_mach = self._device.get("machMode")
if current_mach is not None:
self._device.settings["settings.machMode"].value = str(int(current_mach))
self._device.settings["settings.machMode"].value = str(
int(current_mach)
)
if "settings.onOffStatus" in self._device.settings:
current_onoff = self._device.get("onOffStatus")
if current_onoff is not None:
self._device.settings["settings.onOffStatus"].value = str(int(current_onoff))
self._device.settings["settings.onOffStatus"].value = str(
int(current_onoff)
)

horizontal = self._device.settings["settings.windDirectionHorizontal"]
vertical = self._device.settings["settings.windDirectionVertical"]
Expand Down
8 changes: 4 additions & 4 deletions custom_components/hon/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import logging
from typing import Any

import voluptuous as vol # type: ignore[import-untyped]
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.config_entries import ConfigFlowResult
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
from homeassistant.data_entry_flow import FlowResult

from .const import DOMAIN

Expand All @@ -21,7 +21,7 @@ def __init__(self) -> None:

async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> FlowResult:
) -> ConfigFlowResult:
if user_input is None:
return self.async_show_form(
step_id="user",
Expand Down Expand Up @@ -53,5 +53,5 @@ async def async_step_user(
},
)

async def async_step_import(self, user_input: dict[str, str]) -> FlowResult:
async def async_step_import(self, user_input: dict[str, str]) -> ConfigFlowResult:
return await self.async_step_user(user_input)
1 change: 0 additions & 1 deletion scripts/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import sys
from pathlib import Path


if __name__ == "__main__":
sys.path.insert(0, str(Path(__file__).parent.parent))

Expand Down
Loading