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

2024.1.1 #107239

Merged
merged 26 commits into from
Jan 5, 2024
Merged

2024.1.1 #107239

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e70af20
Enable strict typing for airthings_ble (#106815)
cdce8p Jan 1, 2024
5a0997b
Fix qBittorrent torrent count when empty (#106903)
finder39 Jan 2, 2024
d87baba
Bump dropmqttapi to 1.0.2 (#106978)
pfrazer Jan 3, 2024
1c94a94
bump openwebifpy to 4.0.3 (#106593)
autinerd Dec 28, 2023
aef129a
Close stale connections (Airthings BLE) (#106748)
LaStrada Jan 3, 2024
ce5455f
Bump openwebifpy to 4.0.4 (#107000)
autinerd Jan 4, 2024
8c9875c
Get Shelly RPC device `gen` from config entry data (#107019)
bieniu Jan 4, 2024
427077a
Fix missing backwards compatiblity layer for humidifier supported_fea…
bdraco Jan 4, 2024
e2acc70
Use async_register in streamlabswater (#107060)
joostlek Jan 4, 2024
5529a85
Fix data access in streamlabs water (#107062)
joostlek Jan 4, 2024
80b45ed
Fix mobile_app cloudhook creation (#107068)
edenhaus Jan 5, 2024
c56d118
Deduplicate handling of duplicated constants (#107074)
emontnemery Jan 4, 2024
d600b76
Fix missing backwards compatibility layer for water_heater supported_…
bdraco Jan 4, 2024
a7aa5c0
Bump habluetooth to 2.0.2 (#107097)
bdraco Jan 4, 2024
b8576b8
Include deprecated constants in wildcard imports (#107114)
emontnemery Jan 5, 2024
04bf569
Update frontend to 20240104.0 (#107155)
bramkragten Jan 4, 2024
c78d691
Bump Orvibo to 1.1.2 (#107162)
emericklaw Jan 4, 2024
3215dfe
Bump aiohomekit to 3.1.2 (#107177)
bdraco Jan 4, 2024
d7e1a4f
Bump to PyTado 0.17.3 (#107181)
erwindouna Jan 4, 2024
4e126d6
Fix switch states in AVM FRITZ!Box Tools (#107183)
mib1185 Jan 4, 2024
c242dcd
Hotfix cache logic bug in Tessie (#107187)
Bre77 Jan 5, 2024
4ade5e4
Disable IPv6 in the opower integration to fix AEP utilities (#107203)
tronikos Jan 5, 2024
c3963b2
Fix entity property cache creation arguments (#107221)
ppetru Jan 5, 2024
056701d
Use supported_features_compat in update.install service (#107224)
ludeeus Jan 5, 2024
d012817
Bump zwave-js-server-python to 0.55.3 (#107225)
raman325 Jan 5, 2024
658f1cf
Bump version to 2024.1.1
frenck Jan 5, 2024
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
1 change: 1 addition & 0 deletions .strict-typing
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ homeassistant.components.aftership.*
homeassistant.components.air_quality.*
homeassistant.components.airly.*
homeassistant.components.airnow.*
homeassistant.components.airthings_ble.*
homeassistant.components.airvisual.*
homeassistant.components.airvisual_pro.*
homeassistant.components.airzone.*
Expand Down
9 changes: 6 additions & 3 deletions homeassistant/components/airthings_ble/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
from datetime import timedelta
import logging

from airthings_ble import AirthingsBluetoothDeviceData
from airthings_ble import AirthingsBluetoothDeviceData, AirthingsDevice
from bleak_retry_connector import close_stale_connections_by_address

from homeassistant.components import bluetooth
from homeassistant.config_entries import ConfigEntry
Expand All @@ -30,20 +31,22 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
is_metric = hass.config.units is METRIC_SYSTEM
assert address is not None

await close_stale_connections_by_address(address)

ble_device = bluetooth.async_ble_device_from_address(hass, address)

if not ble_device:
raise ConfigEntryNotReady(
f"Could not find Airthings device with address {address}"
)

async def _async_update_method():
async def _async_update_method() -> AirthingsDevice:
"""Get data from Airthings BLE."""
ble_device = bluetooth.async_ble_device_from_address(hass, address)
airthings = AirthingsBluetoothDeviceData(_LOGGER, elevation, is_metric)

try:
data = await airthings.update_device(ble_device)
data = await airthings.update_device(ble_device) # type: ignore[arg-type]
except Exception as err:
raise UpdateFailed(f"Unable to fetch data: {err}") from err

Expand Down
17 changes: 11 additions & 6 deletions homeassistant/components/alarm_control_panel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.config_validation import make_entity_service_schema
from homeassistant.helpers.deprecation import (
all_with_deprecated_constants,
check_if_deprecated_constant,
dir_with_deprecated_constants,
)
Expand Down Expand Up @@ -52,12 +53,6 @@
else:
from homeassistant.backports.functools import cached_property

# As we import constants of the cost module here, we need to add the following
# functions to check for deprecated constants again
# Both can be removed if no deprecated constant are in this module anymore
__getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = partial(dir_with_deprecated_constants, module_globals=globals())

_LOGGER: Final = logging.getLogger(__name__)

SCAN_INTERVAL: Final = timedelta(seconds=30)
Expand Down Expand Up @@ -249,3 +244,13 @@ def state_attributes(self) -> dict[str, Any] | None:
ATTR_CHANGED_BY: self.changed_by,
ATTR_CODE_ARM_REQUIRED: self.code_arm_required,
}


# As we import constants of the const module here, we need to add the following
# functions to check for deprecated constants again
# These can be removed if no deprecated constant are in this module anymore
__getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = partial(
dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
)
__all__ = all_with_deprecated_constants(globals())
12 changes: 8 additions & 4 deletions homeassistant/components/alarm_control_panel/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from homeassistant.helpers.deprecation import (
DeprecatedConstantEnum,
all_with_deprecated_constants,
check_if_deprecated_constant,
dir_with_deprecated_constants,
)
Expand Down Expand Up @@ -60,14 +61,17 @@ class AlarmControlPanelEntityFeature(IntFlag):
AlarmControlPanelEntityFeature.ARM_VACATION, "2025.1"
)

# Both can be removed if no deprecated constant are in this module anymore
__getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = partial(dir_with_deprecated_constants, module_globals=globals())

CONDITION_TRIGGERED: Final = "is_triggered"
CONDITION_DISARMED: Final = "is_disarmed"
CONDITION_ARMED_HOME: Final = "is_armed_home"
CONDITION_ARMED_AWAY: Final = "is_armed_away"
CONDITION_ARMED_NIGHT: Final = "is_armed_night"
CONDITION_ARMED_VACATION: Final = "is_armed_vacation"
CONDITION_ARMED_CUSTOM_BYPASS: Final = "is_armed_custom_bypass"

# These can be removed if no deprecated constant are in this module anymore
__getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = partial(
dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
)
__all__ = all_with_deprecated_constants(globals())
13 changes: 9 additions & 4 deletions homeassistant/components/automation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.deprecation import (
DeprecatedConstant,
all_with_deprecated_constants,
check_if_deprecated_constant,
dir_with_deprecated_constants,
)
Expand Down Expand Up @@ -147,10 +148,6 @@ def __call__(self, variables: Mapping[str, Any] | None = None) -> bool:
TriggerInfo, "TriggerInfo", "2025.1"
)

# Both can be removed if no deprecated constant are in this module anymore
__getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = partial(dir_with_deprecated_constants, module_globals=globals())


@bind_hass
def is_on(hass: HomeAssistant, entity_id: str) -> bool:
Expand Down Expand Up @@ -1108,3 +1105,11 @@ def websocket_config(
"config": automation.raw_config,
},
)


# These can be removed if no deprecated constant are in this module anymore
__getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = partial(
dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
)
__all__ = all_with_deprecated_constants(globals())
13 changes: 9 additions & 4 deletions homeassistant/components/binary_sensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
)
from homeassistant.helpers.deprecation import (
DeprecatedConstantEnum,
all_with_deprecated_constants,
check_if_deprecated_constant,
dir_with_deprecated_constants,
)
Expand Down Expand Up @@ -218,10 +219,6 @@ class BinarySensorDeviceClass(StrEnum):
BinarySensorDeviceClass.WINDOW, "2025.1"
)

# Both can be removed if no deprecated constant are in this module anymore
__getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = partial(dir_with_deprecated_constants, module_globals=globals())

# mypy: disallow-any-generics


Expand Down Expand Up @@ -303,3 +300,11 @@ def state(self) -> Literal["on", "off"] | None:
if (is_on := self.is_on) is None:
return None
return STATE_ON if is_on else STATE_OFF


# These can be removed if no deprecated constant are in this module anymore
__getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = partial(
dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
)
__all__ = all_with_deprecated_constants(globals())
2 changes: 1 addition & 1 deletion homeassistant/components/bluetooth/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"bluetooth-auto-recovery==1.2.3",
"bluetooth-data-tools==1.19.0",
"dbus-fast==2.21.0",
"habluetooth==2.0.1"
"habluetooth==2.0.2"
]
}
13 changes: 9 additions & 4 deletions homeassistant/components/camera/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
)
from homeassistant.helpers.deprecation import (
DeprecatedConstantEnum,
all_with_deprecated_constants,
check_if_deprecated_constant,
dir_with_deprecated_constants,
)
Expand Down Expand Up @@ -123,10 +124,6 @@ class CameraEntityFeature(IntFlag):
CameraEntityFeature.STREAM, "2025.1"
)

# Both can be removed if no deprecated constant are in this module anymore
__getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = partial(dir_with_deprecated_constants, module_globals=globals())

RTSP_PREFIXES = {"rtsp://", "rtsps://", "rtmp://"}

DEFAULT_CONTENT_TYPE: Final = "image/jpeg"
Expand Down Expand Up @@ -1082,3 +1079,11 @@ async def async_handle_record_service(
duration=service_call.data[CONF_DURATION],
lookback=service_call.data[CONF_LOOKBACK],
)


# These can be removed if no deprecated constant are in this module anymore
__getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = partial(
dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
)
__all__ = all_with_deprecated_constants(globals())
8 changes: 6 additions & 2 deletions homeassistant/components/camera/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from homeassistant.helpers.deprecation import (
DeprecatedConstantEnum,
all_with_deprecated_constants,
check_if_deprecated_constant,
dir_with_deprecated_constants,
)
Expand Down Expand Up @@ -47,6 +48,9 @@ class StreamType(StrEnum):
_DEPRECATED_STREAM_TYPE_WEB_RTC = DeprecatedConstantEnum(StreamType.WEB_RTC, "2025.1")


# Both can be removed if no deprecated constant are in this module anymore
# These can be removed if no deprecated constant are in this module anymore
__getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = partial(dir_with_deprecated_constants, module_globals=globals())
__dir__ = partial(
dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
)
__all__ = all_with_deprecated_constants(globals())
17 changes: 11 additions & 6 deletions homeassistant/components/climate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
make_entity_service_schema,
)
from homeassistant.helpers.deprecation import (
all_with_deprecated_constants,
check_if_deprecated_constant,
dir_with_deprecated_constants,
)
Expand Down Expand Up @@ -141,12 +142,6 @@
),
)

# As we import deprecated constants from the const module, we need to add these two functions
# otherwise this module will be logged for using deprecated constants and not the custom component
# Both can be removed if no deprecated constant are in this module anymore
__getattr__ = ft.partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = ft.partial(dir_with_deprecated_constants, module_globals=globals())

# mypy: disallow-any-generics


Expand Down Expand Up @@ -734,3 +729,13 @@ async def async_service_temperature_set(
kwargs[value] = temp

await entity.async_set_temperature(**kwargs)


# As we import deprecated constants from the const module, we need to add these two functions
# otherwise this module will be logged for using deprecated constants and not the custom component
# These can be removed if no deprecated constant are in this module anymore
__getattr__ = ft.partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = ft.partial(
dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
)
__all__ = all_with_deprecated_constants(globals())
8 changes: 6 additions & 2 deletions homeassistant/components/climate/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from homeassistant.helpers.deprecation import (
DeprecatedConstantEnum,
all_with_deprecated_constants,
check_if_deprecated_constant,
dir_with_deprecated_constants,
)
Expand Down Expand Up @@ -188,6 +189,9 @@ class ClimateEntityFeature(IntFlag):
ClimateEntityFeature.AUX_HEAT, "2025.1"
)

# Both can be removed if no deprecated constant are in this module anymore
# These can be removed if no deprecated constant are in this module anymore
__getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = partial(dir_with_deprecated_constants, module_globals=globals())
__dir__ = partial(
dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
)
__all__ = all_with_deprecated_constants(globals())
17 changes: 17 additions & 0 deletions homeassistant/components/cloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from collections.abc import Awaitable, Callable
from datetime import datetime, timedelta
from enum import Enum
from typing import cast

from hass_nabucasa import Cloud
import voluptuous as vol
Expand Down Expand Up @@ -176,6 +177,22 @@ def async_active_subscription(hass: HomeAssistant) -> bool:
return async_is_logged_in(hass) and not hass.data[DOMAIN].subscription_expired


async def async_get_or_create_cloudhook(hass: HomeAssistant, webhook_id: str) -> str:
"""Get or create a cloudhook."""
if not async_is_connected(hass):
raise CloudNotConnected

if not async_is_logged_in(hass):
raise CloudNotAvailable

cloud: Cloud[CloudClient] = hass.data[DOMAIN]
cloudhooks = cloud.client.cloudhooks
if hook := cloudhooks.get(webhook_id):
return cast(str, hook["cloudhook_url"])

return await async_create_cloudhook(hass, webhook_id)


@bind_hass
async def async_create_cloudhook(hass: HomeAssistant, webhook_id: str) -> str:
"""Create a cloudhook."""
Expand Down
13 changes: 9 additions & 4 deletions homeassistant/components/cover/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
)
from homeassistant.helpers.deprecation import (
DeprecatedConstantEnum,
all_with_deprecated_constants,
check_if_deprecated_constant,
dir_with_deprecated_constants,
)
Expand Down Expand Up @@ -143,10 +144,6 @@ class CoverEntityFeature(IntFlag):
CoverEntityFeature.SET_TILT_POSITION, "2025.1"
)

# Both can be removed if no deprecated constant are in this module anymore
__getattr__ = ft.partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = ft.partial(dir_with_deprecated_constants, module_globals=globals())

ATTR_CURRENT_POSITION = "current_position"
ATTR_CURRENT_TILT_POSITION = "current_tilt_position"
ATTR_POSITION = "position"
Expand Down Expand Up @@ -493,3 +490,11 @@ def _get_toggle_function(
if self._cover_is_last_toggle_direction_open:
return fns["close"]
return fns["open"]


# These can be removed if no deprecated constant are in this module anymore
__getattr__ = ft.partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = ft.partial(
dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
)
__all__ = all_with_deprecated_constants(globals())
17 changes: 11 additions & 6 deletions homeassistant/components/device_tracker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from homeassistant.const import ATTR_GPS_ACCURACY, STATE_HOME # noqa: F401
from homeassistant.core import HomeAssistant
from homeassistant.helpers.deprecation import (
all_with_deprecated_constants,
check_if_deprecated_constant,
dir_with_deprecated_constants,
)
Expand Down Expand Up @@ -57,12 +58,6 @@
see,
)

# As we import deprecated constants from the const module, we need to add these two functions
# otherwise this module will be logged for using deprecated constants and not the custom component
# Both can be removed if no deprecated constant are in this module anymore
__getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = partial(dir_with_deprecated_constants, module_globals=globals())


@bind_hass
def is_on(hass: HomeAssistant, entity_id: str) -> bool:
Expand All @@ -83,3 +78,13 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
await async_setup_legacy_integration(hass, config)

return True


# As we import deprecated constants from the const module, we need to add these two functions
# otherwise this module will be logged for using deprecated constants and not the custom component
# These can be removed if no deprecated constant are in this module anymore
__getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = partial(
dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
)
__all__ = all_with_deprecated_constants(globals())
Loading
Loading