HA4IoT.Automations.TurnOnAndOffAutomation.CancelTimeoutIfMotionDetectorDeactivated C# (CSharp) Méthode

CancelTimeoutIfMotionDetectorDeactivated() private méthode

private CancelTimeoutIfMotionDetectorDeactivated ( IMotionDetector motionDetector, SettingValueChangedEventArgs eventArgs ) : void
motionDetector IMotionDetector
eventArgs HA4IoT.Contracts.Services.Settings.SettingValueChangedEventArgs
Résultat void
        private void CancelTimeoutIfMotionDetectorDeactivated(IMotionDetector motionDetector, SettingValueChangedEventArgs eventArgs)
        {
            if (eventArgs.SettingName != "IsEnabled")
            {
                return;
            }

            if (!motionDetector.Settings.IsEnabled)
            {
                lock (_syncRoot)
                {
                    _turnOffTimeout?.Cancel();
                }
            }
        }