mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +00:00
Uer hass.loop.create_future() for MQTT client (#100053)
This commit is contained in:
parent
05635c913f
commit
1a5f093397
@ -248,7 +248,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
|
|
||||||
client_available: asyncio.Future[bool]
|
client_available: asyncio.Future[bool]
|
||||||
if DATA_MQTT_AVAILABLE not in hass.data:
|
if DATA_MQTT_AVAILABLE not in hass.data:
|
||||||
client_available = hass.data[DATA_MQTT_AVAILABLE] = asyncio.Future()
|
client_available = hass.data[DATA_MQTT_AVAILABLE] = hass.loop.create_future()
|
||||||
else:
|
else:
|
||||||
client_available = hass.data[DATA_MQTT_AVAILABLE]
|
client_available = hass.data[DATA_MQTT_AVAILABLE]
|
||||||
|
|
||||||
|
@ -63,7 +63,9 @@ async def async_wait_for_mqtt_client(hass: HomeAssistant) -> bool:
|
|||||||
|
|
||||||
state_reached_future: asyncio.Future[bool]
|
state_reached_future: asyncio.Future[bool]
|
||||||
if DATA_MQTT_AVAILABLE not in hass.data:
|
if DATA_MQTT_AVAILABLE not in hass.data:
|
||||||
hass.data[DATA_MQTT_AVAILABLE] = state_reached_future = asyncio.Future()
|
hass.data[
|
||||||
|
DATA_MQTT_AVAILABLE
|
||||||
|
] = state_reached_future = hass.loop.create_future()
|
||||||
else:
|
else:
|
||||||
state_reached_future = hass.data[DATA_MQTT_AVAILABLE]
|
state_reached_future = hass.data[DATA_MQTT_AVAILABLE]
|
||||||
if state_reached_future.done():
|
if state_reached_future.done():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user