mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 22:07:10 +00:00
Speed up connecting to ESPHome devices (#104018)
This commit is contained in:
parent
7803ca2612
commit
3f11bb5f62
@ -1,6 +1,7 @@
|
|||||||
"""Manager for esphome devices."""
|
"""Manager for esphome devices."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
from typing import TYPE_CHECKING, Any, NamedTuple
|
from typing import TYPE_CHECKING, Any, NamedTuple
|
||||||
|
|
||||||
@ -454,9 +455,11 @@ class ESPHomeManager:
|
|||||||
hass, entry, entity_infos, device_info.mac_address
|
hass, entry, entity_infos, device_info.mac_address
|
||||||
)
|
)
|
||||||
await _setup_services(hass, entry_data, services)
|
await _setup_services(hass, entry_data, services)
|
||||||
await cli.subscribe_states(entry_data.async_update_state)
|
await asyncio.gather(
|
||||||
await cli.subscribe_service_calls(self.async_on_service_call)
|
cli.subscribe_states(entry_data.async_update_state),
|
||||||
await cli.subscribe_home_assistant_states(self.async_on_state_subscription)
|
cli.subscribe_service_calls(self.async_on_service_call),
|
||||||
|
cli.subscribe_home_assistant_states(self.async_on_state_subscription),
|
||||||
|
)
|
||||||
|
|
||||||
if device_info.voice_assistant_version:
|
if device_info.voice_assistant_version:
|
||||||
entry_data.disconnect_callbacks.append(
|
entry_data.disconnect_callbacks.append(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user