mirror of https://github.com/arendst/Tasmota.git
Updated Scripting Language (markdown)
parent
85a0312e0e
commit
949a071eff
|
@ -24,6 +24,7 @@ SDCARD_DIR | enables support for web UI for SD card directory upload and downloa
|
|||
USE_24C256 | enables use of 24C256 I<sup>2</sup>C EEPROM to expand script buffer (defaults to 4k)
|
||||
SUPPORT_MQTT_EVENT | enables support for subscribe unsubscribe
|
||||
USE_TOUCH_BUTTONS | enable virtual touch button support with touch displays
|
||||
USE_WEBSEND_RESPONSE | enable receiving the response of a websend command (received in section E)
|
||||
|
||||
<BR><BR>To enter a script, go to `Configuration` =\> `Edit script` in the Tasmota web UI menu
|
||||
|
||||
|
@ -126,6 +127,8 @@ If a Tasmota `SENSOR` or `STATUS` or `RESULT` message is not generated or a `Var
|
|||
`int(x)` = gets the integer part of x (like floor)
|
||||
`hn(x)` = converts x (0..255) to a hex nibble string
|
||||
`st(svar c n)` = string token - retrieve the n<sup>th</sup> element of svar delimited by c
|
||||
`sl(svar)` = gets the length of a string
|
||||
`sb(svar p n)` = gets a substring from svar at position p (if p<0 counts from end) and length n
|
||||
`s(x)` = explicit conversion from number x to string
|
||||
`mqtts` = MQTT connection status: `0` = disconnected, `>0` = connected
|
||||
`wifis` = Wi-Fi connection status: `0` = disconnected, `>0` = connected
|
||||
|
@ -168,7 +171,7 @@ If you define a variable with the same name as a special variable that special v
|
|||
- A single percent sign must be given as `%%`
|
||||
|
||||
**Special** commands:
|
||||
`=> print` prints to the log for debugging
|
||||
`print` or `=> print` prints to the log for debugging
|
||||
A Tasmota MQTT RESULT message invokes the script's `>E` section. Add `=> print` statements to debug a script.
|
||||
|
||||
- Example:
|
||||
|
@ -200,6 +203,7 @@ If you define a variable with the same name as a special variable that special v
|
|||
`#name(param)` names a subroutines with a parameter is called with `=#name(param)`
|
||||
Subroutines end with the next `#` or `>` line or break. May be nested
|
||||
Parameters can be numbers or strings and on mismatch are converted
|
||||
`=(svar)`executes a script in a string variable (dynamic or self modifying code)
|
||||
|
||||
**For loop** (loop count must not be less than 1)
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue