From 59f7ae7ab39c9fff84d99bc418630aad820a1338 Mon Sep 17 00:00:00 2001 From: Serge NOEL Date: Wed, 11 Mar 2026 14:29:08 +0100 Subject: [PATCH] Gestion MQTT --- Thermostat/.gitignore | 5 +++++ Thermostat/.vscode/extensions.json | 10 ++++++++++ Thermostat/include/mqtt_handler.h | 3 +++ Thermostat/platformio.ini | 4 ++-- 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 Thermostat/.gitignore create mode 100644 Thermostat/.vscode/extensions.json diff --git a/Thermostat/.gitignore b/Thermostat/.gitignore new file mode 100644 index 0000000..89cc49c --- /dev/null +++ b/Thermostat/.gitignore @@ -0,0 +1,5 @@ +.pio +.vscode/.browse.c_cpp.db* +.vscode/c_cpp_properties.json +.vscode/launch.json +.vscode/ipch diff --git a/Thermostat/.vscode/extensions.json b/Thermostat/.vscode/extensions.json new file mode 100644 index 0000000..080e70d --- /dev/null +++ b/Thermostat/.vscode/extensions.json @@ -0,0 +1,10 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "platformio.platformio-ide" + ], + "unwantedRecommendations": [ + "ms-vscode.cpptools-extension-pack" + ] +} diff --git a/Thermostat/include/mqtt_handler.h b/Thermostat/include/mqtt_handler.h index 770a336..95f7649 100644 --- a/Thermostat/include/mqtt_handler.h +++ b/Thermostat/include/mqtt_handler.h @@ -1,6 +1,8 @@ #pragma once #include #include +#include "thermostat.h" + void setup_mqtt(PubSubClient& client); void mqtt_loop(PubSubClient& client); @@ -8,3 +10,4 @@ void mqtt_publish_state(PubSubClient& client, ThermostatMode mode, float targetT void mqtt_callback(char* topic, byte* payload, unsigned int length); extern String mqtt_device_id; extern String mqtt_temp_topic; + diff --git a/Thermostat/platformio.ini b/Thermostat/platformio.ini index 9f6035e..b9fb9e1 100644 --- a/Thermostat/platformio.ini +++ b/Thermostat/platformio.ini @@ -1,6 +1,6 @@ -[env:sonoff_basic_r2] +[env:sonoff_basic] platform = espressif8266 -board = sonoff_basic_r2 +board = sonoff_basic framework = arduino monitor_speed = 115200 upload_speed = 115200