mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-30 22:26:35 +00:00
Remove topic from local sensors
Remove topic from local sensors in DisplayMode 2/3 (#5212)
This commit is contained in:
parent
e16178d912
commit
bc5db6a079
@ -699,7 +699,7 @@ void DisplayJsonValue(const char *topic, const char* device, const char* mkey, c
|
|||||||
|
|
||||||
memset(spaces, 0x20, sizeof(spaces));
|
memset(spaces, 0x20, sizeof(spaces));
|
||||||
spaces[sizeof(spaces) -1] = '\0';
|
spaces[sizeof(spaces) -1] = '\0';
|
||||||
snprintf_P(source, sizeof(source), PSTR("%s/%s%s"), topic, mkey, spaces); // pow1/Voltage
|
snprintf_P(source, sizeof(source), PSTR("%s%s%s%s"), topic, (strlen(topic))?"/":"", mkey, spaces); // pow1/Voltage or Voltage if topic is empty (local sensor)
|
||||||
|
|
||||||
int quantity_code = GetCommandCode(quantity, sizeof(quantity), mkey, kSensorQuantity);
|
int quantity_code = GetCommandCode(quantity, sizeof(quantity), mkey, kSensorQuantity);
|
||||||
if ((-1 == quantity_code) || !strcmp_P(mkey, S_RSLT_POWER)) { // Ok: Power, Not ok: POWER
|
if ((-1 == quantity_code) || !strcmp_P(mkey, S_RSLT_POWER)) { // Ok: Power, Not ok: POWER
|
||||||
@ -867,7 +867,9 @@ bool DisplayMqttData(void)
|
|||||||
void DisplayLocalSensor(void)
|
void DisplayLocalSensor(void)
|
||||||
{
|
{
|
||||||
if ((Settings.display_mode &0x02) && (0 == tele_period)) {
|
if ((Settings.display_mode &0x02) && (0 == tele_period)) {
|
||||||
DisplayAnalyzeJson(mqtt_topic, mqtt_data);
|
char no_topic[1] = { 0 };
|
||||||
|
// DisplayAnalyzeJson(mqtt_topic, mqtt_data); // Add local topic
|
||||||
|
DisplayAnalyzeJson(no_topic, mqtt_data); // Discard any topic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user