Exemple #1
0
        public async Task <IActionResult> Post(AlarmConfiguration configuration)
        {
            var ct = new CancellationToken();
            await _alarmWorker.StopAsync(ct);

            _alarmWorker.AlarmConfiguration = configuration;
            await _alarmWorker.StartAsync(ct);

            return(Ok(_alarmWorker.AlarmConfiguration));
        }
 public MorningAlarmWorker(IPlayerActor playerActor, ILogger <MorningAlarmWorker> logger, ILibraryActor libraryActor)
 {
     this.playerActor        = playerActor;
     this.logger             = logger;
     this.libraryActor       = libraryActor;
     this.previousVolume     = playerActor.BassActor.CurrentVolume;
     this.AlarmConfiguration = new AlarmConfiguration()
     {
         AlarmTime                 = TimeSpan.FromHours(6),
         AlarmMissThreshold        = TimeSpan.FromMinutes(20),
         AlarmAutoTurnOffCheckTime = TimeSpan.FromHours(8),
         Enabled     = true,
         MediaItemId = 1
     };
 }