Files
Thermostat/include/mqtt_handler.h
2026-03-16 11:20:10 +01:00

13 lines
418 B
C

#pragma once
#include <Arduino.h>
#include <PubSubClient.h>
#include "thermostat.h"
extern float currentTemp; // Global temperature variable updated by MQTT callback
bool mqtt_connect(PubSubClient& client);
void mqtt_loop(PubSubClient& client);
void mqtt_publish_state(PubSubClient& client, ThermostatMode mode, float targetTemp, bool heating);
void mqtt_callback(char* topic, byte* payload, unsigned int length);