Merge pull request #11326 from nicandris/development

Added SetOption125 (Zigbee) Hide bridge topic from zigbee topic
This commit is contained in:
Theo Arends 2021-03-20 12:53:17 +01:00 committed by GitHub
commit 9902a29c31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View File

@ -150,7 +150,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu
uint32_t mqtt_info_retain : 1; // bit 8 (v9.3.0.1) - CMND_INFORETAIN
uint32_t wiegand_hex_output : 1; // bit 9 (v9.3.1.1) - SetOption123 - (Wiegand) switch tag number output to hex format (1)
uint32_t wiegand_keypad_to_tag : 1; // bit 10 (v9.3.1.1) - SetOption124 - (Wiegand) send key pad stroke as single char (0) or one tag (ending char #) (1)
uint32_t spare11 : 1; // bit 11
uint32_t zigbee_hide_bridge_topic : 1; // bit 11 (v9.3.1.1) - SetOption125 - (Zigbee) Hide bridge topic from zigbee topic (use with SetOption89) (1)
uint32_t spare12 : 1; // bit 12
uint32_t spare13 : 1; // bit 13
uint32_t spare14 : 1; // bit 14

View File

@ -557,9 +557,17 @@ void Z_Device::jsonPublishAttrList(const char * json_prefix, const Z_attribute_l
char stemp[TOPSZ];
strlcpy(stemp, friendlyName, sizeof(stemp));
MakeValidMqtt(0, stemp);
snprintf_P(subtopic, sizeof(subtopic), PSTR("%s/%s"), TasmotaGlobal.mqtt_topic, stemp);
if (Settings.flag5.zigbee_hide_bridge_topic) {
snprintf_P(subtopic, sizeof(subtopic), PSTR("%s"), stemp);
} else {
snprintf_P(subtopic, sizeof(subtopic), PSTR("%s/%s"), TasmotaGlobal.mqtt_topic, stemp);
}
} else {
snprintf_P(subtopic, sizeof(subtopic), PSTR("%s/%04X"), TasmotaGlobal.mqtt_topic, shortaddr);
if (Settings.flag5.zigbee_hide_bridge_topic) {
snprintf_P(subtopic, sizeof(subtopic), PSTR("%04X"), shortaddr);
} else {
snprintf_P(subtopic, sizeof(subtopic), PSTR("%s/%04X"), TasmotaGlobal.mqtt_topic, shortaddr);
}
}
if (Settings.flag5.zb_topic_endpoint) {
if (attr_list.isValidSrcEp()) {