mirror of
https://github.com/wled/WLED.git
synced 2025-07-16 23:36:35 +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") {
|
} else if (action == "down") {
|
||||||
topSensorWrite = true;
|
topSensorWrite = true;
|
||||||
return true;
|
return true;
|
||||||
|
} else if (action == "on") {
|
||||||
|
enable(true);
|
||||||
|
return true;
|
||||||
|
} else if (action == "off") {
|
||||||
|
enable(false);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -499,10 +505,10 @@ class Animated_Staircase : public Usermod {
|
|||||||
JsonArray usermodEnabled = staircase.createNestedArray(F("Staircase")); // name
|
JsonArray usermodEnabled = staircase.createNestedArray(F("Staircase")); // name
|
||||||
String btn = F("<button class=\"btn infobtn\" onclick=\"requestJson({staircase:{enabled:");
|
String btn = F("<button class=\"btn infobtn\" onclick=\"requestJson({staircase:{enabled:");
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
btn += F("false}});loadInfo();\">");
|
btn += F("false}},false,false);loadInfo();\">");
|
||||||
btn += F("enabled");
|
btn += F("enabled");
|
||||||
} else {
|
} else {
|
||||||
btn += F("true}});loadInfo();\">");
|
btn += F("true}},false,false);loadInfo();\">");
|
||||||
btn += F("disabled");
|
btn += F("disabled");
|
||||||
}
|
}
|
||||||
btn += F("</button>");
|
btn += F("</button>");
|
||||||
|
@ -119,6 +119,7 @@ curl -X POST -H "Content-Type: application/json" \
|
|||||||
```
|
```
|
||||||
**MQTT**
|
**MQTT**
|
||||||
You can publish a message with either `up` or `down` on topic `/swipe` to trigger animation.
|
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/>
|
Have fun with this usermod.<br/>
|
||||||
www.rolfje.com
|
www.rolfje.com
|
||||||
|
Loading…
x
Reference in New Issue
Block a user