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); } }
private void OnMotionDetectionEnd() { Task.Run(() => MotionDetectionEnd?.Invoke(this, EventArgs.Empty)); }
public void End() { MotionDetectionEnd?.Invoke(this, EventArgs.Empty); }