Skip to content

Commit 7283fb1

Browse files
authored
[items] Item: Declare null as allowed value for sendCommand, postUpdate (#452)
Signed-off-by: Florian Hotze <dev@florianhotze.com>
1 parent 9601792 commit 7283fb1

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/items/items.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ class Item {
309309
* // Turn on the Hallway lights for 5 minutes, then turn them off
310310
* items.getItem('HallwayLight').sendCommand('ON', time.Duration.ofMinutes(5), 'OFF');
311311
*
312-
* @param {string|number|ZonedDateTime|Instant|Quantity|HostState} value the value of the command to send, such as 'ON'
312+
* @param {string|number|ZonedDateTime|Instant|Quantity|HostState|null} value the value of the command to send, such as 'ON'
313313
* @param {Duration} [expire] optional duration (see {@link https://js-joda.github.io/js-joda/class/packages/core/src/Duration.js~Duration.html JS-Joda: Duration}) after which the command expires and the Item is commanded back to its previous state or `onExpire`
314314
* @param {string|number|ZonedDateTime|Instant|Quantity|HostState} [onExpire] the optional value of the command to apply on expire, default is the current state
315315
* @see sendCommandIfDifferent
@@ -482,7 +482,7 @@ class Item {
482482
/**
483483
* Posts an update to the Item.
484484
*
485-
* @param {string|number|ZonedDateTime|Instant|Quantity|HostState} value the value of the command to send, such as 'ON'
485+
* @param {string|number|ZonedDateTime|Instant|Quantity|HostState|null} value the value of the command to send, such as 'ON'
486486
* @see postToggleUpdate
487487
* @see sendCommand
488488
*/

types/items/items.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,13 @@ export class Item {
297297
* // Turn on the Hallway lights for 5 minutes, then turn them off
298298
* items.getItem('HallwayLight').sendCommand('ON', time.Duration.ofMinutes(5), 'OFF');
299299
*
300-
* @param {string|number|ZonedDateTime|Instant|Quantity|HostState} value the value of the command to send, such as 'ON'
300+
* @param {string|number|ZonedDateTime|Instant|Quantity|HostState|null} value the value of the command to send, such as 'ON'
301301
* @param {Duration} [expire] optional duration (see {@link https://js-joda.github.io/js-joda/class/packages/core/src/Duration.js~Duration.html JS-Joda: Duration}) after which the command expires and the Item is commanded back to its previous state or `onExpire`
302302
* @param {string|number|ZonedDateTime|Instant|Quantity|HostState} [onExpire] the optional value of the command to apply on expire, default is the current state
303303
* @see sendCommandIfDifferent
304304
* @see postUpdate
305305
*/
306-
sendCommand(value: string | number | ZonedDateTime | Instant | Quantity | HostState, expire?: Duration, onExpire?: string | number | ZonedDateTime | Instant | Quantity | HostState): void;
306+
sendCommand(value: string | number | ZonedDateTime | Instant | Quantity | HostState | null, expire?: Duration, onExpire?: string | number | ZonedDateTime | Instant | Quantity | HostState): void;
307307
/**
308308
* Sends a command to the Item, but only if the current state is not what is being sent.
309309
*
@@ -349,11 +349,11 @@ export class Item {
349349
/**
350350
* Posts an update to the Item.
351351
*
352-
* @param {string|number|ZonedDateTime|Instant|Quantity|HostState} value the value of the command to send, such as 'ON'
352+
* @param {string|number|ZonedDateTime|Instant|Quantity|HostState|null} value the value of the command to send, such as 'ON'
353353
* @see postToggleUpdate
354354
* @see sendCommand
355355
*/
356-
postUpdate(value: string | number | ZonedDateTime | Instant | Quantity | HostState): void;
356+
postUpdate(value: string | number | ZonedDateTime | Instant | Quantity | HostState | null): void;
357357
/**
358358
* Gets the names of the groups this Item is member of.
359359
* @returns {string[]}

types/items/items.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)