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
Autotimer: clarification and feature request #160
Comments
When
However, if |
We should add But poeple seem to use a value which is actually not allowed for the triggered item and use the value from the source item (which could be a string item) to update the destination item (which could be a bool item) by (explicitly) "converting" the value manually or (implicitly) automatically by Python in the eval expression. So changing this could lead to problem with these users since the convert may be different with this patch. Nontheless, I would cast the value to the target item's type as mentioned above. Usually this explicit conversation should work like the implicit conversation. Only users using completely different values which can not be converted (e.g. a dict item to bool item) or doing some manually converting (e.g. extract information from a string value and use this for the target value) will have really problems. So:
To only fix the issue in relation to autotimer setting (which will currently use string values) we could add a cast when reading the autotime value and throw exception or a log message in case the conversion failed. But this make it impossible to use other values like text strings (containing some more meta infromation) for bool or num items. To clarify, some examples:
|
It is obvious that the value autotimer gives back to the calling item needs to be of the same type as the item is. A conversion function which does this automatically would give a great benefit and simplify usage for everybody. Example:
It should be very clear for any kind of user that item and item.value need to be of the same type then. |
Being able to use items for the autotimer would be awesome indeed. By the way - there is also one major problem with the current autotimer. |
I vote for converting the value to the item's type. In case that someone really needs an However, there should be a unique solution for |
I am working on the 'casting' issue for For the time beeing |
Kannst du das bitte in einem separaten branch implementieren. Danke |
I have been able to fix the 'casting' issue for |
Implemented for Version 1.3 and documented in wiki. |
In some cases the attribute
autotimer = 5m = 0
is not working correctly. There are discussions in the forum that the values behind autotimer are casted as string, e.g. here .
We have tested other applications where the attribute mentioned above works as expected.
Request:
the feature should be checked and/or documentation should be improved to clarify the influence of type specifications for items with autotimer - see here .
A new feature request is to give autotimer the ability to evaluate time and value parameters from items, e.g.
autotimer = sh.item1.time() = sh.item1.level()
This would add great flexibility to timers and make them controllable via visu.
Thanks Wolfram
The text was updated successfully, but these errors were encountered: