Merge pull request #65 from sensebox/fix-mqtt

fix for custom mqtt server
This commit is contained in:
Mario Pesch 2021-02-15 16:21:26 +01:00 committed by GitHub
commit 5e4021d6d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
}; };