Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions src/items/items.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,24 @@ class Item {
}

/**
* Label attached to Item
* @type {string}
* Label attached to Item, or `null` if not set
* @type {string|null}
*/
get label () {
return this.rawItem.getLabel();
}

/**
* String representation of the Item state.
* @type {string}
* Category of the Item, or `null` if not set
* @return {string|null}
*/
get category () {
return this.rawItem.getCategory();
}

/**
* String representation of the Item state, or `null` if not available
* @type {string|null}
*/
get state () {
return _stateOrNull(this.rawState);
Expand Down Expand Up @@ -207,7 +215,7 @@ class Item {

/**
* Raw state of Item, as a Java {@link https://www.openhab.org/javadoc/latest/org/openhab/core/types/state State object}
* @type {HostState}
* @type {HostState|null}
*/
get rawState () {
return this.rawItem.getState();
Expand Down
3 changes: 2 additions & 1 deletion types/items/itemchannellink.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ export type Item = {
readonly groupType: string;
readonly name: string;
readonly label: string;
readonly category: string;
readonly state: string;
readonly numericState: number;
readonly quantityState: import("../quantity").Quantity;
readonly boolState: boolean;
readonly rawState: HostState;
readonly rawState: any;
readonly previousState: string;
readonly previousNumericState: number;
readonly previousQuantityState: import("../quantity").Quantity;
Expand Down
2 changes: 1 addition & 1 deletion types/items/itemchannellink.d.ts.map

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

17 changes: 11 additions & 6 deletions types/items/items.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,18 @@ export class Item {
*/
get name(): string;
/**
* Label attached to Item
* @type {string}
* Label attached to Item, or `null` if not set
* @type {string|null}
*/
get label(): string;
/**
* String representation of the Item state.
* @type {string}
* Category of the Item, or `null` if not set
* @return {string|null}
*/
get category(): string;
/**
* String representation of the Item state, or `null` if not available
* @type {string|null}
*/
get state(): string;
/**
Expand All @@ -212,9 +217,9 @@ export class Item {
get boolState(): boolean;
/**
* Raw state of Item, as a Java {@link https://www.openhab.org/javadoc/latest/org/openhab/core/types/state State object}
* @type {HostState}
* @type {HostState|null}
*/
get rawState(): HostState;
get rawState(): any;
/**
* String representation of the previous state of the Item or `null` if no previous state is available.
* @type {string|null}
Expand Down
2 changes: 1 addition & 1 deletion types/items/items.d.ts.map

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

3 changes: 2 additions & 1 deletion types/items/metadata.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ export type Item = {
readonly groupType: string;
readonly name: string;
readonly label: string;
readonly category: string;
readonly state: string;
readonly numericState: number;
readonly quantityState: import("../quantity").Quantity;
readonly boolState: boolean;
readonly rawState: HostState;
readonly rawState: any;
readonly previousState: string;
readonly previousNumericState: number;
readonly previousQuantityState: import("../quantity").Quantity;
Expand Down
2 changes: 1 addition & 1 deletion types/items/metadata.d.ts.map

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

3 changes: 2 additions & 1 deletion types/quantity.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ export type Item = {
readonly groupType: string;
readonly name: string;
readonly label: string;
readonly category: string;
readonly state: string;
readonly numericState: number;
readonly quantityState: Quantity;
readonly boolState: boolean;
readonly rawState: HostState;
readonly rawState: any;
readonly previousState: string;
readonly previousNumericState: number;
readonly previousQuantityState: Quantity;
Expand Down
2 changes: 1 addition & 1 deletion types/quantity.d.ts.map

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

3 changes: 2 additions & 1 deletion types/rules/operation-builder.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ export type Item = {
readonly groupType: string;
readonly name: string;
readonly label: string;
readonly category: string;
readonly state: string;
readonly numericState: number;
readonly quantityState: import("../quantity").Quantity;
readonly boolState: boolean;
readonly rawState: HostState;
readonly rawState: any;
readonly previousState: string;
readonly previousNumericState: number;
readonly previousQuantityState: import("../quantity").Quantity;
Expand Down
2 changes: 1 addition & 1 deletion types/rules/operation-builder.d.ts.map

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

3 changes: 2 additions & 1 deletion types/rules/trigger-builder.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ export type Item = {
readonly groupType: string;
readonly name: string;
readonly label: string;
readonly category: string;
readonly state: string;
readonly numericState: number;
readonly quantityState: import("../quantity").Quantity;
readonly boolState: boolean;
readonly rawState: HostState;
readonly rawState: any;
readonly previousState: string;
readonly previousNumericState: number;
readonly previousQuantityState: import("../quantity").Quantity;
Expand Down
Loading