Add recent context (#15989)
* Add recent context * Add async_set_context to components not using new services
This commit is contained in:
1 parent
d1e1b9b38a
commit
1be61df9c0
11 files changed
+211
-11
No files matched your search
@@ -111,6 +111,7 @@ def async_setup(hass, config):
|
||||
|
||||
for alert_id in alert_ids:
|
||||
alert = all_alerts[alert_id]
|
||||
alert.async_set_context(service_call.context)
|
||||
if service_call.service == SERVICE_TURN_ON:
|
||||
yield from alert.async_turn_on()
|
||||
elif service_call.service == SERVICE_TOGGLE:
|
||||
|
||||
@@ -345,6 +345,8 @@ async def async_setup(hass, config):
|
||||
|
||||
update_tasks = []
|
||||
for light in target_lights:
|
||||
light.async_set_context(service.context)
|
||||
|
||||
pars = params
|
||||
if not pars:
|
||||
pars = params.copy()
|
||||
@@ -356,7 +358,7 @@ async def async_setup(hass, config):
|
||||
continue
|
||||
|
||||
update_tasks.append(
|
||||
light.async_update_ha_state(True, service.context))
|
||||
light.async_update_ha_state(True))
|
||||
|
||||
if update_tasks:
|
||||
await asyncio.wait(update_tasks, loop=hass.loop)
|
||||
|
||||
Reference in new issue
Block a user