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.5.1 #116696

Merged
merged 23 commits into from
May 3, 2024
Merged

2024.5.1 #116696

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4e4ac79
Fix nws forecast coordinators and remove legacy forecast handling (#1…
MatthewFlamm May 3, 2024
624e4a2
Bump opentherm_gw to 2.2.0 (#116527)
GraceGRD May 1, 2024
49de594
Add a lock to homekit_controller platform loads (#116539)
bdraco May 2, 2024
ea6a9b8
Fix MQTT discovery cooldown too short with large setup (#116550)
jbouwh May 1, 2024
5da6f83
Bump upb_lib to 0.5.6 (#116558)
gwww May 1, 2024
6583906
Bump elkm1_lib to 2.2.7 (#116564)
gwww May 2, 2024
523de94
Fix Matter startup when Matter bridge is present (#116569)
marcelveldt May 3, 2024
99ab8d2
Bump sanix to 1.0.6 (#116570)
tomaszsluszniak May 1, 2024
fabbe2f
Fix Airthings BLE model names (#116579)
LaStrada May 2, 2024
0e488ef
Improve coordinator in Ondilo ico (#116596)
joostlek May 2, 2024
575a3da
Fix inheritance order for KNX notify (#116600)
farmio May 2, 2024
7c1502f
Bump Airthings BLE to 0.8.0 (#116616)
LaStrada May 2, 2024
8193b82
Bump pywaze to 1.0.1 (#116621)
eifinger May 2, 2024
c338f1b
Add constraint for tuf (#116627)
cdce8p May 2, 2024
6be25c7
Bump aiounifi to v77 (#116639)
Kane610 May 2, 2024
c36fd55
Bump govee-light-local library and fix wrong information for Govee li…
Galorhallen May 3, 2024
abeb65e
Bump ZHA dependency bellows to 0.38.4 (#116660)
puddly May 3, 2024
ac302f3
Bump habluetooth to 2.8.1 (#116661)
bdraco May 2, 2024
66bb3ec
Bump env_canada lib to 0.6.2 (#116662)
gwww May 2, 2024
7a56ba1
Block dreame_vacuum versions older than 1.0.4 (#116673)
bdraco May 3, 2024
a4f9a64
Fix fyta test timezone handling (#116689)
cdce8p May 3, 2024
7e8cbaf
Fix BroadlinkRemote._learn_command() (#116692)
felipediel May 3, 2024
9d2fd82
Bump version to 2024.5.1
frenck May 3, 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 .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,7 @@ omit =
homeassistant/components/omnilogic/switch.py
homeassistant/components/ondilo_ico/__init__.py
homeassistant/components/ondilo_ico/api.py
homeassistant/components/ondilo_ico/coordinator.py
homeassistant/components/ondilo_ico/sensor.py
homeassistant/components/onkyo/media_player.py
homeassistant/components/onvif/__init__.py
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/airthings_ble/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
"dependencies": ["bluetooth_adapters"],
"documentation": "https://www.home-assistant.io/integrations/airthings_ble",
"iot_class": "local_polling",
"requirements": ["airthings-ble==0.7.1"]
"requirements": ["airthings-ble==0.8.0"]
}
2 changes: 1 addition & 1 deletion homeassistant/components/airthings_ble/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def __init__(
manufacturer=airthings_device.manufacturer,
hw_version=airthings_device.hw_version,
sw_version=airthings_device.sw_version,
model=airthings_device.model.name,
model=airthings_device.model.product_name,
)

@property
Expand Down
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.4.2",
"bluetooth-data-tools==1.19.0",
"dbus-fast==2.21.1",
"habluetooth==2.8.0"
"habluetooth==2.8.1"
]
}
7 changes: 5 additions & 2 deletions homeassistant/components/broadlink/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,11 @@ async def _async_learn_rf_command(self, command):
start_time = dt_util.utcnow()
while (dt_util.utcnow() - start_time) < LEARNING_TIMEOUT:
await asyncio.sleep(1)
found = await device.async_request(device.api.check_frequency)[0]
if found:
is_found, frequency = await device.async_request(
device.api.check_frequency
)
if is_found:
_LOGGER.info("Radiofrequency detected: %s MHz", frequency)
break
else:
await device.async_request(device.api.cancel_sweep_frequency)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/elkm1/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"documentation": "https://www.home-assistant.io/integrations/elkm1",
"iot_class": "local_push",
"loggers": ["elkm1_lib"],
"requirements": ["elkm1-lib==2.2.6"]
"requirements": ["elkm1-lib==2.2.7"]
}
2 changes: 1 addition & 1 deletion homeassistant/components/environment_canada/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/environment_canada",
"iot_class": "cloud_polling",
"loggers": ["env_canada"],
"requirements": ["env-canada==0.6.0"]
"requirements": ["env-canada==0.6.2"]
}
4 changes: 2 additions & 2 deletions homeassistant/components/govee_light_local/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC, DeviceInfo
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity

Expand Down Expand Up @@ -94,7 +94,7 @@ def __init__(
name=device.sku,
manufacturer=MANUFACTURER,
model=device.sku,
connections={(CONNECTION_NETWORK_MAC, device.fingerprint)},
serial_number=device.fingerprint,
)

@property
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/govee_light_local/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"dependencies": ["network"],
"documentation": "https://www.home-assistant.io/integrations/govee_light_local",
"iot_class": "local_push",
"requirements": ["govee-local-api==1.4.4"]
"requirements": ["govee-local-api==1.4.5"]
}
32 changes: 18 additions & 14 deletions homeassistant/components/homekit_controller/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def __init__(
self._subscriptions: dict[tuple[int, int], set[CALLBACK_TYPE]] = {}
self._pending_subscribes: set[tuple[int, int]] = set()
self._subscribe_timer: CALLBACK_TYPE | None = None
self._load_platforms_lock = asyncio.Lock()

@property
def entity_map(self) -> Accessories:
Expand Down Expand Up @@ -327,7 +328,8 @@ async def async_setup(self) -> None:
)
# BLE devices always get an RSSI sensor as well
if "sensor" not in self.platforms:
await self._async_load_platforms({"sensor"})
async with self._load_platforms_lock:
await self._async_load_platforms({"sensor"})

@callback
def _async_start_polling(self) -> None:
Expand Down Expand Up @@ -804,6 +806,7 @@ def _add_new_entities(self, callbacks: list[AddServiceCb]) -> None:

async def _async_load_platforms(self, platforms: set[str]) -> None:
"""Load a group of platforms."""
assert self._load_platforms_lock.locked(), "Must be called with lock held"
if not (to_load := platforms - self.platforms):
return
self.platforms.update(to_load)
Expand All @@ -813,22 +816,23 @@ async def _async_load_platforms(self, platforms: set[str]) -> None:

async def async_load_platforms(self) -> None:
"""Load any platforms needed by this HomeKit device."""
to_load: set[str] = set()
for accessory in self.entity_map.accessories:
for service in accessory.services:
if service.type in HOMEKIT_ACCESSORY_DISPATCH:
platform = HOMEKIT_ACCESSORY_DISPATCH[service.type]
if platform not in self.platforms:
to_load.add(platform)

for char in service.characteristics:
if char.type in CHARACTERISTIC_PLATFORMS:
platform = CHARACTERISTIC_PLATFORMS[char.type]
async with self._load_platforms_lock:
to_load: set[str] = set()
for accessory in self.entity_map.accessories:
for service in accessory.services:
if service.type in HOMEKIT_ACCESSORY_DISPATCH:
platform = HOMEKIT_ACCESSORY_DISPATCH[service.type]
if platform not in self.platforms:
to_load.add(platform)

if to_load:
await self._async_load_platforms(to_load)
for char in service.characteristics:
if char.type in CHARACTERISTIC_PLATFORMS:
platform = CHARACTERISTIC_PLATFORMS[char.type]
if platform not in self.platforms:
to_load.add(platform)

if to_load:
await self._async_load_platforms(to_load)

@callback
def async_update_available_state(self, *_: Any) -> None:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/knx/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _create_notification_instance(xknx: XKNX, config: ConfigType) -> XknxNotific
)


class KNXNotify(NotifyEntity, KnxEntity):
class KNXNotify(KnxEntity, NotifyEntity):
"""Representation of a KNX notification entity."""

_device: XknxNotification
Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/matter/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@
def _check_transition_blocklist(self) -> None:
"""Check if this device is reported to have non working transitions."""
device_info = self._endpoint.device_info
if isinstance(device_info, clusters.BridgedDeviceBasicInformation):
return

Check warning on line 402 in homeassistant/components/matter/light.py

View check run for this annotation

Codecov / codecov/patch

homeassistant/components/matter/light.py#L402

Added line #L402 was not covered by tests
if (
device_info.vendorID,
device_info.productID,
Expand Down
16 changes: 12 additions & 4 deletions homeassistant/components/mqtt/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

_LOGGER = logging.getLogger(__name__)

DISCOVERY_COOLDOWN = 2
DISCOVERY_COOLDOWN = 5
INITIAL_SUBSCRIBE_COOLDOWN = 1.0
SUBSCRIBE_COOLDOWN = 0.1
UNSUBSCRIBE_COOLDOWN = 0.1
Expand Down Expand Up @@ -349,6 +349,12 @@ def _async_execute(self) -> None:
self._task = create_eager_task(self._async_job())
self._task.add_done_callback(self._async_task_done)

async def async_fire(self) -> None:
"""Execute the job immediately."""
if self._task:
await self._task
self._async_execute()

@callback
def _async_cancel_timer(self) -> None:
"""Cancel any pending task."""
Expand Down Expand Up @@ -846,7 +852,7 @@ async def _async_perform_subscriptions(self) -> None:

for topic, qos in subscriptions.items():
_LOGGER.debug("Subscribing to %s, mid: %s, qos: %s", topic, mid, qos)
self._last_subscribe = time.time()
self._last_subscribe = time.monotonic()

if result == 0:
await self._wait_for_mid(mid)
Expand Down Expand Up @@ -876,6 +882,8 @@ async def _async_resubscribe_and_publish_birth_message(
await self._ha_started.wait() # Wait for Home Assistant to start
await self._discovery_cooldown() # Wait for MQTT discovery to cool down
# Update subscribe cooldown period to a shorter time
# and make sure we flush the debouncer
await self._subscribe_debouncer.async_fire()
self._subscribe_debouncer.set_timeout(SUBSCRIBE_COOLDOWN)
await self.async_publish(
topic=birth_message.topic,
Expand Down Expand Up @@ -1121,7 +1129,7 @@ async def _wait_for_mid(self, mid: int) -> None:

async def _discovery_cooldown(self) -> None:
"""Wait until all discovery and subscriptions are processed."""
now = time.time()
now = time.monotonic()
# Reset discovery and subscribe cooldowns
self._mqtt_data.last_discovery = now
self._last_subscribe = now
Expand All @@ -1133,7 +1141,7 @@ async def _discovery_cooldown(self) -> None:
)
while now < wait_until:
await asyncio.sleep(wait_until - now)
now = time.time()
now = time.monotonic()
last_discovery = self._mqtt_data.last_discovery
last_subscribe = (
now if self._pending_subscriptions else self._last_subscribe
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/mqtt/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ async def _async_component_setup(discovery_payload: MQTTDiscoveryPayload) -> Non
@callback
def async_discovery_message_received(msg: ReceiveMessage) -> None: # noqa: C901
"""Process the received message."""
mqtt_data.last_discovery = time.time()
mqtt_data.last_discovery = time.monotonic()
payload = msg.payload
topic = msg.topic
topic_trimmed = topic.replace(f"{discovery_topic}/", "", 1)
Expand Down Expand Up @@ -370,7 +370,7 @@ def discovery_done(_: Any) -> None:
)
)

mqtt_data.last_discovery = time.time()
mqtt_data.last_discovery = time.monotonic()
mqtt_integrations = await async_get_mqtt(hass)

for integration, topics in mqtt_integrations.items():
Expand Down
Loading