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
[Rules] Improve rules matching (#2660) #2667
[Rules] Improve rules matching (#2660) #2667
Conversation
Detecting time compare and value compare could give false matches in some cases.
PlatformIO 4.0.x does have issues with non-ASCII characters in files. Even if they are part of comments.
…#2676) See letscontrolit#2676 The use of DeviceIndex was not consistent, which may lead to strange issues. DeviceIndex is the translation between the vector of included plugins and IDs of plugins available.
When using settings containing configuration for a certain plugin which is not included in the actual build, then the plugin must be displayed as "not supported" and not possible to edit. Also show some indication about the consequences of trying to edit such a task. It will then present a dialog equal to adding a new device to a task.
Some structs like controller queue elements had their members not sorted to size. This may result in more memory usage than needed.
…#2660) The changed rules parsing may have added some spaces in replaced variables. Adding a trim() call to the parseString does remove any existing or added spaces in the parameter.
The ESP could sometimes experience a crash when saving the rules. This was caused mainly on fragmented file systems and a bit longer rules files. Now the same saveToFile function is used as being used in all other settings file access. Also the rules were copied in memory, which is useless since they are already present in memory (LWIP code) and passed by const reference.
If I understand correctly, Rules still chekc only for the first occurence of a specifig task name and then if the value in the rule is in this task. Therefore it's not possible to have multiple tasks with the same name to be used in rules. Would'nt it be more logical (and quite easy to solve) if the rules would continue to search for a task with the same name if in the first (previous) occurence no value name that matches is found. As an example: I would want all possible systemvalues in one common "taskname" (for some controllers this means "the same device") eg. sysinfo but as I'm limited to 4 per task I need multiple tasks for all values. Same for dummy-values. However I can't use them anymore in Rules hen, as only the first occurence is checked.. Just a question/suggestion |
A lot of code does make the assumption a task name is unique. The variable names in a task may also be re-used for other tasks. For example:
It just does not make sense to have multiple tasks with the same name. |
Yep, this is also what I would expect, so it would cover all cases...
hmm.. I think this is POV thing. for me it's totally reasonable... eg. if I need more than 4 dummy vars, why should I identify them via task-name and not via variable name (from hierarchical POV it just makes more sense)... But again IMHO and I can live with how it's now... as long as it's only a "warning" and no restirction. it's then just not possible to use a variable in a task with duplicat name (in rules)... |
Like I said, if you need it for administrative purposes in a controller to set the MQTT topic for example, we may need to have the plugin ID resolved in the controller. I'm not 100% sure if we can also match an event on only the task name. |
hmm.. but in the rules when you check for |
Hmm if that's true, then that is a bug.
Still, the asterisk could give the false impression on which plugin was updated and you will then use a variable from another plugin which was not yet updated. |
I always check for Eg: if I have 2 tasks witch are called |
Ah OK, I get it. Maybe you can add an issue for it so we can continue the discussion there instead of at the comments section of a pull request which will be merged one day :) |
…tscontrolit#2650) See letscontrolit#2650. As long as a client is connected to the node in AP mode, no automatic reconnect should be attempted since it will make it very hard to get connected or remain connected to the AP mode. The WiFi channel will change during scan which will disconnect the user.
…rolit#2650) See letscontrolit#2650 The counter wifi_connect_attempt is being used to determine whether the fallback SSID should be tried. It is also used to determine whether a "quick reconnect" is possible using the BSSID and channel of the last successful connection. If the connection is unstable, (last connection was active for over 5 minutes) then the connect attempt counter can be reset.
To be used for the static analysis tools of PlatformIO. See [announcement PIO Home 3.0 beta](https://community.platformio.org/t/platformio-home-3-0-beta-and-powerful-project-inspection/10187?utm_source=platformio&utm_medium=piohome)
Detecting time compare and value compare could give false matches in some cases.
This PR also incorporates a number of other changes:
Fixes: #2683 - Duplicated section in
platformio.ini
Fixes: #2681 - sendtohttp malformed request
Fixes: #2660 - json update of Domoticz does not work anymore
Fixes: #2676 - Bug in determine index of Plugin_ptr
Fixes: #2670 - Build error P089
Fixes: #2655 - [int#1] does add a leading space in rules
Fixes: #2650 - AP Mode not working when WIFISSID is set
Fixes: #2686 - Argument parsing does not use a single function
Fixes: #2657 - [Rules] Parsing of [task#var] syntax changed since 20190928