예제 #1
0
 public UpperBathroomConfiguration(
     CCToolsDeviceService ccToolsBoardService,
     IDeviceRegistryService deviceService,
     ISchedulerService schedulerService,
     IAreaRegistryService areaService,
     ISettingsService settingsService,
     AutomationFactory automationFactory,
     ActuatorFactory actuatorFactory,
     SensorFactory sensorFactory,
     IMessageBrokerService messageBroker,
     IDeviceMessageBrokerService deviceMessageBrokerService,
     ILogService logService)
 {
     _messageBroker = messageBroker;
     _deviceMessageBrokerService = deviceMessageBrokerService;
     _logService          = logService;
     _ccToolsBoardService = ccToolsBoardService ?? throw new ArgumentNullException(nameof(ccToolsBoardService));
     _deviceService       = deviceService ?? throw new ArgumentNullException(nameof(deviceService));
     _schedulerService    = schedulerService ?? throw new ArgumentNullException(nameof(schedulerService));
     _areaService         = areaService ?? throw new ArgumentNullException(nameof(areaService));
     _settingsService     = settingsService ?? throw new ArgumentNullException(nameof(settingsService));
     _automationFactory   = automationFactory ?? throw new ArgumentNullException(nameof(automationFactory));
     _actuatorFactory     = actuatorFactory ?? throw new ArgumentNullException(nameof(actuatorFactory));
     _sensorFactory       = sensorFactory ?? throw new ArgumentNullException(nameof(sensorFactory));
     _messageBroker       = messageBroker ?? throw new ArgumentNullException(nameof(sensorFactory));
 }
예제 #2
0
        public RemoteSocketService(
            IConfigurationService configurationService,
            IDeviceRegistryService deviceRegistryService,
            ISchedulerService schedulerService,
            ISystemInformationService systemInformationService,
            ILogService logService)
        {
            _configurationService  = configurationService ?? throw new ArgumentNullException(nameof(configurationService));
            _deviceRegistryService = deviceRegistryService ?? throw new ArgumentNullException(nameof(deviceRegistryService));
            if (schedulerService == null)
            {
                throw new ArgumentNullException(nameof(schedulerService));
            }
            _systemInformationService = systemInformationService ?? throw new ArgumentNullException(nameof(systemInformationService));
            if (logService == null)
            {
                throw new ArgumentNullException(nameof(logService));
            }

            // Ensure that the state of the remote switch is restored if the original remote is used
            // or the switch has been removed from the socket and plugged in at another place.
            schedulerService.Register("RCSocketStateSender", TimeSpan.FromMinutes(1), () => RefreshStates());

            _log = logService.CreatePublisher(nameof(RemoteSocketService));
        }
예제 #3
0
 public LivingRoomConfiguration(
     IDeviceRegistryService deviceService,
     IAreaRegistryService areaService,
     CCToolsDeviceService ccToolsBoardService,
     ActuatorFactory actuatorFactory,
     SensorFactory sensorFactory)
 {
     _deviceService       = deviceService ?? throw new ArgumentNullException(nameof(deviceService));
     _areaService         = areaService ?? throw new ArgumentNullException(nameof(areaService));
     _ccToolsBoardService = ccToolsBoardService ?? throw new ArgumentNullException(nameof(ccToolsBoardService));
     _actuatorFactory     = actuatorFactory ?? throw new ArgumentNullException(nameof(actuatorFactory));
     _sensorFactory       = sensorFactory ?? throw new ArgumentNullException(nameof(sensorFactory));
 }
