Skip to content

Commit 86f3a88

Browse files
committed
Backwards compatibility updates
Ensure integration loads in 2024.1.0
1 parent 0435236 commit 86f3a88

File tree

3 files changed

+21
-9
lines changed

3 files changed

+21
-9
lines changed

custom_components/hubitat/config_flow.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Config flow for Hubitat integration."""
2+
23
import logging
34
from copy import deepcopy
45
from typing import Any, Awaitable, Callable, cast
@@ -11,7 +12,6 @@
1112
CONN_CLASS_LOCAL_PUSH,
1213
ConfigEntry,
1314
ConfigFlow,
14-
ConfigFlowResult,
1515
OptionsFlow,
1616
)
1717
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_HOST, CONF_TEMPERATURE_UNIT
@@ -20,6 +20,14 @@
2020
from homeassistant.helpers import device_registry
2121
from homeassistant.helpers.device_registry import DeviceEntry
2222

23+
try:
24+
from homeassistant.config_entries import ConfigFlowResult # type: ignore
25+
except Exception:
26+
from homeassistant.config_entries import (
27+
FlowResult as ConfigFlowResult, # type: ignore
28+
)
29+
30+
2331
from .const import (
2432
DOMAIN,
2533
H_CONF_APP_ID,
@@ -79,7 +87,9 @@ class HubitatConfigFlow(ConfigFlow, domain=DOMAIN): # type: ignore
7987
def async_get_options_flow(config_entry: ConfigEntry) -> OptionsFlow:
8088
return HubitatOptionsFlow(config_entry)
8189

82-
async def async_step_user(
90+
# TODO: remove the 'type: ignore' when were not falling back on
91+
# FlowResult
92+
async def async_step_user( # type: ignore
8393
self, user_input: dict[str, Any] | None = None
8494
) -> ConfigFlowResult:
8595
"""Handle the user step."""

custom_components/hubitat/fan.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ def __init__(self, **kwargs: Unpack[HubitatEntityArgs]):
4040
FanEntity.__init__(self)
4141
self._attr_supported_features = FanEntityFeature.SET_SPEED
4242

43+
# Enable TURN_ON and TURN_OFF when used with a supporting version of
44+
# HomeAssistant
4345
if "TURN_ON" in FanEntityFeature.__members__:
4446
self._attr_supported_features |= (
45-
FanEntityFeature.TURN_ON | FanEntityFeature.TURN_OFF
47+
FanEntityFeature.TURN_ON | FanEntityFeature.TURN_OFF # type: ignore
4648
)
47-
self._enable_turn_on_off_backwards_compatibility
49+
self._enable_turn_on_off_backwards_compatibility # type: ignore
4850

4951
self._attr_unique_id = f"{super().unique_id}::fan"
5052
self.load_state()

requirements-dev.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ acme==2.10.0
1414
# via hass-nabucasa
1515
aiodns==3.2.0
1616
# via homeassistant
17-
aiohappyeyeballs==2.3.5
17+
aiohappyeyeballs==2.4.0
1818
# via aiohttp
1919
aiohttp==3.10.1
2020
# via aiohttp-cors
@@ -66,9 +66,9 @@ bluetooth-auto-recovery==1.3.0
6666
# via habluetooth
6767
bluetooth-data-tools==1.19.0
6868
# via habluetooth
69-
boto3==1.34.93
69+
boto3==1.35.10
7070
# via pycognito
71-
botocore==1.34.93
71+
botocore==1.35.10
7272
# via boto3
7373
# via s3transfer
7474
btsocket==0.2.0
@@ -167,7 +167,7 @@ platformdirs==4.2.0
167167
pluggy==1.4.0
168168
# via pytest
169169
pre-commit==2.21.0
170-
psutil==5.9.8
170+
psutil==6.0.0
171171
# via psutil-home-assistant
172172
psutil-home-assistant==0.0.1
173173
# via homeassistant
@@ -221,7 +221,7 @@ requests==2.32.3
221221
# via homeassistant
222222
# via pycognito
223223
ruff==0.3.0
224-
s3transfer==0.10.1
224+
s3transfer==0.10.2
225225
# via boto3
226226
setuptools==69.1.1
227227
# via acme

0 commit comments

Comments
 (0)