You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: tutorials/getting_started/rules_advanced.md
+4
Original file line number
Diff line number
Diff line change
@@ -170,6 +170,10 @@ Also notice a line was added to `lightsOut` to delete the entry in the `cache` w
170
170
That will cause the rule to create a new timer the next time the rule runs.
171
171
It could be coded to reuse the Timer instead which is an exercise for the reader.
172
172
173
+
Another benefit of saving the timer in the `cache` is that it will be cancelled when the last script that references the cache is unloaded or reloaded.
174
+
This will prevent the timer from executing after the original script had been removed or reloaded.
175
+
Care must still be taken within the timer function not to reschedule itself if it has been cancelled.
176
+
173
177
Save and test that the rule sends the on and off commands as described.
0 commit comments