@@ -13,33 +13,31 @@ namespace CodeCasa.AutomationPipelines.Lights.Extensions
1313 public static class LightTransitionNodeExtensions
1414 {
1515 /// <summary>
16- /// Creates a timeout node that automatically turns off the light after the specified time span.
17- /// The timeout is not reset by any external events.
16+ /// Wraps the pipeline node to automatically transition to an 'Off' state after a specified duration of inactivity.
1817 /// </summary>
19- /// <param name="node">The pipeline node to wrap with timeout behavior .</param>
20- /// <param name="timeSpan">The duration after which the light will turn off.</param>
21- /// <param name="scheduler">The scheduler to use for timing operations.</param>
22- /// <returns>A new pipeline node that wraps the original node with timeout behavior .</returns>
18+ /// <param name="node">The source pipeline node.</param>
19+ /// <param name="timeSpan">The duration to wait before turning off.</param>
20+ /// <param name="scheduler">The scheduler used for timing operations.</param>
21+ /// <returns>A new pipeline node that times out to 'Off' .</returns>
2322 public static IPipelineNode < LightTransition > TurnOffAfter ( this IPipelineNode < LightTransition > node ,
2423 TimeSpan timeSpan , IScheduler scheduler )
2524 {
26- return new ResettableTimeoutNode < Unit > ( node , timeSpan , Observable . Empty < Unit > ( ) , scheduler ) ;
25+ return new ResettableTimeoutNode ( node , timeSpan , Observable . Empty < bool > ( ) , scheduler ) ;
2726 }
2827
2928 /// <summary>
30- /// Creates a timeout node that automatically turns off the light after the specified time span.
31- /// The timeout can be reset when the observable emits a value .
29+ /// Wraps the pipeline node to automatically transition to an 'Off' state after a specified duration of inactivity,
30+ /// with an optional observable to persist the current state and bypass the timeout .
3231 /// </summary>
33- /// <typeparam name="T">The type of values emitted by the reset timer observable.</typeparam>
34- /// <param name="node">The pipeline node to wrap with timeout behavior.</param>
35- /// <param name="timeSpan">The duration after which the light will turn off.</param>
36- /// <param name="resetTimerObservable">An observable that resets the timeout timer when it emits a value.</param>
37- /// <param name="scheduler">The scheduler to use for timing operations.</param>
38- /// <returns>A new pipeline node that wraps the original node with resettable timeout behavior.</returns>
39- public static IPipelineNode < LightTransition > TurnOffAfter < T > ( this IPipelineNode < LightTransition > node ,
40- TimeSpan timeSpan , IObservable < T > resetTimerObservable , IScheduler scheduler )
32+ /// <param name="node">The source pipeline node.</param>
33+ /// <param name="timeSpan">The duration to wait before turning off.</param>
34+ /// <param name="persistObservable">An observable that, when true, prevents the timeout from triggering.</param>
35+ /// <param name="scheduler">The scheduler used for timing operations.</param>
36+ /// <returns>A new pipeline node that times out to 'Off' unless persistence is active.</returns>
37+ public static IPipelineNode < LightTransition > TurnOffAfter ( this IPipelineNode < LightTransition > node ,
38+ TimeSpan timeSpan , IObservable < bool > persistObservable , IScheduler scheduler )
4139 {
42- return new ResettableTimeoutNode < T > ( node , timeSpan , resetTimerObservable , scheduler ) ;
40+ return new ResettableTimeoutNode ( node , timeSpan , persistObservable , scheduler ) ;
4341 }
4442 }
4543}
0 commit comments