OpenDTU-old/include/MqttPublishing.h
Thomas Basler c9e603b2de Replace EVERY_N_SECONDS with millis
EVERY_N_SECONDS is not updated without a reboot of the controller
2022-06-15 22:15:02 +02:00

20 lines
417 B
C++

#pragma once
#include "Configuration.h"
#include <Arduino.h>
#include <Hoymiles.h>
#include <memory>
class MqttPublishingClass {
public:
void init();
void loop();
private:
void publishField(String subtopic, std::shared_ptr<InverterAbstract> inv, uint8_t channel, uint8_t fieldId);
uint32_t _lastPublishStats[INV_MAX_COUNT];
uint32_t _lastPublish;
};
extern MqttPublishingClass MqttPublishing;