Skip to content

Commit

Permalink
Added "Connection Status Messages" boolean setting under "MQTT Remote…
Browse files Browse the repository at this point in the history
… Control" settings category.
  • Loading branch information
bp2008 committed Nov 21, 2022
1 parent b4a816d commit 5f61d5e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions ui3/ui3.js
Original file line number Diff line number Diff line change
Expand Up @@ -2615,6 +2615,14 @@ var defaultSettings =
, onChange: OnChange_ui3_mqttClientEnabled
, category: "MQTT Remote Control"
}
, {
key: "ui3_mqttStatusToasts"
, value: "1"
, inputType: "checkbox"
, label: 'Connection Status Messages'
, hint: 'Disabling connection status messages does not suppress error messages related to the MQTT connection.'
, category: "MQTT Remote Control"
}
, {
key: "ui3_comment_mqtt_advanced"
, value: ""
Expand Down Expand Up @@ -31626,7 +31634,8 @@ function MqttClient()
try
{
isConnected = true;
toaster.Success("Connected to MQTT broker.", 3000);
if (settings.ui3_mqttStatusToasts === "1")
toaster.Success("Connected to MQTT broker.", 3000);
if (hasDisconnected)
{
console.log("MqttClient just finished connecting, but disconnect() has already been called. Disconnecting now.");
Expand Down Expand Up @@ -31673,7 +31682,10 @@ function MqttClient()
{
isConnected = false;
if (arg.errorCode === 0)
toaster.Info("MQTT Disconnected", 3000);
{
if (settings.ui3_mqttStatusToasts === "1")
toaster.Info("MQTT Disconnected", 3000);
}
else
toaster.Warning("MQTT Disconnected: " + arg.errorCode + " " + arg.errorMessage, 10000);
}
Expand Down

0 comments on commit 5f61d5e

Please sign in to comment.