From 7605ec388c686c7a1a1c0743135c0bbb18c35218 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Tue, 22 Sep 2020 12:09:16 +0200 Subject: [PATCH] Refactor rules MACADDR --- tasmota/xdrv_10_rules.ino | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tasmota/xdrv_10_rules.ino b/tasmota/xdrv_10_rules.ino index be0ba7a98..fdb23f036 100644 --- a/tasmota/xdrv_10_rules.ino +++ b/tasmota/xdrv_10_rules.ino @@ -758,11 +758,9 @@ bool RuleSetProcess(uint8_t rule_set, String &event_saved) RulesVarReplace(commands, F("%TOPIC%"), mqtt_topic); snprintf_P(stemp, sizeof(stemp), PSTR("%06X"), ESP_getChipId()); RulesVarReplace(commands, F("%DEVICEID%"), stemp); - char macaddr[13]; String mac_address = WiFi.macAddress(); mac_address.replace(":", ""); - snprintf_P(macaddr, sizeof(macaddr), PSTR("%s"), mac_address.c_str()); - RulesVarReplace(commands, F("%MACADDR%"), macaddr); + RulesVarReplace(commands, F("%MACADDR%"), mac_address); #if defined(USE_TIMERS) && defined(USE_SUNRISE) RulesVarReplace(commands, F("%SUNRISE%"), String(SunMinutes(0))); RulesVarReplace(commands, F("%SUNSET%"), String(SunMinutes(1)));