Skip to content

Commit a065403

Browse files
dlashuaraman325
authored andcommitted
triggers always produce a Context()
If triggers don't produce a context to be reused by later calls (even when there isn't one incoming) then actions taken based on, for instance, time_trigger, are not attributed to a pyscript.
1 parent e4c7935 commit a065403

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

custom_components/pyscript/trigger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ async def trigger_watch(self):
831831
if "context" in func_args and isinstance(func_args["context"], Context):
832832
hass_context = Context(parent_id=func_args["context"].id)
833833
else:
834-
hass_context = None
834+
hass_context = Context()
835835

836836
# Fire an event indicating that pyscript is running
837837
# Note: the event must have an entity_id for logbook to work correctly.

0 commit comments

Comments
 (0)