コード例 #1
0
        public void OptimizePaths(bool returnRouteOptimization)
        {
            using (var stateWatcher = new ControllerNotificationWatcher(this))
            {
                Manager.HealNetwork(HomeId.Value, returnRouteOptimization);

                //TODO: figure out final state
                stateWatcher.LogChangesForever();
            }
        }
コード例 #2
0
        public void Reset()
        {
            //TODO: clear Roomie representation of devices

            using (var stateWatcher = new ControllerNotificationWatcher(this))
            {
                Manager.ResetController(HomeId.Value);

                stateWatcher.WaitUntilEventType(ZWNotification.Type.NodeQueriesComplete, ZWNotification.Type.EssentialNodeQueriesComplete);
            }
        }
コード例 #3
0
        public void Connect()
        {
            using (var watcher = new ControllerNotificationWatcher(this))
            {
                Manager.AddDriver(_serialPortName);

                watcher.WaitUntilEventType(ZWNotification.Type.NodeQueriesComplete, ZWNotification.Type.EssentialNodeQueriesComplete);
            }

            Load();
            Connected();
        }
コード例 #4
0
        public override void RemoveDevice(Device device)
        {
            var zWaveDevice = device as OpenZWaveDevice;

            using (var watcher = new ControllerNotificationWatcher(this))
            {
                Manager.RemoveFailedNode(HomeId.Value, zWaveDevice.Id);

                watcher.WaitUntilEventType(ZWNotification.Type.NodeRemoved);
            }

            _devices.Remove(zWaveDevice);
        }
コード例 #5
0
ファイル: OpenZWaveDevice.cs プロジェクト: Mavtak/roomie
        public void OptimizePaths(bool returnRouteOptimization)
        {
            //TODO: remove the need for this cast
            var network = ((OpenZWaveNetwork)Network);
            var homeId  = network.HomeId.Value;

            using (var stateWatcher = new ControllerNotificationWatcher(network))
            {
                Manager.HealNetworkNode(homeId, Id, returnRouteOptimization);

                //TODO: figure out final state
                stateWatcher.LogChangesForever();
            }
        }
コード例 #6
0
        public override Device RemoveDevice()
        {
            OpenZWaveDevice device = null;

            using (var watcher = new ControllerNotificationWatcher(this))
            {
                Manager.RemoveNode(HomeId.Value);

                watcher.ProcessChanges(notification =>
                {
                    if (notification.Type == ZWNotification.Type.NodeRemoved)
                    {
                        device = notification.Device;
                        return(ControllerNotificationWatcher.ProcessAction.Quit);
                    }

                    return(ControllerNotificationWatcher.ProcessAction.Continue);
                });
            }

            return(device);
        }
コード例 #7
0
ファイル: OpenZWaveNetwork.cs プロジェクト: Mavtak/roomie
        public override Device AddDevice()
        {
            OpenZWaveDevice device = null;

            using (var watcher = new ControllerNotificationWatcher(this))
            {
                Manager.AddNode(HomeId.Value, true);

                watcher.ProcessChanges(notification =>
                {
                    if (notification.Type == ZWNotification.Type.NodeAdded)
                    {
                        device = notification.Device;
                        return ControllerNotificationWatcher.ProcessAction.Quit;
                    }

                    return ControllerNotificationWatcher.ProcessAction.Continue;
                });
            }

            return device;
        }
コード例 #8
0
ファイル: OpenZWaveNetwork.cs プロジェクト: Mavtak/roomie
        public void Connect()
        {
            using (var watcher = new ControllerNotificationWatcher(this))
            {
                Manager.AddDriver(_serialPortName);

                watcher.WaitUntilEventType(ZWNotification.Type.NodeQueriesComplete, ZWNotification.Type.EssentialNodeQueriesComplete);
            }

            Load();
            Connected();
        }
コード例 #9
0
ファイル: OpenZWaveNetwork.cs プロジェクト: Mavtak/roomie
        public void Reset()
        {
            //TODO: clear Roomie representation of devices

            using (var stateWatcher = new ControllerNotificationWatcher(this))
            {
                Manager.ResetController(HomeId.Value);

                stateWatcher.WaitUntilEventType(ZWNotification.Type.NodeQueriesComplete, ZWNotification.Type.EssentialNodeQueriesComplete);
            }
        }
コード例 #10
0
ファイル: OpenZWaveNetwork.cs プロジェクト: Mavtak/roomie
        public override void RemoveDevice(Device device)
        {
            var zWaveDevice = device as OpenZWaveDevice;

            using (var watcher = new ControllerNotificationWatcher(this))
            {
                Manager.RemoveFailedNode(HomeId.Value, zWaveDevice.Id);

                watcher.WaitUntilEventType(ZWNotification.Type.NodeRemoved);
            }

            _devices.Remove(zWaveDevice);
        }
コード例 #11
0
ファイル: OpenZWaveNetwork.cs プロジェクト: Mavtak/roomie
        public void OptimizePaths(bool returnRouteOptimization)
        {
            using (var stateWatcher = new ControllerNotificationWatcher(this))
            {
                Manager.HealNetwork(HomeId.Value, returnRouteOptimization);

                //TODO: figure out final state
                stateWatcher.LogChangesForever();
            }
        }
コード例 #12
0
ファイル: OpenZWaveDevice.cs プロジェクト: Mavtak/roomie
        public void OptimizePaths(bool returnRouteOptimization)
        {
            //TODO: remove the need for this cast
            var network = ((OpenZWaveNetwork)Network);
            var homeId = network.HomeId.Value;

            using (var stateWatcher = new ControllerNotificationWatcher(network))
            {
                Manager.HealNetworkNode(homeId, Id, returnRouteOptimization);

                //TODO: figure out final state
                stateWatcher.LogChangesForever();
            }
        }