#ifndef HOMEKIT_LIB_MQTT_MODULE_RELAY_H
#define HOMEKIT_LIB_MQTT_MODULE_RELAY_H

#include <homekit/mqtt/module.h>

namespace homekit::mqtt {

struct MqttRelaySwitchPayload {
    char secret[12];
    uint8_t state;
} __attribute__((packed));

class MqttRelayModule : public MqttModule {
public:
    MqttRelayModule() : MqttModule(0) {}
    void init(Mqtt& mqtt) override;
    void tick(Mqtt& mqtt) override;
	void handlePayload(Mqtt& mqtt, String& topic, uint16_t packetId, const uint8_t *payload, size_t length, size_t index, size_t total) override;
};

}

#endif //HOMEKIT_LIB_MQTT_MODULE_RELAY_H
