mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 18:56:38 +00:00
Revert Button Topic change
This commit is contained in:
parent
71f0ab7b2c
commit
914c2929f8
@ -494,7 +494,7 @@ void SettingsDefaultSet2()
|
||||
strlcpy(Settings.mqtt_user, MQTT_USER, sizeof(Settings.mqtt_user));
|
||||
strlcpy(Settings.mqtt_pwd, MQTT_PASS, sizeof(Settings.mqtt_pwd));
|
||||
strlcpy(Settings.mqtt_topic, MQTT_TOPIC, sizeof(Settings.mqtt_topic));
|
||||
strlcpy(Settings.button_topic, MQTT_BUTTON_TOPIC, sizeof(Settings.button_topic));
|
||||
strlcpy(Settings.button_topic, "0", sizeof(Settings.button_topic));
|
||||
strlcpy(Settings.mqtt_grptopic, MQTT_GRPTOPIC, sizeof(Settings.mqtt_grptopic));
|
||||
Settings.tele_period = TELE_PERIOD;
|
||||
|
||||
@ -544,7 +544,7 @@ void SettingsDefaultSet2()
|
||||
|
||||
SettingsDefaultSet_3_9_3();
|
||||
|
||||
strlcpy(Settings.switch_topic, MQTT_SWITCH_TOPIC, sizeof(Settings.switch_topic));
|
||||
strlcpy(Settings.switch_topic, "0", sizeof(Settings.switch_topic));
|
||||
|
||||
strlcpy(Settings.web_password, WEB_PASSWORD, sizeof(Settings.web_password));
|
||||
|
||||
|
@ -126,8 +126,6 @@
|
||||
// %topic% token options (also ButtonTopic and SwitchTopic)
|
||||
#define MQTT_TOPIC PROJECT // [Topic] (unique) MQTT device topic
|
||||
#define MQTT_GRPTOPIC "sonoffs" // [GroupTopic] MQTT Group topic
|
||||
#define MQTT_BUTTON_TOPIC "0" // [ButtonTopic] MQTT button topic
|
||||
#define MQTT_SWITCH_TOPIC "0" // [SwitchTopic] MQTT switch topic
|
||||
#define MQTT_CLIENT_ID "DVES_%06X" // [MqttClient] Also fall back topic using Chip Id = last 6 characters of MAC address
|
||||
|
||||
// -- MQTT - Telemetry ----------------------------
|
||||
@ -140,7 +138,7 @@
|
||||
#define DOMOTICZ_UPDATE_TIMER 0 // [DomoticzUpdateTimer] Send relay status (0 = disable, 1 - 3600 seconds) (Optional)
|
||||
|
||||
// -- MQTT - Home Assistant Discovery -------------
|
||||
#define USE_HOME_ASSISTANT // Enable Home Assistant Discovery Support (+1k4 code)
|
||||
#define USE_HOME_ASSISTANT // Enable Home Assistant Discovery Support (+2k code)
|
||||
#define HOME_ASSISTANT_DISCOVERY_PREFIX "homeassistant" // Home Assistant discovery prefix
|
||||
#define HOME_ASSISTANT_DISCOVERY_ENABLE 0 // [SetOption19] Home Assistant Discovery (0 = Disable, 1 = Enable)
|
||||
|
||||
|
@ -637,7 +637,7 @@ bool MqttCommand()
|
||||
if ((data_len > 0) && (data_len < sizeof(Settings.button_topic))) {
|
||||
MakeValidMqtt(0, dataBuf);
|
||||
if (!strcmp(dataBuf, mqtt_client)) payload = 1;
|
||||
strlcpy(Settings.button_topic, (!strcmp(dataBuf,"0")) ? "" : (1 == payload) ? MQTT_BUTTON_TOPIC : dataBuf, sizeof(Settings.button_topic));
|
||||
strlcpy(Settings.button_topic, (!strcmp(dataBuf,"0")) ? "" : (1 == payload) ? mqtt_topic : dataBuf, sizeof(Settings.button_topic));
|
||||
}
|
||||
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, Settings.button_topic);
|
||||
}
|
||||
@ -645,7 +645,7 @@ bool MqttCommand()
|
||||
if ((data_len > 0) && (data_len < sizeof(Settings.switch_topic))) {
|
||||
MakeValidMqtt(0, dataBuf);
|
||||
if (!strcmp(dataBuf, mqtt_client)) payload = 1;
|
||||
strlcpy(Settings.switch_topic, (!strcmp(dataBuf,"0")) ? "" : (1 == payload) ? MQTT_SWITCH_TOPIC : dataBuf, sizeof(Settings.switch_topic));
|
||||
strlcpy(Settings.switch_topic, (!strcmp(dataBuf,"0")) ? "" : (1 == payload) ? mqtt_topic : dataBuf, sizeof(Settings.switch_topic));
|
||||
}
|
||||
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, Settings.switch_topic);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user