You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi.
When calling a pyscript function/service from lovelace with data, pyscript errors at:
File "/config/custom_components/pyscript/eval.py", line 716, in call
raise TypeError(f"{self.name}() called with unexpected keyword arguments: {unexpected}")
TypeError: my_function_name() called with unexpected keyword arguments: 0
I think I've tracked down the problem.
If I append **kwargs to the parameter list for my function, the function/service call succeeds.
Line 716 seems to error because it requires that the user function has parameters for:
{'trigger_type': 'service', 'context': <homeassistant.core.Context object at 0x7f99122f70>}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi.
When calling a pyscript function/service from lovelace with data, pyscript errors at:
File "/config/custom_components/pyscript/eval.py", line 716, in call
raise TypeError(f"{self.name}() called with unexpected keyword arguments: {unexpected}")
TypeError: my_function_name() called with unexpected keyword arguments: 0
I think I've tracked down the problem.
If I append **kwargs to the parameter list for my function, the function/service call succeeds.
Line 716 seems to error because it requires that the user function has parameters for:
{'trigger_type': 'service', 'context': <homeassistant.core.Context object at 0x7f99122f70>}
Thanks,
David
Beta Was this translation helpful? Give feedback.
All reactions