-
-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add topic filter for event WebSocket #4550
Conversation
Signed-off-by: Florian Hotze <dev@florianhotze.com>
Signed-off-by: Florian Hotze <dev@florianhotze.com>
e01f161
to
636ba6f
Compare
Depends on openhab/openhab-core#4550. Signed-off-by: Florian Hotze <dev@florianhotze.com>
@ghys We are getting close to have the event WS support everything we need in the UI 🚀 |
Would it be possible to provide a negative and positive filter here, too? |
Added just a few seconds ago 👍 |
Signed-off-by: Florian Hotze <dev@florianhotze.com>
b7f417c
to
aa92411
Compare
Is the topic not a regular expression? Is it something openhab specific? |
Topics can be defined as string with the * wildcard, see SSE events. |
I don‘t think that the additional regex features would be a benefit here, I think the wildcard is enough. |
But why use an custom openhab wildcard implementation which then gets internally converted into regex instead of just allowing a regex from the start instead? |
It makes the filters easier to use from clients though, as you can simply specify the topic with wildcards and don't need to take care of the RegEx. |
I still think directly exposing the regex is a much better idea. The wildcard implementation already confused me because I thought If the goal is still to provide a simple topic matching mechanism then we should use the mqtt matching mechanism with |
@openhab/core-maintainers What is your opinion here? The current implementation is easier to consume, especially when migrating from SSE to WS, as it works the same way it did for SSE for years. |
There will be no migration issue. One could provide an example in the docs how to migrate from sse to websocket filter by just showing that instead of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say this issue is about porting the existing functionality from SSE over to WebSockets - so this PR is fine and imho can be merged.
The discussion about RegEx is independent of this. Whether that makes sense or not is debatable. My personal feeling is that RegEx is not typically used in the web, possibly due to its tendency to become very complex and as it is difficult to read. I would therefore also prefer keep things simple. But @spacemanspiff2007, please feel free to create an issue on this and if there are good reasons why RegEx would improve the usability/flexibility, this can certainly be considered.
I agree with @kaikreuzer |
Refs openhab/openhab-core#4550. Signed-off-by: Florian Hotze <dev@florianhotze.com>
* Add WebSocket topic filter docs Refs openhab/openhab-core#4550. Signed-off-by: Florian Hotze <dev@florianhotze.com> * Minor rewording Signed-off-by: Florian Hotze <dev@florianhotze.com> --------- Signed-off-by: Florian Hotze <dev@florianhotze.com>
Closes #4549.
Closes #3764.
The topic filter can be configured by sending a WS message like in following examples:
Only send all ItemCommandEvents:
Only send all ItemCommandEvents, except for the
test
Item:Send all events, except ItemCommandEvents: