use global mqtt

This commit is contained in:
2025-08-29 10:22:36 +02:00
parent 2dec989294
commit 214f4647a0
3 changed files with 14 additions and 16 deletions

View File

@@ -2,7 +2,6 @@
#include <cstdint>
#include "pin.h"
#include "mqtt.h"
struct LightInfo {
std::string uniqueId;
@@ -65,9 +64,9 @@ enum ActiveMode {
class Light {
public:
Light(Pin* pinR, Pin* pinG, Pin* pinB, Mqtt* mqttClient, std::string uniqueId);
Light(Pin* pinR, Pin* pinG, Pin* pinB, Pin* pinCW, Mqtt* mqttClient, std::string uniqueId);
Light(Pin* pinR, Pin* pinG, Pin* pinB, Pin* pinCW, Pin* pinWW, Mqtt* mqttClient, std::string uniqueId);
Light(Pin* pinR, Pin* pinG, Pin* pinB, std::string uniqueId);
Light(Pin* pinR, Pin* pinG, Pin* pinB, Pin* pinCW, std::string uniqueId);
Light(Pin* pinR, Pin* pinG, Pin* pinB, Pin* pinCW, Pin* pinWW, std::string uniqueId);
void subscribeToMqttTopics();
void publishInitialState();
void publishCurrentState();
@@ -97,7 +96,6 @@ private:
Pin* pinB;
Pin* pinCW;
Pin* pinWW;
Mqtt* mqttClient;
LightInfo lightInfo;
DeviceInfo deviceInfo;
LightType lightType = onOff; // Default light type