Basic MQTT configuration implementation. Still needs username/pwd and

MQTT screen helper.
This commit is contained in:
Admin
2016-11-11 16:42:20 -06:00
parent 7d39b79e05
commit 3eba9b9245
8 changed files with 216 additions and 1 deletions

View File

@@ -680,6 +680,22 @@ app.controller('SystemController', function ($scope, $location, $http, $window,
}
}
};
$scope.addMQTTtoSettings = function (newmqttname, newmqttip) {
if($scope.bridge.settings.mqttaddress == null) {
$scope.bridge.settings.mqttaddress = { devices: [] };
}
var newmqtt = {name: newmqttname, ip: newmqttip }
$scope.bridge.settings.mqttaddress.devices.push(newmqtt);
$scope.newmqttname = null;
$scope.newmqttip = null;
};
$scope.removeMQTTtoSettings = function (mqttname, mqttip) {
for(var i = $scope.bridge.settings.mqttaddress.devices.length - 1; i >= 0; i--) {
if($scope.bridge.settings.mqttaddress.devices[i].name === mqttname && $scope.bridge.settings.mqttaddress.devices[i].ip === mqttip) {
$scope.bridge.settings.mqttaddress.devices.splice(i, 1);
}
}
};
$scope.bridgeReinit = function () {
bridgeService.reinit();
};