Skip to content

Commit a56bdf1

Browse files
committed
redo fix for #512; see #516
1 parent 7a81413 commit a56bdf1

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

custom_components/pyscript/event.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,4 @@ async def update(cls, event_type, func_args):
7373
_LOGGER.debug("event.update(%s, %s)", event_type, func_args)
7474
if event_type in cls.notify:
7575
for queue in cls.notify[event_type]:
76-
await queue.put(["event", func_args])
76+
await queue.put(["event", func_args.copy()])

custom_components/pyscript/mqtt.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,4 @@ async def update(cls, topic, func_args):
8888
_LOGGER.debug("mqtt.update(%s, %s, %s)", topic, vars, func_args)
8989
if topic in cls.notify:
9090
for queue in cls.notify[topic]:
91-
await queue.put(["mqtt", func_args])
91+
await queue.put(["mqtt", func_args.copy()])

custom_components/pyscript/state.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ async def update(cls, new_vars, func_args):
128128
if notify:
129129
_LOGGER.debug("state.update(%s, %s)", new_vars, func_args)
130130
for queue, var_names in notify.items():
131-
await queue.put(["state", [cls.notify_var_get(var_names, new_vars), func_args]])
131+
await queue.put(["state", [cls.notify_var_get(var_names, new_vars), func_args.copy()]])
132132

133133
@classmethod
134134
def notify_var_get(cls, var_names, new_vars):

custom_components/pyscript/trigger.py

-2
Original file line numberDiff line numberDiff line change
@@ -1061,11 +1061,9 @@ async def trigger_watch(self):
10611061
user_kwargs = {}
10621062
if state_trig_timeout:
10631063
new_vars, func_args = state_trig_notify_info
1064-
func_args = func_args.copy()
10651064
state_trig_waiting = False
10661065
elif notify_type == "state":
10671066
new_vars, func_args = notify_info
1068-
func_args = func_args.copy()
10691067
user_kwargs = self.state_trigger_kwargs.get("kwargs", {})
10701068

10711069
if not ident_any_values_changed(func_args, self.state_trig_ident_any):

0 commit comments

Comments
 (0)