예제 #4
0
 public Configuration(
     IDeviceRegistryService deviceRegistryService,
     IGpioService gpioService,
     IAreaRegistryService areaService,
     ActuatorFactory actuatorFactory,
     SensorFactory sensorFactory,
     AutomationFactory automationFactory,
     IMessageBrokerService messageBroker)
 {
     _deviceRegistryService = deviceRegistryService ?? throw new ArgumentNullException(nameof(deviceRegistryService));
     _gpioService           = gpioService ?? throw new ArgumentNullException(nameof(gpioService));
     _areaService           = areaService ?? throw new ArgumentNullException(nameof(areaService));
     _messageBroker         = messageBroker ?? throw new ArgumentNullException(nameof(messageBroker));
     _actuatorFactory       = actuatorFactory ?? throw new ArgumentNullException(nameof(actuatorFactory));
     _sensorFactory         = sensorFactory ?? throw new ArgumentNullException(nameof(sensorFactory));
     _automationFactory     = automationFactory ?? throw new ArgumentNullException(nameof(automationFactory));
 }
 public LowerBathroomConfiguration(
     IDeviceRegistryService deviceService,
     ISchedulerService schedulerService,
     IAreaRegistryService areaService,
     ISettingsService settingsService,
     AutomationFactory automationFactory,
     ActuatorFactory actuatorFactory,
     SensorFactory sensorFactory)
 {
     _settingsService   = settingsService ?? throw new ArgumentNullException(nameof(settingsService));
     _deviceService     = deviceService ?? throw new ArgumentNullException(nameof(deviceService));
     _schedulerService  = schedulerService ?? throw new ArgumentNullException(nameof(schedulerService));
     _areaService       = areaService ?? throw new ArgumentNullException(nameof(areaService));
     _automationFactory = automationFactory ?? throw new ArgumentNullException(nameof(automationFactory));
     _actuatorFactory   = actuatorFactory ?? throw new ArgumentNullException(nameof(actuatorFactory));
     _sensorFactory     = sensorFactory ?? throw new ArgumentNullException(nameof(sensorFactory));
 }
예제 #6
0
 public ReadingRoomConfiguration(
     IAreaRegistryService areaService,
     IDeviceRegistryService deviceService,
     CCToolsDeviceService ccToolsBoardService,
     AutomationFactory automationFactory,
     ActuatorFactory actuatorFactory,
     SensorFactory sensorFactory,
     IMessageBrokerService messageBroker)
 {
     _messageBroker       = messageBroker ?? throw new ArgumentNullException(nameof(messageBroker));
     _areaService         = areaService ?? throw new ArgumentNullException(nameof(areaService));
     _deviceService       = deviceService ?? throw new ArgumentNullException(nameof(deviceService));
     _ccToolsBoardService = ccToolsBoardService ?? throw new ArgumentNullException(nameof(ccToolsBoardService));
     _automationFactory   = automationFactory ?? throw new ArgumentNullException(nameof(automationFactory));
     _actuatorFactory     = actuatorFactory ?? throw new ArgumentNullException(nameof(actuatorFactory));
     _sensorFactory       = sensorFactory ?? throw new ArgumentNullException(nameof(sensorFactory));
 }
예제 #7
0
        public CCToolsDeviceService(
            IDeviceRegistryService deviceRegistryService,
            II2CBusService i2CBusService,
            IInterruptMonitorService interruptMonitorService,
            IScriptingService scriptingService,
            ILogService log)
        {
            if (scriptingService == null)
            {
                throw new ArgumentNullException(nameof(scriptingService));
            }
            _deviceRegistryService = deviceRegistryService ?? throw new ArgumentNullException(nameof(deviceRegistryService));
            _i2CBusService         = i2CBusService ?? throw new ArgumentNullException(nameof(i2CBusService));
            _log = log?.CreatePublisher(nameof(CCToolsDeviceService)) ?? throw new ArgumentNullException(nameof(log));

            deviceRegistryService.RegisterDeviceFactory(new CCToolsDeviceFactory(this, interruptMonitorService));
        }
예제 #8
0
        public OutpostDeviceService(
            IDeviceRegistryService deviceRegistryService,
            IDeviceMessageBrokerService deviceMessageBroker,
            II2CBusService i2CBusService,
            ISchedulerService schedulerService,
            ILogService logService)
        {
            if (deviceRegistryService == null)
            {
                throw new ArgumentNullException(nameof(deviceRegistryService));
            }
            _i2CBusService       = i2CBusService ?? throw new ArgumentNullException(nameof(i2CBusService));
            _schedulerService    = schedulerService ?? throw new ArgumentNullException(nameof(schedulerService));
            _deviceMessageBroker = deviceMessageBroker ?? throw new ArgumentNullException(nameof(deviceMessageBroker));
            _logService          = logService ?? throw new ArgumentNullException(nameof(logService));

            deviceRegistryService.RegisterDeviceFactory(new OutpostDeviceFactory(this));
        }
