Added Remote protocol #165, added mac to MQTT #167

This commit is contained in:
Robert Strouse 2023-10-07 11:12:45 -07:00
parent bbebc22bb9
commit 87995bf707
9 changed files with 174 additions and 29 deletions

View file

@ -4,6 +4,7 @@
#include "MQTT.h"
#include "ConfigSettings.h"
#include "Somfy.h"
#include "Network.h"
WiFiClient tcpClient;
PubSubClient mqttClient(tcpClient);
@ -13,6 +14,9 @@ static char g_content[MQTT_MAX_RESPONSE];
extern ConfigSettings settings;
extern SomfyShadeController somfy;
extern Network net;
bool MQTTClass::begin() {
this->suspended = false;
return true;
@ -197,6 +201,7 @@ bool MQTTClass::connect() {
this->publish("host", settings.hostname, true);
this->publish("firmware", settings.fwVersion, true);
this->publish("serverId", settings.serverId, true);
this->publish("mac", net.mac.c_str());
somfy.publish();
this->subscribe("shades/+/target/set");
this->subscribe("shades/+/tiltTarget/set");