mirror of https://github.com/arendst/Tasmota.git
Enable group status messages
Add status message to former declined group commands (#5145)
This commit is contained in:
parent
ab11096f3a
commit
3a59084377
|
@ -2,6 +2,7 @@
|
||||||
* Change image name BE_MINIMAL to FIRMWARE_MINIMAL (#5106)
|
* Change image name BE_MINIMAL to FIRMWARE_MINIMAL (#5106)
|
||||||
* Change image names USE_xyz to FIRMWARE_xyz (#5106)
|
* Change image names USE_xyz to FIRMWARE_xyz (#5106)
|
||||||
* Add command SerialDelimiter 128 to filter reception of only characters between ASCII 32 and 127 (#5131)
|
* Add command SerialDelimiter 128 to filter reception of only characters between ASCII 32 and 127 (#5131)
|
||||||
|
* Add status message to former declined group commands (#5145)
|
||||||
*
|
*
|
||||||
* 6.4.1.14 20190203
|
* 6.4.1.14 20190203
|
||||||
* Add SetOption32 until SetOption49 diagnostic information to Status 3 report as replacement for second property value in SetOption property name
|
* Add SetOption32 until SetOption49 diagnostic information to Status 3 report as replacement for second property value in SetOption property name
|
||||||
|
|
|
@ -1126,8 +1126,8 @@ void MqttDataHandler(char* topic, uint8_t* data, unsigned int data_len)
|
||||||
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_ASTERIX, command, index);
|
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_ASTERIX, command, index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((CMND_HOSTNAME == command_code) && !grpflg) {
|
else if (CMND_HOSTNAME == command_code) {
|
||||||
if ((data_len > 0) && (data_len < sizeof(Settings.hostname))) {
|
if (!grpflg && (data_len > 0) && (data_len < sizeof(Settings.hostname))) {
|
||||||
strlcpy(Settings.hostname, (SC_DEFAULT == Shortcut(dataBuf)) ? WIFI_HOSTNAME : dataBuf, sizeof(Settings.hostname));
|
strlcpy(Settings.hostname, (SC_DEFAULT == Shortcut(dataBuf)) ? WIFI_HOSTNAME : dataBuf, sizeof(Settings.hostname));
|
||||||
if (strstr(Settings.hostname,"%")) {
|
if (strstr(Settings.hostname,"%")) {
|
||||||
strlcpy(Settings.hostname, WIFI_HOSTNAME, sizeof(Settings.hostname));
|
strlcpy(Settings.hostname, WIFI_HOSTNAME, sizeof(Settings.hostname));
|
||||||
|
|
|
@ -694,8 +694,8 @@ bool MqttCommand(void)
|
||||||
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_SVALUE, command, index, fingerprint);
|
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_SVALUE, command, index, fingerprint);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else if ((CMND_MQTTCLIENT == command_code) && !grpflg) {
|
else if (CMND_MQTTCLIENT == command_code) {
|
||||||
if ((data_len > 0) && (data_len < sizeof(Settings.mqtt_client))) {
|
if (!grpflg && (data_len > 0) && (data_len < sizeof(Settings.mqtt_client))) {
|
||||||
strlcpy(Settings.mqtt_client, (SC_DEFAULT == Shortcut(dataBuf)) ? MQTT_CLIENT_ID : dataBuf, sizeof(Settings.mqtt_client));
|
strlcpy(Settings.mqtt_client, (SC_DEFAULT == Shortcut(dataBuf)) ? MQTT_CLIENT_ID : dataBuf, sizeof(Settings.mqtt_client));
|
||||||
restart_flag = 2;
|
restart_flag = 2;
|
||||||
}
|
}
|
||||||
|
@ -766,8 +766,8 @@ bool MqttCommand(void)
|
||||||
}
|
}
|
||||||
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, Settings.mqtt_grptopic);
|
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, Settings.mqtt_grptopic);
|
||||||
}
|
}
|
||||||
else if ((CMND_TOPIC == command_code) && !grpflg) {
|
else if (CMND_TOPIC == command_code) {
|
||||||
if ((data_len > 0) && (data_len < sizeof(Settings.mqtt_topic))) {
|
if (!grpflg && (data_len > 0) && (data_len < sizeof(Settings.mqtt_topic))) {
|
||||||
MakeValidMqtt(0, dataBuf);
|
MakeValidMqtt(0, dataBuf);
|
||||||
if (!strcmp(dataBuf, mqtt_client)) SetShortcut(dataBuf, SC_DEFAULT);
|
if (!strcmp(dataBuf, mqtt_client)) SetShortcut(dataBuf, SC_DEFAULT);
|
||||||
strlcpy(stemp1, (SC_DEFAULT == Shortcut(dataBuf)) ? MQTT_TOPIC : dataBuf, sizeof(stemp1));
|
strlcpy(stemp1, (SC_DEFAULT == Shortcut(dataBuf)) ? MQTT_TOPIC : dataBuf, sizeof(stemp1));
|
||||||
|
@ -780,8 +780,8 @@ bool MqttCommand(void)
|
||||||
}
|
}
|
||||||
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, Settings.mqtt_topic);
|
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, Settings.mqtt_topic);
|
||||||
}
|
}
|
||||||
else if ((CMND_BUTTONTOPIC == command_code) && !grpflg) {
|
else if (CMND_BUTTONTOPIC == command_code) {
|
||||||
if ((data_len > 0) && (data_len < sizeof(Settings.button_topic))) {
|
if (!grpflg && (data_len > 0) && (data_len < sizeof(Settings.button_topic))) {
|
||||||
MakeValidMqtt(0, dataBuf);
|
MakeValidMqtt(0, dataBuf);
|
||||||
if (!strcmp(dataBuf, mqtt_client)) SetShortcut(dataBuf, SC_DEFAULT);
|
if (!strcmp(dataBuf, mqtt_client)) SetShortcut(dataBuf, SC_DEFAULT);
|
||||||
switch (Shortcut(dataBuf)) {
|
switch (Shortcut(dataBuf)) {
|
||||||
|
|
Loading…
Reference in New Issue