diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index 058631a15..55d218456 100755 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -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; diff --git a/sonoff/support_rtc.ino b/sonoff/support_rtc.ino index 5c9f9e2b4..e13dd540e 100644 --- a/sonoff/support_rtc.ino +++ b/sonoff/support_rtc.ino @@ -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;