mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-24 19:26:37 +00:00
Refactor rules MACADDR
This commit is contained in:
parent
2bf98839e8
commit
7605ec388c
@ -758,11 +758,9 @@ bool RuleSetProcess(uint8_t rule_set, String &event_saved)
|
|||||||
RulesVarReplace(commands, F("%TOPIC%"), mqtt_topic);
|
RulesVarReplace(commands, F("%TOPIC%"), mqtt_topic);
|
||||||
snprintf_P(stemp, sizeof(stemp), PSTR("%06X"), ESP_getChipId());
|
snprintf_P(stemp, sizeof(stemp), PSTR("%06X"), ESP_getChipId());
|
||||||
RulesVarReplace(commands, F("%DEVICEID%"), stemp);
|
RulesVarReplace(commands, F("%DEVICEID%"), stemp);
|
||||||
char macaddr[13];
|
|
||||||
String mac_address = WiFi.macAddress();
|
String mac_address = WiFi.macAddress();
|
||||||
mac_address.replace(":", "");
|
mac_address.replace(":", "");
|
||||||
snprintf_P(macaddr, sizeof(macaddr), PSTR("%s"), mac_address.c_str());
|
RulesVarReplace(commands, F("%MACADDR%"), mac_address);
|
||||||
RulesVarReplace(commands, F("%MACADDR%"), macaddr);
|
|
||||||
#if defined(USE_TIMERS) && defined(USE_SUNRISE)
|
#if defined(USE_TIMERS) && defined(USE_SUNRISE)
|
||||||
RulesVarReplace(commands, F("%SUNRISE%"), String(SunMinutes(0)));
|
RulesVarReplace(commands, F("%SUNRISE%"), String(SunMinutes(0)));
|
||||||
RulesVarReplace(commands, F("%SUNSET%"), String(SunMinutes(1)));
|
RulesVarReplace(commands, F("%SUNSET%"), String(SunMinutes(1)));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user