mirror of
https://github.com/arendst/Tasmota.git
synced 2025-08-03 16:07:43 +00:00
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;
|
return local_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t UtcTime(void)
|
||||||
|
{
|
||||||
|
return utc_time;
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t Midnight(void)
|
uint32_t Midnight(void)
|
||||||
{
|
{
|
||||||
return midnight;
|
return midnight;
|
||||||
|
@ -651,6 +651,10 @@ bool findNextVariableValue(char * &pVarname, double &value)
|
|||||||
value = GetMinutesPastMidnight();
|
value = GetMinutesPastMidnight();
|
||||||
} else if (sVarName.equals(F("UPTIME"))) {
|
} else if (sVarName.equals(F("UPTIME"))) {
|
||||||
value = GetMinutesUptime();
|
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)
|
#if defined(USE_TIMERS) && defined(USE_SUNRISE)
|
||||||
} else if (sVarName.equals(F("SUNRISE"))) {
|
} else if (sVarName.equals(F("SUNRISE"))) {
|
||||||
value = GetSunMinutes(0);
|
value = GetSunMinutes(0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user