diff --git a/include/devices.h b/include/devices.h index 3e6ccf6..8284b0a 100644 --- a/include/devices.h +++ b/include/devices.h @@ -137,8 +137,8 @@ namespace Devices { Display::Brightness::brightnessChangedCallback = []{ brightnessMqtt->updateState(Display::Brightness::current); }; - Display::Timer::timerCallback = []{ - timerRemainingMqtt->updateState(to_string(Display::Timer::current).c_str()); + Display::Timer::timerCallback = [](int8 current){ + timerRemainingMqtt->updateState(to_string(current).c_str()); }; } } \ No newline at end of file diff --git a/include/display.h b/include/display.h index 93b9d20..050b335 100644 --- a/include/display.h +++ b/include/display.h @@ -79,7 +79,7 @@ namespace Display { namespace Timer { int8 timer = 0, current = 0; - void (*timerCallback)(); + void (*timerCallback)(int8); Task tDisplayTimer(SECONDS(10), 2, []{ @@ -104,7 +104,7 @@ namespace Display { tDisplayTimer.setIterations(TASK_FOREVER); tDisplayTimer.restart(); } - if (timerCallback) timerCallback(); + if (timerCallback) timerCallback(current); }, &ts, false, nullptr, []{ tDisplayTimer.disable();