Backup/restore object values with storage.set/get? - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: Backup/restore object values with storage.set/get? (/showthread.php?tid=3571) |
Backup/restore object values with storage.set/get? - morkovka - 21.09.2021 Hi, I have a script which runs some logic for a scene (e.g. dim the lights, set color X for RGB, etc.) - but before running it, I want to be able to provide a list of group addresses to 'backup', and then to 'restore' them after the scene finishes - can anybody help with this? E.g. if we have: Code: backuplist = { '1/1/1', '2/2/2' } The group addresses will have different value types (boolean, percentage, int, etc.). I'm not sure how to best implement the save_values() and load_values() functions - any ideas? RE: Backup/restore object values with storage.set/get? - admin - 21.09.2021 If this is inside a single script you don't need to use storage at all. Code: backuplist = { '1/1/1', '1/1/2' } RE: Backup/restore object values with storage.set/get? - morkovka - 21.09.2021 Thanks, this is very helpful. I am using an event script, sometimes it's called with value 'on' and sometimes 'off' - in this case, I assumed I'll need to store the backuplist in storage, is something like the below the correct approach? Code: backuplist = { '1/1/1', '1/1/2' } |