MQTT-DS5: Added dedicated power control topic

This commit is contained in:
Nis Wechselberg 2018-05-20 14:29:01 +02:00
parent 657a13a12a
commit acab1aa058

View file

@ -211,6 +211,10 @@ void incoming_mqtt(char* topic, byte* payload, unsigned int length) {
} }
} }
if (strcmp(topic, mqtt_topic_power) == 0) {
code = codes[0];
}
free(msgCopy); free(msgCopy);
// Check if we found a code to send // Check if we found a code to send
@ -236,6 +240,7 @@ void reconnect() {
// subscribe to incoming topics // subscribe to incoming topics
client.subscribe(mqtt_topic_command); client.subscribe(mqtt_topic_command);
client.subscribe(mqtt_topic_volume); client.subscribe(mqtt_topic_volume);
client.subscribe(mqtt_topic_power);
if (DEBUGTOSERIAL) { if (DEBUGTOSERIAL) {
Serial.println("Subscriptions done"); Serial.println("Subscriptions done");
} }