예제 #9
0
 public OfficeConfiguration(
     IDeviceRegistryService deviceService,
     IAreaRegistryService areaService,
     IRemoteSocketService remoteSocketService,
     ActuatorFactory actuatorFactory,
     SensorFactory sensorFactory,
     IMessageBrokerService messageBroker,
     IDeviceMessageBrokerService deviceMessageBroker,
     ILogService logService)
 {
     _messageBroker       = messageBroker ?? throw new ArgumentNullException(nameof(messageBroker));
     _deviceMessageBroker = deviceMessageBroker ?? throw new ArgumentNullException(nameof(deviceMessageBroker));
     _logService          = logService ?? throw new ArgumentNullException(nameof(logService));
     _deviceService       = deviceService ?? throw new ArgumentNullException(nameof(deviceService));
     _areaService         = areaService ?? throw new ArgumentNullException(nameof(areaService));
     _remoteSocketService = remoteSocketService ?? throw new ArgumentNullException(nameof(remoteSocketService));
     _actuatorFactory     = actuatorFactory ?? throw new ArgumentNullException(nameof(actuatorFactory));
     _sensorFactory       = sensorFactory ?? throw new ArgumentNullException(nameof(sensorFactory));
 }
예제 #10
0
 public Configuration(
     CCToolsDeviceService ccToolsBoardService,
     IGpioService pi2GpioService,
     IDeviceRegistryService deviceService,
     II2CBusService i2CBusService,
     ISchedulerService schedulerService,
     RemoteSocketService remoteSocketService,
     IContainer containerService,
     ILogService logService)
 {
     _ccToolsBoardService = ccToolsBoardService ?? throw new ArgumentNullException(nameof(ccToolsBoardService));
     _pi2GpioService      = pi2GpioService ?? throw new ArgumentNullException(nameof(pi2GpioService));
     _deviceService       = deviceService ?? throw new ArgumentNullException(nameof(deviceService));
     _i2CBusService       = i2CBusService ?? throw new ArgumentNullException(nameof(i2CBusService));
     _schedulerService    = schedulerService ?? throw new ArgumentNullException(nameof(schedulerService));
     _remoteSocketService = remoteSocketService ?? throw new ArgumentNullException(nameof(remoteSocketService));
     _containerService    = containerService ?? throw new ArgumentNullException(nameof(containerService));
     _logService          = logService ?? throw new ArgumentNullException(nameof(logService));
 }
예제 #11
0
 public OfficeConfiguration(
     IDeviceRegistryService deviceService,
     IAreaRegistryService areaService,
     OutpostDeviceService outpostDeviceService,
     CCToolsDeviceService ccToolsBoardService,
     IRemoteSocketService remoteSocketService,
     ActuatorFactory actuatorFactory,
     SensorFactory sensorFactory,
     IMessageBrokerService messageBroker)
 {
     _messageBroker        = messageBroker ?? throw new ArgumentNullException(nameof(messageBroker));
     _outpostDeviceService = outpostDeviceService ?? throw new ArgumentNullException(nameof(outpostDeviceService));
     _deviceService        = deviceService ?? throw new ArgumentNullException(nameof(deviceService));
     _areaService          = areaService ?? throw new ArgumentNullException(nameof(areaService));
     //_ccToolsBoardService = ccToolsBoardService ?? throw new ArgumentNullException(nameof(ccToolsBoardService));
     _remoteSocketService = remoteSocketService ?? throw new ArgumentNullException(nameof(remoteSocketService));
     _actuatorFactory     = actuatorFactory ?? throw new ArgumentNullException(nameof(actuatorFactory));
     _sensorFactory       = sensorFactory ?? throw new ArgumentNullException(nameof(sensorFactory));
 }
