mirror of
https://github.com/openstf/stf
synced 2025-10-05 10:39:25 +02:00
17 lines
545 B
JavaScript
17 lines
545 B
JavaScript
module.exports = function DeviceControlCtrl($scope, $routeParams, $location, DeviceService, GroupService, ControlService) {
|
|
$scope.control = null
|
|
$scope.device = {
|
|
promise: DeviceService.get($routeParams.serial)
|
|
.then(function(device) {
|
|
return GroupService.invite(device)
|
|
})
|
|
.then(function(device) {
|
|
$scope.device.value = device
|
|
$scope.control = ControlService.forOne(device, device.channel)
|
|
return device
|
|
})
|
|
.catch(function(err) {
|
|
$location.path('/')
|
|
})
|
|
}
|
|
}
|