mirror of https://github.com/arendst/Tasmota.git
Added SetOption112 - Use friendly name in zigbee topic (use with SetOption89)
This commit is contained in:
parent
1ba755ae51
commit
a9af3baea0
|
@ -131,7 +131,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu
|
||||||
uint32_t alexa_gen_1 : 1; // bit 27 (v8.4.0.3) - SetOption109 - Alexa gen1 mode - if you only have Echo Dot 2nd gen devices
|
uint32_t alexa_gen_1 : 1; // bit 27 (v8.4.0.3) - SetOption109 - Alexa gen1 mode - if you only have Echo Dot 2nd gen devices
|
||||||
uint32_t zb_disable_autobind : 1; // bit 28 (v8.5.0.1) - SetOption110 - disable Zigbee auto-config when pairing new devices
|
uint32_t zb_disable_autobind : 1; // bit 28 (v8.5.0.1) - SetOption110 - disable Zigbee auto-config when pairing new devices
|
||||||
uint32_t buzzer_freq_mode : 1; // bit 29 (v8.5.0.1) - SetOption111 - Use frequency output for buzzer pin instead of on/off signal
|
uint32_t buzzer_freq_mode : 1; // bit 29 (v8.5.0.1) - SetOption111 - Use frequency output for buzzer pin instead of on/off signal
|
||||||
uint32_t spare30 : 1; // bit 30
|
uint32_t zb_topic_fname : 1; // bit 30 (v8.5.0.1) - SetOption112 - Use friendly name in zigbee topic (use with SetOption89)
|
||||||
uint32_t spare31 : 1; // bit 31
|
uint32_t spare31 : 1; // bit 31
|
||||||
};
|
};
|
||||||
} SysBitfield4;
|
} SysBitfield4;
|
||||||
|
|
|
@ -896,9 +896,15 @@ void Z_Devices::jsonPublishFlush(uint16_t shortaddr) {
|
||||||
attr_list.reset(); // clear the attributes
|
attr_list.reset(); // clear the attributes
|
||||||
|
|
||||||
if (Settings.flag4.zigbee_distinct_topics) {
|
if (Settings.flag4.zigbee_distinct_topics) {
|
||||||
char subtopic[16];
|
if (Settings.flag4.zb_topic_fname && fname) {
|
||||||
snprintf_P(subtopic, sizeof(subtopic), PSTR("%04X/" D_RSLT_SENSOR), shortaddr);
|
char frtopic[13];
|
||||||
MqttPublishPrefixTopic_P(TELE, subtopic, Settings.flag.mqtt_sensor_retain);
|
snprintf_P(frtopic, sizeof(frtopic) + strlen(fname), PSTR("tele/%s/" D_RSLT_SENSOR), fname);
|
||||||
|
MqttPublish(frtopic, Settings.flag.mqtt_sensor_retain);
|
||||||
|
} else {
|
||||||
|
char subtopic[16];
|
||||||
|
snprintf_P(subtopic, sizeof(subtopic), PSTR("%04X/" D_RSLT_SENSOR), shortaddr);
|
||||||
|
MqttPublishPrefixTopic_P(TELE, subtopic, Settings.flag.mqtt_sensor_retain);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
MqttPublishPrefixTopic_P(TELE, PSTR(D_RSLT_SENSOR), Settings.flag.mqtt_sensor_retain);
|
MqttPublishPrefixTopic_P(TELE, PSTR(D_RSLT_SENSOR), Settings.flag.mqtt_sensor_retain);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue