private void StartTimeout(object sender, EventArgs e) { _timeout = _timer.In(_slowDuration).Do(() => { _actuator.ApplyState("2"); _timeout = _timer.In(_fastDuration).Do(() => _actuator.TurnOff()); }); }
private void Start() { _powerGpioPin.Write(BinaryState.High); _movingDuration.Restart(); _autoOffTimer?.Cancel(); _autoOffTimer = _timer.In(_autoOffTimeout).Do(Stop); }
private void HandleIsEnabledStateChanged(IHomeAutomationTimer timer, INotificationHandler notificationHandler) { if (!IsEnabled) { notificationHandler.PublishFrom(this, NotificationType.Info, "'{0}' disabled for 1 hour.", Id); _autoEnableAction = timer.In(TimeSpan.FromHours(1)).Do(() => IsEnabled = true); } else { _autoEnableAction?.Cancel(); } }
private void StartTimeout() { _turnOffTimeout = _timer.In(_duration).Do(TurnOff); }