Example #1
0
        public TurnOnAndOffAutomation(AutomationId id, IHomeAutomationTimer timer)
            : base(id)
        {
            if (timer == null)
            {
                throw new ArgumentNullException(nameof(timer));
            }

            _timer           = timer;
            _wrappedSettings = new TurnOnAndOffAutomationSettingsWrapper(Settings);
        }
        public TurnOnAndOffAutomation(AutomationId id, IDateTimeService dateTimeService, ISchedulerService schedulerService)
            : base(id)
        {
            if (dateTimeService == null)
            {
                throw new ArgumentNullException(nameof(dateTimeService));
            }
            if (schedulerService == null)
            {
                throw new ArgumentNullException(nameof(schedulerService));
            }

            _dateTimeService  = dateTimeService;
            _schedulerService = schedulerService;

            _wrappedSettings = new TurnOnAndOffAutomationSettingsWrapper(Settings);
        }