#include "temphum.h" namespace homekit::mqtt { static const char TOPIC_TEMPHUM_DATA[] = "temphum/data"; void MqttTemphumModule::onConnect(Mqtt &mqtt) {} void MqttTemphumModule::tick(homekit::mqtt::Mqtt& mqtt) { if (!tickElapsed()) return; temphum::SensorData sd = sensor->read(); MqttTemphumPayload payload { .temp = sd.temp, .rh = sd.rh, .error = sd.error }; mqtt.publish(TOPIC_TEMPHUM_DATA, reinterpret_cast(&payload), sizeof(payload)); } }