openhab-rules-tools icon indicating copy to clipboard operation
openhab-rules-tools copied to clipboard

Use ItemStateUpdatedEvent where ItemStateEvent was used

Open rkoshak opened this issue 2 years ago • 0 comments

With OH 4 release the new ItemStateUpdatedEvent and GroupStateUpdatedEvent were introduced and ItemStateUpdatedEvent replaced ItemStateEvent. Rule templates that do something different based on the trigger need to be updated.

rkoshak avatar Nov 13 '23 21:11 rkoshak

Did you add your middleware in settings MIDDLEWARE?

settings.py

MIDDLEWARE = [
    ...
    "inertia.middleware.InertiaMiddleware",
    "core.middleware.inertia_share",
]

dr3tt avatar Nov 05 '23 14:11 dr3tt

Thanks, will see if this works. Because I'm just seeing the second middleware ("core.middleware.inertia_share") for the first time.

fidelesq avatar Nov 06 '23 14:11 fidelesq

And I noticed that after form request using useForm() from the inertia vue the response comes like a modal containing the json as strings instead of pure json responses. Any fix for that?

fidelesq avatar Nov 06 '23 14:11 fidelesq

"core.middleware.inertia_share" throws errors

fidelesq avatar Nov 07 '23 14:11 fidelesq

"core.middleware.inertia_share" throws errors

"core" is your django app (usually you have at least one) "middleware" is your middleware python module (middleware.py) "inertia_share" is your middleware function (located inside middleware.py)

https://docs.djangoproject.com/en/4.2/topics/http/middleware/#activating-middleware

dr3tt avatar Nov 07 '23 18:11 dr3tt

Hey @Fidel-C, I don't know of any issues here and this is working fine in my apps so I suspect it's something on your end that isn't clear in the docs. Could you provide some more information about your setup?

Thanks @dr3tt for the debugging help!

BrandonShar avatar Nov 10 '23 02:11 BrandonShar