mirror of https://github.com/arendst/Tasmota.git
Tuning uptime and add utctime
Tuning uptime and add utctime
This commit is contained in:
parent
18ca69e5fd
commit
32c1e2d13c
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue