private void DispatchEvents(object sender, BinaryStateChangedEventArgs eventArgs)
 {
     // The relay at the motion detector is awlays held to high.
     // The signal is set to false if motion is detected.
     if (eventArgs.NewState == BinaryState.Low)
     {
         MotionDetectionBegin?.Invoke(this, EventArgs.Empty);
     }
     else
     {
         MotionDetectionEnd?.Invoke(this, EventArgs.Empty);
     }
 }
예제 #2
0
 private void OnMotionDetectionEnd()
 {
     Task.Run(() => MotionDetectionEnd?.Invoke(this, EventArgs.Empty));
 }
예제 #3
0
 public void End()
 {
     MotionDetectionEnd?.Invoke(this, EventArgs.Empty);
 }