From a2e64699035f7e1bb08c96ab13b366682dc87939 Mon Sep 17 00:00:00 2001 From: Nicu Hodos Date: Mon, 28 Oct 2024 16:42:49 +0100 Subject: [PATCH] upgrade to ha-mqtt v1.4.0 --- include/devices.h | 4 ++-- platformio.ini | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/devices.h b/include/devices.h index f21cab8..a3e5252 100644 --- a/include/devices.h +++ b/include/devices.h @@ -35,11 +35,11 @@ namespace Devices { } }).withStateTopic().restoreFromState().build(); - auto brightnessMqtt = Builder::instance(new Number{ "Brightness", "brightness", BRIGHTNESS_MIN, BRIGHTNESS_MAX, BRIGHTNESS_STEP, + auto brightnessMqtt = Builder::instance(new Number{ "Brightness", "brightness", [](const char* msg) { Display::Brightness::set(String{ msg }.toInt()); } - }).withStateTopic().restoreFromState().build(); + }).withMin(BRIGHTNESS_MIN).withMax(BRIGHTNESS_MAX).withStep(BRIGHTNESS_STEP).withStateTopic().restoreFromState().build(); auto hourFormatMqtt = Builder::instance(new Switch{ "Format 24h", "format_24h", [](const char* msg) { diff --git a/platformio.ini b/platformio.ini index 5fc6a2d..1402c51 100644 --- a/platformio.ini +++ b/platformio.ini @@ -23,7 +23,7 @@ lib_deps = sparkfun/SparkFun BME280@^2.0.9 arkhipenko/TaskScheduler@^3.8.5 https://git.hodos.ro/libraries/wifi.git@^2.0.0 - https://git.hodos.ro/libraries/ha-mqtt.git@^1.3.0 + https://git.hodos.ro/libraries/ha-mqtt.git@^1.4.0 build_flags = -D WIFI_ALWAYS_ON=1 -D ADAFRUIT_BME=1 [env:laptop_home]