public MainScheduler(IWaterTemperatureDevice device) { _device = device; var allTimes = new[] { new StatusWithTime { Type = WaterTempChannels.Floor.ToGlobalType(), Hour = 7, Minutes = 30, Status = 1 }, new StatusWithTime { Type = WaterTempChannels.Floor.ToGlobalType(), Hour = 10, Minutes = 0, Status = 0 }, new StatusWithTime { Type = WaterTempChannels.Floor.ToGlobalType(), Hour = 18, Minutes = 0, Status = 1 }, new StatusWithTime { Type = WaterTempChannels.Floor.ToGlobalType(), Hour = 19, Minutes = 30, Status = 0 }, new StatusWithTime { Type = WaterTempChannels.Floor.ToGlobalType(), Hour = 21, Minutes = 0, Status = 1 }, new StatusWithTime { Type = WaterTempChannels.Floor.ToGlobalType(), Hour = 22, Minutes = 0, Status = 0 } }; SetQueue(allTimes); //device.ChannelStatusesChanged += DeviceOnChannelStatusesChanged; _timer = new Timer(CheckScheduledTimes, this, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10)); }
public Listener(IWaterTemperatureDevice device, IServiceProvider serviceProvider, ILogger <Listener> logger) { _serviceProvider = serviceProvider; device.ChannelStatusesChanged += Temperature_ChannelStatusesChanged; _logger = logger; }
public SetStatusCommandHandler(IWaterTemperatureDevice temperature) { _temperature = temperature; }
public GetTempQueryHandler(IWaterTemperatureDevice temperature) { _temperature = temperature; }