custom-components / pyscript

Pyscript adds rich Python scripting to HASS
Apache License 2.0
874 stars 46 forks source link

@event_trigger decorator with 3 arguments #519

Closed marshalltech81 closed 1 year ago

marshalltech81 commented 1 year ago

Following the documentation https://hacs-pyscript.readthedocs.io/en/latest/reference.html#event-trigger, it looks like the @event_decorator trigger accepts up to 3 arguments where the 3rd argument is the kwarg. However in attempting to do this, I receive an error that states decorator @event_trigger got 3 arguments, expected 1 or 2.

craigbarratt commented 1 year ago

Fixed with 8b3f4d8. Workaround prior to this fix is to specify it as a keyword argument.