Update autoexecExamples.md

This commit is contained in:
Tester23
2024-01-28 12:34:02 +01:00
parent 3b8136a5e5
commit 3e0e321a01

View File

@ -453,6 +453,36 @@ publish myVariable 2022
```
WaitFor advanced syntax.
<br>
```
// Waitfor syntax samples
// WaitFor can support following operators:
// - no operator (default, it means equals)
// - operator < (less)
// - operator > (more)
// - operator ! (not requal)
// default usage - wait for NoPingTime to reach exact value 100
waitFor NoPingTime 100
// extra operator - wait for NoPingTime to become less than 100
// (this will be triggered anytime variable changes to value less than 100)
waitFor NoPingTime < 100
// extra operator - wait for NoPingTime to become more than 100
// (this will be triggered anytime variable changes to value more than 100)
waitFor NoPingTime > 100
// extra operator - wait for NoPingTime to become different than 100
// (this will be triggered anytime variable changes to value other than 100)
waitFor NoPingTime ! 100
```
This script will use NTP and 'addClockEvent' to change light styles in the morning and in the evening. Here you can see how 'waitFor NTPState 1' and 'addClockEvent' and $hour script functions/variables are used.
<br>
```