for persistence I use MAPDB
working on a sitemap to keep settings (start and end time to turning on/off lightsbulbs)
What I have:
a sitemap with virtual items endhour, endminute (setpoint item=v_start_hour label:"…)
a virtual switch item visibility ON when it’s value is ON and mappings=[ON=“Save”]
When endhour or endminute changes, I do a postupdate of that switch item to ON, so it becomes visible.
When I click on the virtual switch, I postupdate the virtual switch to OFF, so it disappears again.
so far so good.
What I would like to achieve :
only when I click on the virtual switch, save the values of the endhour and endminute (persistent)
so, when I change the endhour or endminute, and go away of the settings page, wthout clicking virtual switch, i shouldn’t be saved…
How can I do that ? Can anyone show me the way or are there some similar examples?