add icons
This commit is contained in:
parent
60b4e99bbd
commit
63a25fbfd7
@ -39,13 +39,17 @@ namespace Devices {
|
|||||||
[](const char* msg) {
|
[](const char* msg) {
|
||||||
Display::brightness = String{ msg }.toInt();
|
Display::brightness = String{ msg }.toInt();
|
||||||
}
|
}
|
||||||
}).withMin(Display::Brightness::MIN).withMax(Display::Brightness::MAX).withStep(1).restoreStateFromCommand().build();
|
})
|
||||||
|
.withMin(Display::Brightness::MIN).withMax(Display::Brightness::MAX).withStep(1)
|
||||||
|
.withIcon("mdi:brightness-7")
|
||||||
|
.restoreStateFromCommand()
|
||||||
|
.build();
|
||||||
|
|
||||||
auto hourFormatMqtt = Builder<Switch>::instance(new Switch{ "Format 24h", "format_24h",
|
auto hourFormatMqtt = Builder<Switch>::instance(new Switch{ "Format 24h", "format_24h",
|
||||||
[](const char* msg) {
|
[](const char* msg) {
|
||||||
Display::hourFormat24 = (strcmp("ON", msg) == 0);
|
Display::hourFormat24 = (strcmp("ON", msg) == 0);
|
||||||
}
|
}
|
||||||
}).restoreStateFromCommand().build();
|
}).withIcon("mdi:hours-24").restoreStateFromCommand().build();
|
||||||
Number* displayTimerMqtt = Builder<Number>::instance(new Number{ "Timer duration", "timer_duration",
|
Number* displayTimerMqtt = Builder<Number>::instance(new Number{ "Timer duration", "timer_duration",
|
||||||
[](const char* msg) {
|
[](const char* msg) {
|
||||||
auto value = String{ msg }.toInt();
|
auto value = String{ msg }.toInt();
|
||||||
@ -56,9 +60,15 @@ namespace Devices {
|
|||||||
Display::tTimer.enable();
|
Display::tTimer.enable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).withMin(0).withMax(90).withStep(5).restoreStateFromCommand().build();
|
})
|
||||||
|
.withMin(0).withMax(90).withStep(5)
|
||||||
|
.withDeviceClass("duration")
|
||||||
|
.withUnitMeasure("min")
|
||||||
|
.withIcon("mdi:timer-edit-outline")
|
||||||
|
.restoreStateFromCommand()
|
||||||
|
.build();
|
||||||
Sensor* timerRemainingMqtt = Builder<Sensor>::instance(new Sensor("Timer remaining", "timer_remaining"))
|
Sensor* timerRemainingMqtt = Builder<Sensor>::instance(new Sensor("Timer remaining", "timer_remaining"))
|
||||||
.withUnitMeasure("min").withPrecision(0).build();
|
.withUnitMeasure("min").withPrecision(0).withIcon("mdi:timer-sand").build();
|
||||||
Switch* timerMqtt = Builder<Switch>::instance(new Switch{"Timer", "timer",
|
Switch* timerMqtt = Builder<Switch>::instance(new Switch{"Timer", "timer",
|
||||||
[](const char* msg) {
|
[](const char* msg) {
|
||||||
if (strcmp("ON", msg) == 0) {
|
if (strcmp("ON", msg) == 0) {
|
||||||
@ -69,7 +79,7 @@ namespace Devices {
|
|||||||
timerMqtt->updateState(false);
|
timerMqtt->updateState(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).restoreStateFromCommand().build();
|
}).withIcon("mdi:timer-play-outline").restoreStateFromCommand().build();
|
||||||
|
|
||||||
auto button =
|
auto button =
|
||||||
Builder<Button>::instance(new Button{"Restart", "restart",
|
Builder<Button>::instance(new Button{"Restart", "restart",
|
||||||
@ -77,6 +87,7 @@ namespace Devices {
|
|||||||
if (strcmp("PRESS", msg) == 0) ESP.restart();
|
if (strcmp("PRESS", msg) == 0) ESP.restart();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.withIcon("mdi:restart")
|
||||||
.asDevice(espClockDevice)
|
.asDevice(espClockDevice)
|
||||||
.addSecondary(
|
.addSecondary(
|
||||||
Builder<Button>::instance(new Button{"Display time", "display_time",
|
Builder<Button>::instance(new Button{"Display time", "display_time",
|
||||||
@ -120,7 +131,7 @@ namespace Devices {
|
|||||||
[](const char* msg) {
|
[](const char* msg) {
|
||||||
if (strcmp("PRESS", msg) == 0) Ntp::tUpdateTime.restart();
|
if (strcmp("PRESS", msg) == 0) Ntp::tUpdateTime.restart();
|
||||||
}
|
}
|
||||||
}).build()
|
}).withIcon("mdi:update").build()
|
||||||
)
|
)
|
||||||
.addSecondary(ledMqtt)
|
.addSecondary(ledMqtt)
|
||||||
.addSecondary(timerMqtt)
|
.addSecondary(timerMqtt)
|
||||||
|
|||||||
@ -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@^1.5.1
|
https://git.hodos.ro/libraries/ha-mqtt.git@^1.6.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