mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2025-12-13 11:02:12 +01:00
Add MQTT disco attributes #182
This commit is contained in:
parent
3c16090607
commit
46f6e6912d
5 changed files with 173 additions and 112 deletions
4
MQTT.cpp
4
MQTT.cpp
|
|
@ -104,7 +104,7 @@ void MQTTClass::receive(const char *topic, byte*payload, uint32_t length) {
|
|||
int val = atoi(value);
|
||||
if(strncmp(command, "target", sizeof(command)) == 0) {
|
||||
if(val >= 0 && val <= 100)
|
||||
shade->moveToTarget(atoi(value));
|
||||
shade->moveToTarget(shade->transformPosition(atoi(value)));
|
||||
}
|
||||
if(strncmp(command, "tiltTarget", sizeof(command)) == 0) {
|
||||
if(val >= 0 && val <= 100)
|
||||
|
|
@ -132,7 +132,7 @@ void MQTTClass::receive(const char *topic, byte*payload, uint32_t length) {
|
|||
}
|
||||
else if(strncmp(command, "position", sizeof(command)) == 0) {
|
||||
if(val >= 0 && val <= 100) {
|
||||
shade->target = shade->currentPos = (float)val;
|
||||
shade->target = shade->currentPos = shade->transformPosition((float)val);
|
||||
shade->emitState();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue