Closed zoe-codez closed 5 months ago
automation.utils
automation.time
solar.onEvent
scheduler.sliding
context
offset
isBetween
isBefore
isAfter
number
ms
tuple
quantity
unit
string
ISO 8601
(#H)(#M)(#S)
object
Duration
dayjs.duration
function
automation.solar.onEvent({ eventName: "dusk", exec() { logger.info("hour before dusk"); }, offset: "-1h", }); automation.solar.onEvent({ eventName: "dusk", exec() { logger.info("some random time within an hour after dusk"); }, offset: () => Math.random() * 60 * 60 * 1000, });
Changes
automation.utils
toautomation.time
solar.onEvent
to work offscheduler.sliding
context
is no longer requiredoffset
automation.time
methods, which consume strings and return boolisBetween
isBefore
isAfter
Offset
number
)ms
tuple
) [quantity
,unit
]string
)ISO 8601
partial duration string:(#H)(#M)(#S)
object
) mapping of units to quantitiesDuration
)dayjs.duration
objectfunction
) a function that returns any of the aboveOffset examples
Checklist