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 OnMotionDetectionBegin() { Task.Run(() => MotionDetectionBegin?.Invoke(this, EventArgs.Empty)); }
public void Begin() { MotionDetectionBegin?.Invoke(this, EventArgs.Empty); }