Skip to content

Commit

Permalink
[rules] Rule Builder: Add fromOn & fromOff to Item trigger config (#297)
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Hotze <[email protected]>
  • Loading branch information
florian-h05 authored Sep 17, 2023
1 parent 86d0993 commit ede2a5a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
18 changes: 18 additions & 0 deletions rules/trigger-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,24 @@ class ItemTriggerConfig extends TriggerConf {
return this.to('ON');
}

/**
* Item changed from OFF
*
* @returns {ItemTriggerConfig}
*/
fromOff () {
return this.from('OFF');
}

/**
* Item changed from ON
*
* @returns {ItemTriggerConfig}
*/
fromOn () {
return this.from('ON');
}

/**
* Item received command
*
Expand Down
12 changes: 12 additions & 0 deletions types/rules/trigger-builder.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@ export class ItemTriggerConfig extends TriggerConf {
* @returns {ItemTriggerConfig}
*/
toOn(): ItemTriggerConfig;
/**
* Item changed from OFF
*
* @returns {ItemTriggerConfig}
*/
fromOff(): ItemTriggerConfig;
/**
* Item changed from ON
*
* @returns {ItemTriggerConfig}
*/
fromOn(): ItemTriggerConfig;
/**
* Item received command
*
Expand Down
2 changes: 1 addition & 1 deletion types/rules/trigger-builder.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ede2a5a

Please sign in to comment.