mirror of
https://github.com/home-assistant/core.git
synced 2025-04-27 02:37:50 +00:00
Await service calls in emulated_hue instead of making them blocking (#111674)
This commit is contained in:
parent
105a1ca127
commit
2b19783311
@ -586,21 +586,17 @@ class HueOneLightChangeView(HomeAssistantView):
|
|||||||
|
|
||||||
# Separate call to turn on needed
|
# Separate call to turn on needed
|
||||||
if turn_on_needed:
|
if turn_on_needed:
|
||||||
hass.async_create_task(
|
await hass.services.async_call(
|
||||||
hass.services.async_call(
|
core.DOMAIN,
|
||||||
core.DOMAIN,
|
SERVICE_TURN_ON,
|
||||||
SERVICE_TURN_ON,
|
{ATTR_ENTITY_ID: entity_id},
|
||||||
{ATTR_ENTITY_ID: entity_id},
|
blocking=False,
|
||||||
blocking=True,
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if service is not None:
|
if service is not None:
|
||||||
state_will_change = parsed[STATE_ON] != _hass_to_hue_state(entity)
|
state_will_change = parsed[STATE_ON] != _hass_to_hue_state(entity)
|
||||||
|
|
||||||
hass.async_create_task(
|
await hass.services.async_call(domain, service, data, blocking=False)
|
||||||
hass.services.async_call(domain, service, data, blocking=True)
|
|
||||||
)
|
|
||||||
|
|
||||||
if state_will_change:
|
if state_will_change:
|
||||||
# Wait for the state to change.
|
# Wait for the state to change.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user