mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Prevent HomeKit Controller BLE connect retries from blocking startup (#80827)
This commit is contained in:
parent
423f6aeec2
commit
3df73259dd
@ -20,7 +20,7 @@ from aiohomekit.model.services import Service
|
|||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import ATTR_VIA_DEVICE
|
from homeassistant.const import ATTR_VIA_DEVICE
|
||||||
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback
|
from homeassistant.core import CALLBACK_TYPE, CoreState, HomeAssistant, callback
|
||||||
from homeassistant.helpers import device_registry as dr, entity_registry as er
|
from homeassistant.helpers import device_registry as dr, entity_registry as er
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
@ -192,8 +192,11 @@ class HKDevice:
|
|||||||
# Ideally we would know which entities we are about to add
|
# Ideally we would know which entities we are about to add
|
||||||
# so we only poll those chars but that is not possible
|
# so we only poll those chars but that is not possible
|
||||||
# yet.
|
# yet.
|
||||||
|
attempts = None if self.hass.state == CoreState.running else 1
|
||||||
try:
|
try:
|
||||||
await self.pairing.async_populate_accessories_state(force_update=True)
|
await self.pairing.async_populate_accessories_state(
|
||||||
|
force_update=True, attempts=attempts
|
||||||
|
)
|
||||||
except AccessoryNotFoundError:
|
except AccessoryNotFoundError:
|
||||||
if transport != Transport.BLE or not pairing.accessories:
|
if transport != Transport.BLE or not pairing.accessories:
|
||||||
# BLE devices may sleep and we can't force a connection
|
# BLE devices may sleep and we can't force a connection
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"name": "HomeKit Controller",
|
"name": "HomeKit Controller",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/homekit_controller",
|
"documentation": "https://www.home-assistant.io/integrations/homekit_controller",
|
||||||
"requirements": ["aiohomekit==2.2.0"],
|
"requirements": ["aiohomekit==2.2.1"],
|
||||||
"zeroconf": ["_hap._tcp.local.", "_hap._udp.local."],
|
"zeroconf": ["_hap._tcp.local.", "_hap._udp.local."],
|
||||||
"bluetooth": [{ "manufacturer_id": 76, "manufacturer_data_start": [6] }],
|
"bluetooth": [{ "manufacturer_id": 76, "manufacturer_data_start": [6] }],
|
||||||
"dependencies": ["bluetooth", "zeroconf"],
|
"dependencies": ["bluetooth", "zeroconf"],
|
||||||
|
@ -171,7 +171,7 @@ aioguardian==2022.07.0
|
|||||||
aioharmony==0.2.9
|
aioharmony==0.2.9
|
||||||
|
|
||||||
# homeassistant.components.homekit_controller
|
# homeassistant.components.homekit_controller
|
||||||
aiohomekit==2.2.0
|
aiohomekit==2.2.1
|
||||||
|
|
||||||
# homeassistant.components.emulated_hue
|
# homeassistant.components.emulated_hue
|
||||||
# homeassistant.components.http
|
# homeassistant.components.http
|
||||||
|
@ -155,7 +155,7 @@ aioguardian==2022.07.0
|
|||||||
aioharmony==0.2.9
|
aioharmony==0.2.9
|
||||||
|
|
||||||
# homeassistant.components.homekit_controller
|
# homeassistant.components.homekit_controller
|
||||||
aiohomekit==2.2.0
|
aiohomekit==2.2.1
|
||||||
|
|
||||||
# homeassistant.components.emulated_hue
|
# homeassistant.components.emulated_hue
|
||||||
# homeassistant.components.http
|
# homeassistant.components.http
|
||||||
|
Loading…
x
Reference in New Issue
Block a user