(()=>{function i(c,t,e,n,i){function o(){var i=t.deviceId;return c.child.config&&c.child.config.device&&c.child.config.device.id?c.child.config.device.id:i}function a(i,t){if(i){for(var c=t.split("."),e=i[c[0]],n=1;n<c.length&&e;n++)e=e[c[n]];return"".concat(e)}}function r(t){_.forEach(c.switches,function(i){i.value=a(t,i.property)})}var d;c.$watch("child.config.switches",function(i){c.switches=i,i=o(),n.detail(i).then(function(i){return e.getResData(i)}).then(r)}),c.getValue=a,d=["/managedobjects/",o()].join(""),i.addListener(c.$id,d,i.realtimeActions().UPDATE,function(i,t){r(t)}),i.start(c.$id,d),c.$on("$destroy",function(){i.stop(c.$id,d)})}i.$inject=["$scope","$routeParams","c8yBase","c8yInventory","c8yRealtime"],angular.module("c8y.switchDisplay").controller("switchDisplayCtrl",i)})();