Inheritance: CCToolsBoardBase, IBinaryOutputController
コード例 #1
0
        public HSPE16OutputOnly RegisterHSPE16OutputOnly(Enum id, I2CSlaveAddress address)
        {
            var device = new HSPE16OutputOnly(DeviceIdFactory.CreateIdFrom(id), address, _i2CBusService);
            _deviceService.AddDevice(device);

            return device;
        }
コード例 #2
0
        public HSPE16OutputOnly CreateHSPE16OutputOnly(Enum id, int address)
        {
            var device = new HSPE16OutputOnly(id.ToString(), address, _i2CBus, _notificationHandler) { AutomaticallyFetchState = true };
            _ioBoardManager.Add(id, device);

            return device;
        }
コード例 #3
0
        public HSPE16OutputOnly CreateHSPE16OutputOnly(Enum id, I2CSlaveAddress address)
        {
            var device = new HSPE16OutputOnly(DeviceIdFactory.CreateIdFrom(id), address, _i2CBus);

            _controller.AddDevice(device);

            return(device);
        }
コード例 #4
0
ファイル: CCToolsBoardService.cs プロジェクト: v1ku/HA4IoT
        public HSPE16OutputOnly RegisterHSPE16OutputOnly(Enum id, I2CSlaveAddress address)
        {
            var device = new HSPE16OutputOnly(DeviceIdFactory.CreateIdFrom(id), address, _i2CBusService);

            _deviceService.AddDevice(device);

            return(device);
        }
コード例 #5
0
        public HSPE16OutputOnly RegisterHSPE16OutputOnly(string id, I2CSlaveAddress address)
        {
            var device = new HSPE16OutputOnly(id, address, _i2CBusService, _deviceMessageBrokerService, _log);

            _deviceService.AddDevice(device);

            return(device);
        }
コード例 #6
0
        private void SetupStairsLamps(IArea room, HSPE16OutputOnly hspe16FloorAndLowerBathroom)
        {
            var output = new LogicalBinaryOutput()
                .WithOutput(hspe16FloorAndLowerBathroom[HSPE16Pin.GPIO8])
                .WithOutput(hspe16FloorAndLowerBathroom[HSPE16Pin.GPIO9])
                .WithOutput(hspe16FloorAndLowerBathroom[HSPE16Pin.GPIO10])
                .WithOutput(hspe16FloorAndLowerBathroom[HSPE16Pin.GPIO11])
                .WithOutput(hspe16FloorAndLowerBathroom[HSPE16Pin.GPIO13])
                .WithOutput(hspe16FloorAndLowerBathroom[HSPE16Pin.GPIO12])
                .WithInvertedState();

            _actuatorFactory.RegisterLamp(room, Floor.LampStairs, output);

            _automationFactory.RegisterConditionalOnAutomation(room, Floor.LampStairsAutomation)
                .WithActuator(room.GetLamp(Floor.LampStairs))
                .WithOnAtNightRange()
                .WithOffBetweenRange(TimeSpan.FromHours(23), TimeSpan.FromHours(4));
        }