Skip to content

Commit

Permalink
Update type defintions for recent changes
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
  • Loading branch information
florian-h05 committed Aug 22, 2022
1 parent a852e00 commit 5d67dba
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion triggers.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ const TimeOfDayTrigger = (time, triggerName) => createTrigger('timer.TimeOfDayTr
*
* @memberof triggers
* @param {string} itemName the name of the DateTime Item
* @param {boolean} [timeOnly=false] Specifies whether only the time of the Item should be compared or the date and time.
* @param {boolean} [timeOnly=false] Specifies whether only the time of the Item should be compared or the date and time.
* @param {string} [triggerName] the optional name of the trigger to create
*/
const DateTimeTrigger = (itemName, timeOnly = false, triggerName) => createTrigger('timer.DateTimeTrigger', triggerName, {
Expand Down
5 changes: 3 additions & 2 deletions types/rules/rules.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*
* Note:
* `Group****Trigger`s use the equivalent `Item****Trigger` as trigger for each member.
* Time triggers do not provide any event instance, therefore no property is populated.
*/
export type EventObject = {
/**
Expand Down Expand Up @@ -46,11 +47,11 @@ export type EventObject = {
*/
status: string;
/**
* for all triggers except {@link triggers.PWMTrigger }, {@link triggers.PIDTrigger }: Type of event that triggered event (change, command, time, triggered, update)
* for all triggers except {@link triggers.PWMTrigger }, {@link triggers.PIDTrigger }, time triggers: Type of event that triggered event (change, command, time, triggered, update)
*/
eventType: string;
/**
* for all triggers except {@link triggers.PWMTrigger }, {@link triggers.PIDTrigger }: Type of trigger that triggered event (for `TimeOfDayTrigger`: `GenericCronTrigger`)
* for all triggers except {@link triggers.PWMTrigger }, {@link triggers.PIDTrigger }, time triggers: Type of trigger that triggered event (for `TimeOfDayTrigger`: `GenericCronTrigger`)
*/
triggerType: string;
/**
Expand Down
2 changes: 1 addition & 1 deletion types/rules/rules.d.ts.map

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

12 changes: 12 additions & 0 deletions types/triggers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,18 @@ export function GenericCronTrigger(expression: string, triggerName?: string): Ho
* @param {string} [triggerName] the optional name of the trigger to create
*/
export function TimeOfDayTrigger(time: string, triggerName?: string): HostTrigger;
/**
* Creates a trigger that fires at a (optional) date and time specified in an DateTime Item.
*
* @example
* DateTimeTrigger('MyDateTimeItem');
*
* @memberof triggers
* @param {string} itemName the name of the DateTime Item
* @param {boolean} [timeOnly=false] Specifies whether only the time of the Item should be compared or the date and time.
* @param {string} [triggerName] the optional name of the trigger to create
*/
export function DateTimeTrigger(itemName: string, timeOnly?: boolean, triggerName?: string): HostTrigger;
/**
* Creates a trigger for the {@link https://openhab.org/addons/automation/pwm/ Pulse Width Modulation (PWM) Automation} add-on.
*
Expand Down
2 changes: 1 addition & 1 deletion types/triggers.d.ts.map

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

0 comments on commit 5d67dba

Please sign in to comment.