mirror of https://github.com/arendst/Tasmota.git
Add two constant varibles in rules expression
Add two variables: - UtcTime The number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT) - LocalTime Seconds passed after Jan 1, 1970 midnight base on current timezone and daylight saving setting.
This commit is contained in:
parent
2bc84a9aad
commit
6f2f0b6fea
|
@ -331,6 +331,11 @@ uint32_t LocalTime(void)
|
|||
return local_time;
|
||||
}
|
||||
|
||||
uint32_t UtcTime(void)
|
||||
{
|
||||
return utc_time;
|
||||
}
|
||||
|
||||
uint32_t Midnight(void)
|
||||
{
|
||||
return midnight;
|
||||
|
|
|
@ -651,6 +651,10 @@ bool findNextVariableValue(char * &pVarname, double &value)
|
|||
value = GetMinutesPastMidnight();
|
||||
} else if (sVarName.equals(F("UPTIME"))) {
|
||||
value = GetMinutesUptime();
|
||||
} else if (sVarName.equals(F("UTCTIME"))) {
|
||||
value = UtcTime();
|
||||
} else if (sVarName.equals(F("LOCALTIME"))) {
|
||||
value = LocalTime();
|
||||
#if defined(USE_TIMERS) && defined(USE_SUNRISE)
|
||||
} else if (sVarName.equals(F("SUNRISE"))) {
|
||||
value = GetSunMinutes(0);
|
||||
|
|
Loading…
Reference in New Issue