fix for custom mqtt server

This commit is contained in:
Mario 2021-02-15 10:47:01 +01:00
parent 1963ca3051
commit 269afa4b76
2 changed files with 4 additions and 5 deletions

View File

@ -49,9 +49,6 @@ Blockly.Blocks["sensebox_mqtt_setup"] = {
break; break;
case "custom": case "custom":
this.getField('server').setValue("server");
this.getField('port').setValue("port");
this.getField('passwordmsg').setValue(Blockly.Msg.senseBox_mqtt_password);
break; break;
default: default:
@ -86,3 +83,4 @@ Blockly.Blocks["sensebox_mqtt_subscribe"] = {
this.setOutput(true, null); this.setOutput(true, null);
} }
}; };

View File

@ -38,7 +38,7 @@ Blockly.Arduino.sensebox_mqtt_publish = function (block) {
Blockly.Arduino.definitions_['mqtt_' + feed_client + ''] = 'Adafruit_MQTT_Publish ' + feed_client + ' = Adafruit_MQTT_Publish(&mqtt, "/"USERNAME"/' + feedname + '");' Blockly.Arduino.definitions_['mqtt_' + feed_client + ''] = 'Adafruit_MQTT_Publish ' + feed_client + ' = Adafruit_MQTT_Publish(&mqtt, "/"USERNAME"/' + feedname + '");'
break; break;
case 'custom': case 'custom':
Blockly.Arduino.definitions_['mqtt_' + feed_client + ''] = 'Adafruit_MQTT_Publish ' + feed_client + ' = Adafruit_MQTT_Publish(&mqtt, ' + feedname + ');' Blockly.Arduino.definitions_['mqtt_' + feed_client + ''] = 'Adafruit_MQTT_Publish ' + feed_client + ' = Adafruit_MQTT_Publish(&mqtt, "' + feedname + '");'
break; break;
default: default:
break; break;
@ -78,3 +78,4 @@ Blockly.Arduino.sensebox_mqtt_subscribe = function (block) {
var code = ''; var code = '';
return code; return code;
}; };