upgrade to ha-mqtt v1.5.1 - calling withStateTopic() and restoreFromState() is redundant
This commit is contained in:
parent
f7ba499292
commit
cf581bc03e
@ -33,19 +33,19 @@ namespace Devices {
|
||||
[](const char* msg) {
|
||||
turnLed(strcmp("ON", msg) == 0);
|
||||
}
|
||||
}).withStateTopic().restoreFromState().build();
|
||||
}).restoreStateFromCommand().build();
|
||||
|
||||
auto brightnessMqtt = Builder<Number>::instance(new Number{ "Brightness", "brightness",
|
||||
[](const char* msg) {
|
||||
Display::Brightness::set(String{ msg }.toInt());
|
||||
}
|
||||
}).withMin(BRIGHTNESS_MIN).withMax(BRIGHTNESS_MAX).withStep(BRIGHTNESS_STEP).withStateTopic().restoreFromState().build();
|
||||
}).withMin(BRIGHTNESS_MIN).withMax(BRIGHTNESS_MAX).withStep(BRIGHTNESS_STEP).restoreStateFromCommand().build();
|
||||
|
||||
auto hourFormatMqtt = Builder<Switch>::instance(new Switch{ "Format 24h", "format_24h",
|
||||
[](const char* msg) {
|
||||
strcmp("ON", msg) == 0 ? Display::changeHourFormat24(true) : Display::changeHourFormat24(false);
|
||||
}
|
||||
}).withStateTopic().restoreFromState().build();
|
||||
}).restoreStateFromCommand().build();
|
||||
|
||||
auto button =
|
||||
Builder<Button>::instance(new Button{"Restart", "restart",
|
||||
|
||||
@ -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.4.0
|
||||
https://git.hodos.ro/libraries/ha-mqtt.git@^1.5.1
|
||||
build_flags = -D WIFI_ALWAYS_ON=1 -D ADAFRUIT_BME=1
|
||||
|
||||
[env:laptop_home]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user