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: docs/Berry.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -390,12 +390,13 @@ Driver methods are called with the following parameters: `f(cmd, idx, payload, r
390
390
-`web_add_button()`: (deprecated) synonym of `web_add_console_button()`
391
391
-`web_add_main_button()`, `web_add_management_button()`, `web_add_console_button()`, `web_add_config_button()`: add a button to Tasmota's Web UI on a specific page
392
392
-`web_add_handler()`: called when Tasmota web server started, and the right time to call `webserver.on()` to add handlers
393
-
-`button_pressed()`: called when a button is pressed
394
393
-`save_before_restart()`: called just before a restart
395
394
-`mqtt_data(topic, idx, data, databytes)`: called for MQTT payloads matching `mqtt.subscribe`. `idx` is zero, and `data` is normally unparsed JSON.
396
395
-`set_power_handler(cmd, idx)`: called whenever a Power command is made. `idx` is a combined index value, with one bit per relay or light currently on. `cmd` can be ignored.
397
-
-`any_key(cmd, idx)`: called when an interaction with Button or Switch occurs. `idx` is encoded as follows: `device_save << 24 | key << 16 | state << 8 | device`
398
396
-`display()`: called by display driver with the following subtypes: `init_driver`, `model`, `dim`, `power`.
397
+
-`button_pressed(cmd, idx)`: called when a button is pressed. See [sample code]([url](https://github.com/arendst/Tasmota/pull/21711#issuecomment-2198649833)).
398
+
-`button_multi_pressed(cmd, idx)`: called for button multi-press. See [sample code]([url](https://github.com/arendst/Tasmota/pull/21711#issuecomment-2198649833)).
399
+
-`any_key(cmd, idx)`: called when an interaction with Button or Switch occurs. `idx` is encoded as follows: `device_save << 24 | key << 16 | state << 8 | device`<br> See [sample code]([url](https://github.com/arendst/Tasmota/pull/21711#issuecomment-2198649833)).
399
400
400
401
Then register the driver with `tasmota.add_driver(<driver>)`.
0 commit comments