Tuning uptime and add utctime

Tuning uptime and add utctime
This commit is contained in:
Theo Arends 2019-02-19 10:48:19 +01:00
parent 18ca69e5fd
commit 32c1e2d13c
2 changed files with 11 additions and 12 deletions

View File

@ -1306,10 +1306,7 @@ void MqttDataHandler(char* topic, uint8_t* data, unsigned int data_len)
restart_flag = 211;
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command , D_JSON_RESET_AND_RESTARTING);
break;
case 2:
case 3:
case 4:
case 5 ... 6:
case 2 ... 6:
restart_flag = 210 + payload;
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_RESET "\":\"" D_JSON_ERASE ", " D_JSON_RESET_AND_RESTARTING "\"}"));
break;

View File

@ -181,19 +181,16 @@ uint32_t UpTime(void)
}
}
uint32_t GetMinutesUptime(void)
{
return (UpTime() / 60);
}
String GetUptime(void)
{
return GetDuration(UpTime());
}
uint32_t GetMinutesUptime(void)
{
TIME_T ut;
BreakTime(UpTime(), ut);
return (ut.days *1440) + (ut.hour *60) + ut.minute;
}
uint32_t GetMinutesPastMidnight(void)
{
uint32_t minutes = 0;
@ -326,6 +323,11 @@ uint32_t RuleToTime(TimeRule r, int yr)
return t;
}
uint32_t UtcTime(void)
{
return utc_time;
}
uint32_t LocalTime(void)
{
return local_time;