From a2707b108c104b4b509e692e111025deea695ded Mon Sep 17 00:00:00 2001 From: fredlcore Date: Sat, 30 Nov 2024 02:13:32 +0800 Subject: [PATCH] my_dev_id renamed to my_dev_serial --- BSB_LAN/include/mqtt_handler.h | 10 +++++----- BSB_LAN/include/print_ipwe.h | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/BSB_LAN/include/mqtt_handler.h b/BSB_LAN/include/mqtt_handler.h index 963d5ae9..8f06d1eb 100644 --- a/BSB_LAN/include/mqtt_handler.h +++ b/BSB_LAN/include/mqtt_handler.h @@ -300,7 +300,7 @@ void mqtt_callback(char* topic, byte* passed_payload, unsigned int length) { uint8_t destAddr = bus->getBusDest(); uint8_t save_my_dev_fam = my_dev_fam; uint8_t save_my_dev_var = my_dev_var; - uint32_t save_my_dev_id = my_dev_id; + uint32_t save_my_dev_serial = my_dev_serial; uint8_t setmode = 0; // 0 = send INF, 1 = send SET, 2 = query int topic_len = strlen(MQTTTopicPrefix); parameter param; @@ -358,7 +358,7 @@ void mqtt_callback(char* topic, byte* passed_payload, unsigned int length) { bus->setBusType(bus->getBusType(), bus->getBusAddr(), destAddr); my_dev_fam = save_my_dev_fam; my_dev_var = save_my_dev_var; - my_dev_id = save_my_dev_id; + my_dev_serial = save_my_dev_serial; } token = strtok(NULL, ","); // next parameter } @@ -407,7 +407,7 @@ void mqtt_callback(char* topic, byte* passed_payload, unsigned int length) { bus->setBusType(bus->getBusType(), bus->getBusAddr(), destAddr); my_dev_fam = save_my_dev_fam; my_dev_var = save_my_dev_var; - my_dev_id = save_my_dev_id; + my_dev_serial = save_my_dev_serial; } } @@ -441,7 +441,7 @@ boolean mqtt_send_discovery(boolean create=true) { loadPrognrElementsFromTable(line, i); loadCategoryDescAddr(); appendStringBuffer(&sb_topic, "homeassistant/"); - appendStringBuffer(&sb_payload, "{\"~\":\"%s/%d/%d/%g\",\"unique_id\":\"%g-%d-%d-%d\",\"state_topic\":\"~/status\",", MQTTTopicPrefix, bus->getBusDest(), decodedTelegram.cat, line, line, cmdtbl[i].dev_fam, cmdtbl[i].dev_var, my_dev_id); + appendStringBuffer(&sb_payload, "{\"~\":\"%s/%d/%d/%g\",\"unique_id\":\"%g-%d-%d-%d\",\"state_topic\":\"~/status\",", MQTTTopicPrefix, bus->getBusDest(), decodedTelegram.cat, line, line, cmdtbl[i].dev_fam, cmdtbl[i].dev_var, my_dev_serial); if (decodedTelegram.isswitch) { appendStringBuffer(&sb_payload, "\"icon\":\"mdi:toggle-switch\","); } else if (!strcmp(decodedTelegram.unit, U_DEG) || !strcmp(decodedTelegram.unit, U_TEMP_PER_MIN) || !strcmp(decodedTelegram.unit, U_CEL_MIN)) { @@ -516,7 +516,7 @@ boolean mqtt_send_discovery(boolean create=true) { } appendStringBuffer(&sb_payload, "\",\"device\":{\"name\":\"%s\",\"identifiers\":\"%s-%02X%02X%02X%02X%02X%02X\",\"manufacturer\":\"bsb-lan.de\",\"model\":\"" MAJOR "." MINOR "." PATCH "\"}}", MQTTTopicPrefix, MQTTTopicPrefix, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - appendStringBuffer(&sb_topic, "BSB-LAN/%g-%d-%d-%d/config", line, cmdtbl[i].dev_fam, cmdtbl[i].dev_var, my_dev_id); + appendStringBuffer(&sb_topic, "BSB-LAN/%g-%d-%d-%d/config", line, cmdtbl[i].dev_fam, cmdtbl[i].dev_var, my_dev_serial); if (!create) { MQTTPayload[0] = '\0'; // If remove flag is set, send empty message to instruct auto discovery to remove the entry diff --git a/BSB_LAN/include/print_ipwe.h b/BSB_LAN/include/print_ipwe.h index 51db40b1..5eef7d0d 100644 --- a/BSB_LAN/include/print_ipwe.h +++ b/BSB_LAN/include/print_ipwe.h @@ -23,7 +23,7 @@ void Ipwe() { uint8_t d_addr = destAddr; uint8_t save_my_dev_fam = my_dev_fam; uint8_t save_my_dev_var = my_dev_var; - uint32_t save_my_dev_id = my_dev_id; + uint32_t save_my_dev_serial = my_dev_serial; printFmtToDebug("IPWE sensors: %d\r\n", numIPWESensors); printHTTPheader(HTTP_OK, MIME_TYPE_TEXT_HTML, HTTP_ADD_CHARSET_TO_HEADER, HTTP_FILE_NOT_GZIPPED, HTTP_NO_DOWNLOAD, HTTP_DO_NOT_CACHE); printToWebClient("\r\n
"); @@ -41,7 +41,7 @@ void Ipwe() { return_to_default_destination(destAddr); my_dev_fam = save_my_dev_fam; my_dev_var = save_my_dev_var; - my_dev_id = save_my_dev_id; + my_dev_serial = save_my_dev_serial; } } query(ipwe_parameters[i].number); @@ -58,7 +58,7 @@ void Ipwe() { return_to_default_destination(destAddr); my_dev_fam = save_my_dev_fam; my_dev_var = save_my_dev_var; - my_dev_id = save_my_dev_id; + my_dev_serial = save_my_dev_serial; } if (LoggingMode & CF_LOGMODE_24AVG) {
SensortypAdresseBeschreibungWertLuftfeuchtigkeitWindgeschwindigkeitRegenmenge