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
Subscribe by Regex with option 'Do not subscribe all states on start' #1401
Comments
Mal unabhängig vom issue ... dir ist klar das man zb "." in Regex escapen muss? Was du dfa hast ist eher ein "Pattern" und weniger eine regex ... |
I understand. Just an example |
Is there a suggested workaround for this issue? Iterate all states by using $[...], registering a single callback for each of the matches? |
Okay, a practical solution is the following code:
As soon as this is added, more complicated regular expressions also work - as long as they are covered by the wildcard in the workaround. So the problem might be due to js-controller not being able to work with regular expressions? |
I think this is related to #525 The problem is, that the subscribeForeignState function doesn't support regular expressions. ioBroker.javascript/lib/sandbox.js Line 74 in 3a87abf
|
Thats indeed completely right. So easiest solution is to "throw" an error if someone tries to subscribe regex when not all states are subscribed. In fact my main question would by why someone turned off the auto subscription ... this is "advanced feature" in my eyes which should be only used well-thought. The alterative is very meehhh because it would require to somehow "convert" the given regex pattern into a "iobroker wildcard pattern string" (kind of only "*" and "?" allowed) ... |
Describe the bug
Not receiving messages after subscribing with regex. Option 'Do not subscribe all states on start' is true.
Similar to issue #1311
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Messages are coming.
Versions:
The text was updated successfully, but these errors were encountered: