mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2025-12-13 11:02:12 +01:00
My Favorite Processing
* My button long presses detected from remotes for setting the my button. * Allow setting of rolling code. * Tuning for position setter and reading of hw sync bytes for repeats.
This commit is contained in:
parent
d8038aebce
commit
765e8f3fd0
11 changed files with 605 additions and 87 deletions
5
MQTT.cpp
5
MQTT.cpp
|
|
@ -86,6 +86,10 @@ void MQTTClass::receive(const char *topic, byte*payload, uint32_t length) {
|
|||
else
|
||||
shade->sendCommand(somfy_commands::My);
|
||||
}
|
||||
else if(strncmp(command, "mypos", sizeof(command)) == 0) {
|
||||
if(val >= 0 && val <= 100)
|
||||
shade->setMyPosition(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
bool MQTTClass::connect() {
|
||||
|
|
@ -106,6 +110,7 @@ bool MQTTClass::connect() {
|
|||
somfy.publish();
|
||||
this->subscribe("shades/+/target/set");
|
||||
this->subscribe("shades/+/direction/set");
|
||||
this->subscribe("shades/+/mypos/set");
|
||||
mqttClient.setCallback(MQTTClass::receive);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue