update to ha-mqtt stable 2.0.0
This commit is contained in:
parent
afc252062e
commit
d193b9bb1b
@ -33,7 +33,7 @@ namespace Devices {
|
|||||||
[](const char* msg) {
|
[](const char* msg) {
|
||||||
turnLed(strcmp("ON", msg) == 0);
|
turnLed(strcmp("ON", msg) == 0);
|
||||||
}
|
}
|
||||||
}).restoreStateFromCommand().build();
|
}).restoreStateFromTopic().build();
|
||||||
|
|
||||||
auto brightnessMqtt = Builder<Number>(new Number{ "Brightness", "brightness",
|
auto brightnessMqtt = Builder<Number>(new Number{ "Brightness", "brightness",
|
||||||
[](const char* msg) {
|
[](const char* msg) {
|
||||||
@ -42,14 +42,14 @@ namespace Devices {
|
|||||||
})
|
})
|
||||||
.withMin(Display::Brightness::MIN).withMax(Display::Brightness::MAX).withStep(1)
|
.withMin(Display::Brightness::MIN).withMax(Display::Brightness::MAX).withStep(1)
|
||||||
.withIcon("mdi:brightness-7")
|
.withIcon("mdi:brightness-7")
|
||||||
.restoreStateFromCommand()
|
.restoreStateFromTopic()
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
auto hourFormatMqtt = Builder<Switch>(new Switch{ "Format 24h", "format_24h",
|
auto hourFormatMqtt = Builder<Switch>(new Switch{ "Format 24h", "format_24h",
|
||||||
[](const char* msg) {
|
[](const char* msg) {
|
||||||
Display::hourFormat24 = (strcmp("ON", msg) == 0);
|
Display::hourFormat24 = (strcmp("ON", msg) == 0);
|
||||||
}
|
}
|
||||||
}).withIcon("mdi:hours-24").restoreStateFromCommand().build();
|
}).withIcon("mdi:hours-24").restoreStateFromTopic().build();
|
||||||
Number* displayTimerMqtt = Builder<Number>(new Number{ "Timer duration", "timer_duration",
|
Number* displayTimerMqtt = Builder<Number>(new Number{ "Timer duration", "timer_duration",
|
||||||
[](const char* msg) {
|
[](const char* msg) {
|
||||||
auto value = String{ msg }.toInt();
|
auto value = String{ msg }.toInt();
|
||||||
@ -65,7 +65,7 @@ namespace Devices {
|
|||||||
.withDeviceClass("duration")
|
.withDeviceClass("duration")
|
||||||
.withUnitMeasure("min")
|
.withUnitMeasure("min")
|
||||||
.withIcon("mdi:timer-edit-outline")
|
.withIcon("mdi:timer-edit-outline")
|
||||||
.restoreStateFromCommand()
|
.restoreStateFromTopic()
|
||||||
.build();
|
.build();
|
||||||
Sensor* timerRemainingMqtt = Builder<Sensor>(new Sensor("Timer remaining", "timer_remaining"))
|
Sensor* timerRemainingMqtt = Builder<Sensor>(new Sensor("Timer remaining", "timer_remaining"))
|
||||||
.withUnitMeasure("min").withPrecision(0).withIcon("mdi:timer-sand").build();
|
.withUnitMeasure("min").withPrecision(0).withIcon("mdi:timer-sand").build();
|
||||||
@ -79,7 +79,7 @@ namespace Devices {
|
|||||||
timerMqtt->updateState(false);
|
timerMqtt->updateState(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).withIcon("mdi:timer-play-outline").restoreStateFromCommand().build();
|
}).withIcon("mdi:timer-play-outline").restoreStateFromTopic().build();
|
||||||
|
|
||||||
auto button =
|
auto button =
|
||||||
HaESP::restartButton()
|
HaESP::restartButton()
|
||||||
|
|||||||
@ -23,7 +23,7 @@ lib_deps =
|
|||||||
sparkfun/SparkFun BME280@^2.0.9
|
sparkfun/SparkFun BME280@^2.0.9
|
||||||
arkhipenko/TaskScheduler@^3.8.5
|
arkhipenko/TaskScheduler@^3.8.5
|
||||||
https://git.hodos.ro/libraries/wifi.git@^2.0.0
|
https://git.hodos.ro/libraries/wifi.git@^2.0.0
|
||||||
https://git.hodos.ro/libraries/ha-mqtt.git#v2.0.0
|
https://git.hodos.ro/libraries/ha-mqtt.git#2.0.0
|
||||||
build_flags = -D WIFI_ALWAYS_ON=1 -D ADAFRUIT_BME=1
|
build_flags = -D WIFI_ALWAYS_ON=1 -D ADAFRUIT_BME=1
|
||||||
|
|
||||||
[env:laptop_home]
|
[env:laptop_home]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user