private void HandleAlarmTelemetry(AlarmUpdated alarmTelemetry)
 {
     if (alarmStatus != alarmTelemetry.Status)
     {
         alarmStatus = alarmTelemetry.Status;
         UpdateCurrentStatus();
     }
 }
 protected override async Task HandleAlarmTelemetry(AlarmUpdated alarmTelemetry)
 {
     if (alarmTelemetry.Status == AlarmStatus.Active && lastEmailSentFor.Value != AlarmStatus.Active)
     {
         lastEmailSentFor = AlarmStatus.Active;
         //Someone broke into our house, inform the owner!!
         await SendAlertMail();
     }
     else if (alarmTelemetry.Status != AlarmStatus.Active && lastEmailSentFor != AlarmStatus.Off)
     {
         //The alarm was turned off
         lastEmailSentFor = AlarmStatus.Off;
         await SendRecoveryMail();
     }
 }
Esempio n. 3
0
 protected override async Task HandleAlarmTelemetry(AlarmUpdated alarmTelemetry)
 {
     await Log($"The alarm is now {alarmTelemetry.Status.ToString().ToUpperInvariant()}");
 }
        protected override async Task HandleAlarmTelemetry(AlarmUpdated alarmTelemetry)
        {
            var notification = CreateAlarmNotification(alarmTelemetry.Status);

            await SendNotificationToClients(notification);
        }
 protected override Task HandleAlarmTelemetry(AlarmUpdated alarmTelemetry)
 {
     Console.WriteLine($"The alarm is now {alarmTelemetry.Status.ToString().ToUpperInvariant()}");
     return(Task.CompletedTask);
 }
Esempio n. 6
0
 protected virtual Task HandleAlarmTelemetry(AlarmUpdated alarmTelemetry)
 {
     return(Task.CompletedTask);
 }