LisaM wrote: ↑22 Oct 2017, 12:55
BertB wrote: ↑22 Oct 2017, 09:40
Thank you LisaM.
Do you think there will be room for something as easy as Rules?
I can imagine scripting is much more powerfull, but it looks like learning a new complex-ish language.
How about an example script that resembles the old rules script as close as possible? It will basically act as a template for rule based scripting, simple but leaving the option open of making it complex. Will something like that help you?
For example this old rule part:
will be turned into this:
Scripts have grown to become almost normal, but changeable, micropython programs. Despite it's great benefit, everything is now possible with scripts, it has a big downside: you'll need to program Python.
So... i've kept Scripts, but re-introduced rules.
Rule example:
Code: Select all
if event['test#temperature'] > 15 :
gpio('d12',1)
event['timer1'] = 60 # seconds
Code: Select all
if turnon:
gpio('d12',1)
event['timer1'] = 60 # seconds
Since rules are way slower then scripts, i'm limiting it to one code block per file and each code block must still be correct Python. That will save some performance, since each file can then be parsed on demand instead of all of them.
Is that still exceptable?