{mac} placeholder in json template content card

This commit is contained in:
Nic Limper
2025-01-12 14:12:52 +01:00
parent c5fb16836f
commit 45427148f6

View File

@@ -488,6 +488,14 @@ void drawNew(const uint8_t mac[8], tagRecord *&taginfo) {
if (!util::isEmptyOrNull(configUrl)) {
DynamicJsonDocument json(1000);
Serial.println("Get json url + file");
int index = configUrl.indexOf("{mac}");
if (index != -1) {
char macStr[17];
mac2hex(mac, macStr);
configUrl.replace("{mac}", macStr);
}
if (util::httpGetJson(configUrl, json, 1000)) {
taginfo->nextupdate = now + interval;
if (getJsonTemplateFileExtractVariables(filename, configFilename, json, taginfo, imageParams)) {