mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-27 20:34:20 +02:00
Fix causal context links for intercepted calls (#1559)
This commit is contained in:
parent
9525d2f243
commit
1f137d2b36
2 changed files with 110 additions and 6 deletions
|
|
@ -2119,7 +2119,7 @@ class AdaptiveLightingManager:
|
|||
|
||||
for eid in _entity_ids:
|
||||
# Must add a new context otherwise _adapt_light will bail out
|
||||
context = switch.create_context("intercept")
|
||||
context = switch.create_context("intercept", parent=call.context)
|
||||
self.clear_proactively_adapting(eid)
|
||||
self.set_proactively_adapting(context.id, eid)
|
||||
_LOGGER.debug(
|
||||
|
|
@ -2140,7 +2140,7 @@ class AdaptiveLightingManager:
|
|||
assert set(skipped) == set(entity_ids)
|
||||
return # The call will be intercepted with the original data
|
||||
# Call light turn_on service for skipped entities
|
||||
context = self.create_context("skipped")
|
||||
context = self.create_context("skipped", parent=call.context)
|
||||
_LOGGER.debug(
|
||||
"(5) _service_interceptor_turn_on_handler: calling `light.turn_on` with skipped='%s', service_data: '%s', context='%s'",
|
||||
skipped,
|
||||
|
|
@ -2180,6 +2180,7 @@ class AdaptiveLightingManager:
|
|||
adaptation_data = await switch.prepare_adaptation_data(
|
||||
entity_ids[0],
|
||||
transition,
|
||||
context=switch.create_context("adapt_lights", parent=call.context),
|
||||
)
|
||||
if adaptation_data is None:
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue