From 060d2cfe2bd1512ed0b2e8689add78bce8e47d10 Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Thu, 28 Mar 2024 06:50:13 +0100 Subject: [PATCH] another hap time introspection method --- packages/core/hap.mjs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/core/hap.mjs b/packages/core/hap.mjs index 5488a638..17ac6ad0 100644 --- a/packages/core/hap.mjs +++ b/packages/core/hap.mjs @@ -66,6 +66,9 @@ export class Hap { isInNearFuture(margin, currentTime) { return currentTime < this.whole.begin && currentTime > this.whole.begin - margin; } + isWithinTime(min, max) { + return this.whole.begin <= max && this.endClipped >= min; + } wholeOrPart() { return this.whole ? this.whole : this.part;