mirror of
https://github.com/wled/WLED.git
synced 2025-04-23 22:37:18 +00:00
Added on/off MQTT command for anbling/disabling usermod.
This commit is contained in:
parent
5ad0fdf39c
commit
cc10ee0134
@ -350,6 +350,12 @@ class Animated_Staircase : public Usermod {
|
||||
} else if (action == "down") {
|
||||
topSensorWrite = true;
|
||||
return true;
|
||||
} else if (action == "on") {
|
||||
enable(true);
|
||||
return true;
|
||||
} else if (action == "off") {
|
||||
enable(false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@ -499,10 +505,10 @@ class Animated_Staircase : public Usermod {
|
||||
JsonArray usermodEnabled = staircase.createNestedArray(F("Staircase")); // name
|
||||
String btn = F("<button class=\"btn infobtn\" onclick=\"requestJson({staircase:{enabled:");
|
||||
if (enabled) {
|
||||
btn += F("false}});loadInfo();\">");
|
||||
btn += F("false}},false,false);loadInfo();\">");
|
||||
btn += F("enabled");
|
||||
} else {
|
||||
btn += F("true}});loadInfo();\">");
|
||||
btn += F("true}},false,false);loadInfo();\">");
|
||||
btn += F("disabled");
|
||||
}
|
||||
btn += F("</button>");
|
||||
|
@ -119,6 +119,7 @@ curl -X POST -H "Content-Type: application/json" \
|
||||
```
|
||||
**MQTT**
|
||||
You can publish a message with either `up` or `down` on topic `/swipe` to trigger animation.
|
||||
You can also use `on` or `off` for enabling or disabling usermod.
|
||||
|
||||
Have fun with this usermod.<br/>
|
||||
www.rolfje.com
|
||||
|
Loading…
x
Reference in New Issue
Block a user