#include "./module.h"
#include <homekit/logging.h>

namespace homekit::mqtt {

bool MqttModule::tickElapsed() {
    if (!tickSw.elapsed(tickInterval*1000))
        return false;

    tickSw.save();
    return true;
}

void MqttModule::handlePayload(Mqtt& mqtt, String& topic, uint16_t packetId, const uint8_t* payload, size_t length,
                               size_t index, size_t total) {
    if (length != total)
        PRINTLN("mqtt: received partial message, not supported");

    // TODO
}

void MqttModule::handleOnPublish(uint16_t packetId) {}

void MqttModule::handleOnDisconnect(espMqttClientTypes::DisconnectReason reason) {}

}
