Merge pull request #7106 from ascillato/patch-1

Added new var %topic% for rules
This commit is contained in:
Theo Arends 2019-12-04 21:37:28 +01:00 committed by GitHub
commit e51cefe375
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -452,6 +452,7 @@ bool RuleSetProcess(uint8_t rule_set, String &event_saved)
RulesVarReplace(commands, F("%TIME%"), String(MinutesPastMidnight()));
RulesVarReplace(commands, F("%UPTIME%"), String(MinutesUptime()));
RulesVarReplace(commands, F("%TIMESTAMP%"), GetDateAndTime(DT_LOCAL));
RulesVarReplace(commands, F("%TOPIC%"), Settings.mqtt_topic);
#if defined(USE_TIMERS) && defined(USE_SUNRISE)
RulesVarReplace(commands, F("%SUNRISE%"), String(SunMinutes(0)));
RulesVarReplace(commands, F("%SUNSET%"), String(SunMinutes(1)));