예제 #12
0
 public KitchenConfiguration(
     ISystemEventsService systemEventsService,
     IAreaRegistryService areaService,
     IDeviceRegistryService deviceService,
     CCToolsDeviceService ccToolsDeviceService,
     OutpostDeviceService outpostDeviceService,
     AutomationFactory automationFactory,
     ActuatorFactory actuatorFactory,
     SensorFactory sensorFactory)
 {
     _systemEventsService  = systemEventsService ?? throw new ArgumentNullException(nameof(systemEventsService));
     _areaService          = areaService ?? throw new ArgumentNullException(nameof(areaService));
     _deviceService        = deviceService ?? throw new ArgumentNullException(nameof(deviceService));
     _ccToolsBoardService  = ccToolsDeviceService ?? throw new ArgumentNullException(nameof(ccToolsDeviceService));
     _outpostDeviceService = outpostDeviceService ?? throw new ArgumentNullException(nameof(outpostDeviceService));
     _automationFactory    = automationFactory ?? throw new ArgumentNullException(nameof(automationFactory));
     _actuatorFactory      = actuatorFactory ?? throw new ArgumentNullException(nameof(actuatorFactory));
     _sensorFactory        = sensorFactory ?? throw new ArgumentNullException(nameof(sensorFactory));
 }
예제 #13
0
        public CCToolsDeviceService(IDeviceRegistryService deviceService, II2CBusService i2CBusService, IDeviceMessageBrokerService deviceMessageBrokerService, ILogService log)
        {
            if (i2CBusService == null)
            {
                throw new ArgumentNullException(nameof(i2CBusService));
            }
            if (log == null)
            {
                throw new ArgumentNullException(nameof(log));
            }
            if (deviceService == null)
            {
                throw new ArgumentNullException(nameof(deviceService));
            }

            _deviceService = deviceService;
            _i2CBusService = i2CBusService;
            _deviceMessageBrokerService = deviceMessageBrokerService;
            _log = log.CreatePublisher(nameof(CCToolsDeviceService));
        }
예제 #14
0
 public StoreroomConfiguration(
     IAreaRegistryService areaService,
     IDeviceRegistryService deviceService,
     CCToolsDeviceService ccToolsBoardService,
     ITimerService timerService,
     ITwitterClientService twitterClientService,
     AutomationFactory automationFactory,
     ActuatorFactory actuatorFactory,
     SensorFactory sensorFactory,
     ILogService logService)
 {
     _areaService          = areaService ?? throw new ArgumentNullException(nameof(areaService));
     _deviceService        = deviceService ?? throw new ArgumentNullException(nameof(deviceService));
     _ccToolsBoardService  = ccToolsBoardService ?? throw new ArgumentNullException(nameof(ccToolsBoardService));
     _timerService         = timerService ?? throw new ArgumentNullException(nameof(timerService));
     _twitterClientService = twitterClientService ?? throw new ArgumentNullException(nameof(twitterClientService));
     _automationFactory    = automationFactory ?? throw new ArgumentNullException(nameof(automationFactory));
     _actuatorFactory      = actuatorFactory ?? throw new ArgumentNullException(nameof(actuatorFactory));
     _sensorFactory        = sensorFactory ?? throw new ArgumentNullException(nameof(sensorFactory));
     _logService           = logService ?? throw new ArgumentNullException(nameof(logService));
 }
예제 #15
0
 public KitchenConfiguration(
     ISystemEventsService systemEventsService,
     IAreaRegistryService areaService,
     IDeviceRegistryService deviceService,
     CCToolsDeviceService ccToolsDeviceService,
     AutomationFactory automationFactory,
     ActuatorFactory actuatorFactory,
     SensorFactory sensorFactory,
     IMessageBrokerService messageBroker,
     IDeviceMessageBrokerService deviceMessageBrokerService,
     ILogService logService)
 {
     _messageBroker = messageBroker ?? throw new ArgumentNullException(nameof(messageBroker));
     _deviceMessageBrokerService = deviceMessageBrokerService;
     _logService          = logService;
     _systemEventsService = systemEventsService ?? throw new ArgumentNullException(nameof(systemEventsService));
     _areaService         = areaService ?? throw new ArgumentNullException(nameof(areaService));
     _deviceService       = deviceService ?? throw new ArgumentNullException(nameof(deviceService));
     _ccToolsBoardService = ccToolsDeviceService ?? throw new ArgumentNullException(nameof(ccToolsDeviceService));
     _automationFactory   = automationFactory ?? throw new ArgumentNullException(nameof(automationFactory));
     _actuatorFactory     = actuatorFactory ?? throw new ArgumentNullException(nameof(actuatorFactory));
     _sensorFactory       = sensorFactory ?? throw new ArgumentNullException(nameof(sensorFactory));
 }