Skip to content
Snippets Groups Projects
Commit f6d3bbde authored by Benjamin Cabé's avatar Benjamin Cabé
Browse files

Merge remote-tracking branch 'origin/master'

parents 50d401e0 d4e80bef
No related branches found
No related tags found
No related merge requests found
...@@ -30,7 +30,7 @@ function DeviceDetailCtrl($scope, $routeParams, $timeout, restService, ...@@ -30,7 +30,7 @@ function DeviceDetailCtrl($scope, $routeParams, $timeout, restService,
function onConnect() { function onConnect() {
// Once a connection has been made, make a subscription and send a message. // Once a connection has been made, make a subscription and send a message.
console.log("onConnect"); console.log("onConnect");
client.subscribe("javaonedemo/eclipse-greenhouse-ben/sensors/#"); client.subscribe("javaonedemo/eclipse-greenhouse-ben-flat/sensors/#");
}; };
function onConnectionLost(responseObject) { function onConnectionLost(responseObject) {
...@@ -39,7 +39,7 @@ function DeviceDetailCtrl($scope, $routeParams, $timeout, restService, ...@@ -39,7 +39,7 @@ function DeviceDetailCtrl($scope, $routeParams, $timeout, restService,
console.log("Reconnecting... [" + new Date() + "]"); console.log("Reconnecting... [" + new Date() + "]");
client.connect({ client.connect({
onSuccess: function() { onSuccess: function() {
client.subscribe("javaonedemo/eclipse-greenhouse-ben/sensors/#"); client.subscribe("javaonedemo/eclipse-greenhouse-ben-flat/sensors/#");
} }
}); });
} }
...@@ -58,15 +58,15 @@ function DeviceDetailCtrl($scope, $routeParams, $timeout, restService, ...@@ -58,15 +58,15 @@ function DeviceDetailCtrl($scope, $routeParams, $timeout, restService,
}; };
function tick() { function tick() {
$scope.webcam.src = "http://www.benjamin-cabe.com/webcam.jpg#" + new Date().getTime(); $scope.webcam.src = "http://www.benjamin-cabe.com/webcam.jpg#" + new Date().getTime();
$timeout(tick, 1000); $timeout(tick, 1000);
} }
//tick(); //tick();
$scope.switchLight = function() { $scope.switchLight = function() {
console.log('toggle'); console.log('toggle');
var message = new Messaging.Message(($scope.light.value === "on") ? "off" : "on") ; var message = new Messaging.Message(($scope.light.value === "on") ? "off" : "on");
message.destinationName = "javaonedemo/eclipse-greenhouse-ben/actuators/light"; message.destinationName = "javaonedemo/eclipse-greenhouse-ben-flat/actuators/light";
client.send(message); client.send(message);
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment