Constructor
new CountdownTimer(when, func, countItem, nameopt, keyopt, cacheObjopt)
Creates a timer to run func at when and a looping timer to update
countItem with the seconds remaining every second. Both timers start
immediately.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
when |
* | time.toZDT compatible time or duration | |
func |
function | function to call at when | |
countItem |
string | name of the Item to update with the seconds remaining | |
name |
string |
<optional> |
countdown name displayed in openHAB |
key |
string |
<optional> |
key for the backing map in the cache |
cacheObj |
object |
<optional> |
cache object to use (defaults to cache.private if key is provided) |
- Source:
Methods
cancel() → {boolean}
Cancels the running timer, if it's running.
- Source:
Returns:
true if timer was cancelled.
- Type
- boolean
hasTerminated() → {boolean}
- Source:
Returns:
true when the timer has exited
- Type
- boolean