improved responses content for commands and cronjobs
This commit is contained in:
@@ -222,7 +222,13 @@ const bool Cron::processEvents()
|
||||
next = cron::cron_next(cronexrp, nowTm); // update next execution time only if event was executed
|
||||
// otherwise time tracking is lost
|
||||
LOG_INFO("Cron running event [", eventName.c_str(), "] next execution time [", drivers::PCF85063::tm2str(next).c_str(), "]");
|
||||
auto resp = commands::s_commandMap.at(cmd)(m_dev, cmdParams); // here the magic happens
|
||||
auto action = commands::s_commandMap.at(cmd)(m_dev, cmdParams); // here the magic happens
|
||||
ArduinoJson::JsonDocument resp;
|
||||
resp["cmd"] = "logCronJob";
|
||||
resp["values"]["name"] = eventName;
|
||||
resp["values"]["now"] = drivers::PCF85063::tm2str(nowTm).c_str();
|
||||
resp["values"]["next"] = drivers::PCF85063::tm2str(next).c_str();
|
||||
resp["values"]["action"] = action;
|
||||
if (m_callback)
|
||||
{
|
||||
m_callback(resp);
|
||||
|
||||
Reference in New Issue
Block a user