Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 3 additions & 0 deletions templates/README.md.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ ${
We've collected some [best practices](https://github.com/ioBroker/ioBroker.repositories#development-and-coding-best-practices) regarding ioBroker development and coding in general. If you're new to ioBroker or Node.js, you should
check them out. If you're already experienced, you should also take a look at them - you might learn something new :)

### State Roles
When creating state objects, it is important to use the correct role for the state. The role defines how the state should be interpreted by visualizations and other adapters. For a list of available roles and their meanings, please refer to the [state roles documentation](https://www.iobroker.net/#en/documentation/dev/stateroles.md).

### Scripts in \`package.json\`
Several npm scripts are predefined for your convenience. You can run them using \`npm run <scriptname>\`
| Script name | Description |
Expand Down
5 changes: 5 additions & 0 deletions templates/main.js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ ${adapterSettings.map(s => `\t\tthis.log.debug(${quote}config ${s.key}: \${this.
native: {},
});

// **************************************************************************************************
// In order to use the correct role for state objects, please refer to the state roles documentation
// https://www.iobroker.net/#en/documentation/dev/stateroles.md
// **************************************************************************************************

// In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above.
this.subscribeStates(${quote}testVariable${quote});
// You can also add a subscription for multiple states. The following line watches all states starting with "lights."
Expand Down
5 changes: 5 additions & 0 deletions templates/src/main.ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ ${adapterSettings.map(s => `\t\tthis.log.debug(${quote}config ${s.key}: \${this.
native: {},
});

// **************************************************************************************************
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot move this block into the JSDoc block of the above setObjectNotExists call to make clear it belongs to this. In all places it was inserted.
And remove the "****" lines but start on extra line after an empty line with "IMPORTANT:..."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Moved the comment block into the JSDoc comment above setObjectNotExistsAsync, removed the asterisk lines, and formatted with "IMPORTANT:" prefix on a new line after an empty line. Changes applied in commit 53d6f5b.

// In order to use the correct role for state objects, please refer to the state roles documentation
// https://www.iobroker.net/#en/documentation/dev/stateroles.md
// **************************************************************************************************

// In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above.
this.subscribeStates(${quote}testVariable${quote});
// You can also add a subscription for multiple states. The following line watches all states starting with "lights."
Expand Down
3 changes: 3 additions & 0 deletions test/baselines/ReleaseScript_JS/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ You are almost done, only a few steps left:
We've collected some [best practices](https://github.com/ioBroker/ioBroker.repositories#development-and-coding-best-practices) regarding ioBroker development and coding in general. If you're new to ioBroker or Node.js, you should
check them out. If you're already experienced, you should also take a look at them - you might learn something new :)

### State Roles
When creating state objects, it is important to use the correct role for the state. The role defines how the state should be interpreted by visualizations and other adapters. For a list of available roles and their meanings, please refer to the [state roles documentation](https://www.iobroker.net/#en/documentation/dev/stateroles.md).

### Scripts in `package.json`
Several npm scripts are predefined for your convenience. You can run them using `npm run <scriptname>`
| Script name | Description |
Expand Down
3 changes: 3 additions & 0 deletions test/baselines/ReleaseScript_TS/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ You are almost done, only a few steps left:
We've collected some [best practices](https://github.com/ioBroker/ioBroker.repositories#development-and-coding-best-practices) regarding ioBroker development and coding in general. If you're new to ioBroker or Node.js, you should
check them out. If you're already experienced, you should also take a look at them - you might learn something new :)

### State Roles
When creating state objects, it is important to use the correct role for the state. The role defines how the state should be interpreted by visualizations and other adapters. For a list of available roles and their meanings, please refer to the [state roles documentation](https://www.iobroker.net/#en/documentation/dev/stateroles.md).

### Scripts in `package.json`
Several npm scripts are predefined for your convenience. You can run them using `npm run <scriptname>`
| Script name | Description |
Expand Down
5 changes: 5 additions & 0 deletions test/baselines/TS_DoubleQuotes/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ class TestAdapter extends utils.Adapter {
native: {},
});

// **************************************************************************************************
// In order to use the correct role for state objects, please refer to the state roles documentation
// https://www.iobroker.net/#en/documentation/dev/stateroles.md
// **************************************************************************************************

// In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above.
this.subscribeStates("testVariable");
// You can also add a subscription for multiple states. The following line watches all states starting with "lights."
Expand Down
5 changes: 5 additions & 0 deletions test/baselines/TS_SingleQuotes/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ class TestAdapter extends utils.Adapter {
native: {},
});

// **************************************************************************************************
// In order to use the correct role for state objects, please refer to the state roles documentation
// https://www.iobroker.net/#en/documentation/dev/stateroles.md
// **************************************************************************************************

// In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above.
this.subscribeStates('testVariable');
// You can also add a subscription for multiple states. The following line watches all states starting with "lights."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ You are almost done, only a few steps left:
We've collected some [best practices](https://github.com/ioBroker/ioBroker.repositories#development-and-coding-best-practices) regarding ioBroker development and coding in general. If you're new to ioBroker or Node.js, you should
check them out. If you're already experienced, you should also take a look at them - you might learn something new :)

### State Roles
When creating state objects, it is important to use the correct role for the state. The role defines how the state should be interpreted by visualizations and other adapters. For a list of available roles and their meanings, please refer to the [state roles documentation](https://www.iobroker.net/#en/documentation/dev/stateroles.md).

### Scripts in `package.json`
Several npm scripts are predefined for your convenience. You can run them using `npm run <scriptname>`
| Script name | Description |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ class TestAdapter extends utils.Adapter {
native: {},
});

// **************************************************************************************************
// In order to use the correct role for state objects, please refer to the state roles documentation
// https://www.iobroker.net/#en/documentation/dev/stateroles.md
// **************************************************************************************************

// In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above.
this.subscribeStates('testVariable');
// You can also add a subscription for multiple states. The following line watches all states starting with "lights."
Expand Down
3 changes: 3 additions & 0 deletions test/baselines/adapter_JS_OfficialESLint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ You are almost done, only a few steps left:
We've collected some [best practices](https://github.com/ioBroker/ioBroker.repositories#development-and-coding-best-practices) regarding ioBroker development and coding in general. If you're new to ioBroker or Node.js, you should
check them out. If you're already experienced, you should also take a look at them - you might learn something new :)

### State Roles
When creating state objects, it is important to use the correct role for the state. The role defines how the state should be interpreted by visualizations and other adapters. For a list of available roles and their meanings, please refer to the [state roles documentation](https://www.iobroker.net/#en/documentation/dev/stateroles.md).

### Scripts in `package.json`
Several npm scripts are predefined for your convenience. You can run them using `npm run <scriptname>`
| Script name | Description |
Expand Down
5 changes: 5 additions & 0 deletions test/baselines/adapter_JS_OfficialESLint/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ class TestAdapter extends utils.Adapter {
native: {},
});

// **************************************************************************************************
// In order to use the correct role for state objects, please refer to the state roles documentation
// https://www.iobroker.net/#en/documentation/dev/stateroles.md
// **************************************************************************************************

// In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above.
this.subscribeStates('testVariable');
// You can also add a subscription for multiple states. The following line watches all states starting with "lights."
Expand Down
3 changes: 3 additions & 0 deletions test/baselines/adapter_JS_React/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ You are almost done, only a few steps left:
We've collected some [best practices](https://github.com/ioBroker/ioBroker.repositories#development-and-coding-best-practices) regarding ioBroker development and coding in general. If you're new to ioBroker or Node.js, you should
check them out. If you're already experienced, you should also take a look at them - you might learn something new :)

### State Roles
When creating state objects, it is important to use the correct role for the state. The role defines how the state should be interpreted by visualizations and other adapters. For a list of available roles and their meanings, please refer to the [state roles documentation](https://www.iobroker.net/#en/documentation/dev/stateroles.md).

### Scripts in `package.json`
Several npm scripts are predefined for your convenience. You can run them using `npm run <scriptname>`
| Script name | Description |
Expand Down
5 changes: 5 additions & 0 deletions test/baselines/adapter_JS_React/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ class TestAdapter extends utils.Adapter {
native: {},
});

// **************************************************************************************************
// In order to use the correct role for state objects, please refer to the state roles documentation
// https://www.iobroker.net/#en/documentation/dev/stateroles.md
// **************************************************************************************************

// In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above.
this.subscribeStates("testVariable");
// You can also add a subscription for multiple states. The following line watches all states starting with "lights."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ You are almost done, only a few steps left:
We've collected some [best practices](https://github.com/ioBroker/ioBroker.repositories#development-and-coding-best-practices) regarding ioBroker development and coding in general. If you're new to ioBroker or Node.js, you should
check them out. If you're already experienced, you should also take a look at them - you might learn something new :)

### State Roles
When creating state objects, it is important to use the correct role for the state. The role defines how the state should be interpreted by visualizations and other adapters. For a list of available roles and their meanings, please refer to the [state roles documentation](https://www.iobroker.net/#en/documentation/dev/stateroles.md).

### Scripts in `package.json`
Several npm scripts are predefined for your convenience. You can run them using `npm run <scriptname>`
| Script name | Description |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ class TestAdapter extends utils.Adapter {
native: {},
});

// **************************************************************************************************
// In order to use the correct role for state objects, please refer to the state roles documentation
// https://www.iobroker.net/#en/documentation/dev/stateroles.md
// **************************************************************************************************

// In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above.
this.subscribeStates("testVariable");
// You can also add a subscription for multiple states. The following line watches all states starting with "lights."
Expand Down
3 changes: 3 additions & 0 deletions test/baselines/adapter_TS_OfficialESLint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ You are almost done, only a few steps left:
We've collected some [best practices](https://github.com/ioBroker/ioBroker.repositories#development-and-coding-best-practices) regarding ioBroker development and coding in general. If you're new to ioBroker or Node.js, you should
check them out. If you're already experienced, you should also take a look at them - you might learn something new :)

### State Roles
When creating state objects, it is important to use the correct role for the state. The role defines how the state should be interpreted by visualizations and other adapters. For a list of available roles and their meanings, please refer to the [state roles documentation](https://www.iobroker.net/#en/documentation/dev/stateroles.md).

### Scripts in `package.json`
Several npm scripts are predefined for your convenience. You can run them using `npm run <scriptname>`
| Script name | Description |
Expand Down
5 changes: 5 additions & 0 deletions test/baselines/adapter_TS_OfficialESLint/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ class TestAdapter extends utils.Adapter {
native: {},
});

// **************************************************************************************************
// In order to use the correct role for state objects, please refer to the state roles documentation
// https://www.iobroker.net/#en/documentation/dev/stateroles.md
// **************************************************************************************************

// In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above.
this.subscribeStates("testVariable");
// You can also add a subscription for multiple states. The following line watches all states starting with "lights."
Expand Down
3 changes: 3 additions & 0 deletions test/baselines/adapter_TS_React/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ You are almost done, only a few steps left:
We've collected some [best practices](https://github.com/ioBroker/ioBroker.repositories#development-and-coding-best-practices) regarding ioBroker development and coding in general. If you're new to ioBroker or Node.js, you should
check them out. If you're already experienced, you should also take a look at them - you might learn something new :)

### State Roles
When creating state objects, it is important to use the correct role for the state. The role defines how the state should be interpreted by visualizations and other adapters. For a list of available roles and their meanings, please refer to the [state roles documentation](https://www.iobroker.net/#en/documentation/dev/stateroles.md).

### Scripts in `package.json`
Several npm scripts are predefined for your convenience. You can run them using `npm run <scriptname>`
| Script name | Description |
Expand Down
5 changes: 5 additions & 0 deletions test/baselines/adapter_TS_React/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ class TestAdapter extends utils.Adapter {
native: {},
});

// **************************************************************************************************
// In order to use the correct role for state objects, please refer to the state roles documentation
// https://www.iobroker.net/#en/documentation/dev/stateroles.md
// **************************************************************************************************

// In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above.
this.subscribeStates("testVariable");
// You can also add a subscription for multiple states. The following line watches all states starting with "lights."
Expand Down
3 changes: 3 additions & 0 deletions test/baselines/adapter_TS_React_OfficialESLint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ You are almost done, only a few steps left:
We've collected some [best practices](https://github.com/ioBroker/ioBroker.repositories#development-and-coding-best-practices) regarding ioBroker development and coding in general. If you're new to ioBroker or Node.js, you should
check them out. If you're already experienced, you should also take a look at them - you might learn something new :)

### State Roles
When creating state objects, it is important to use the correct role for the state. The role defines how the state should be interpreted by visualizations and other adapters. For a list of available roles and their meanings, please refer to the [state roles documentation](https://www.iobroker.net/#en/documentation/dev/stateroles.md).

### Scripts in `package.json`
Several npm scripts are predefined for your convenience. You can run them using `npm run <scriptname>`
| Script name | Description |
Expand Down
5 changes: 5 additions & 0 deletions test/baselines/adapter_TS_React_OfficialESLint/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ class TestAdapter extends utils.Adapter {
native: {},
});

// **************************************************************************************************
// In order to use the correct role for state objects, please refer to the state roles documentation
// https://www.iobroker.net/#en/documentation/dev/stateroles.md
// **************************************************************************************************

// In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above.
this.subscribeStates("testVariable");
// You can also add a subscription for multiple states. The following line watches all states starting with "lights."
Expand Down
3 changes: 3 additions & 0 deletions test/baselines/adapter_TS_VIS_CustomESLint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ You are almost done, only a few steps left:
We've collected some [best practices](https://github.com/ioBroker/ioBroker.repositories#development-and-coding-best-practices) regarding ioBroker development and coding in general. If you're new to ioBroker or Node.js, you should
check them out. If you're already experienced, you should also take a look at them - you might learn something new :)

### State Roles
When creating state objects, it is important to use the correct role for the state. The role defines how the state should be interpreted by visualizations and other adapters. For a list of available roles and their meanings, please refer to the [state roles documentation](https://www.iobroker.net/#en/documentation/dev/stateroles.md).

### Scripts in `package.json`
Several npm scripts are predefined for your convenience. You can run them using `npm run <scriptname>`
| Script name | Description |
Expand Down
5 changes: 5 additions & 0 deletions test/baselines/adapter_TS_VIS_CustomESLint/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ class TestAdapter extends utils.Adapter {
native: {},
});

// **************************************************************************************************
// In order to use the correct role for state objects, please refer to the state roles documentation
// https://www.iobroker.net/#en/documentation/dev/stateroles.md
// **************************************************************************************************

// In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above.
this.subscribeStates("testVariable");
// You can also add a subscription for multiple states. The following line watches all states starting with "lights."
Expand Down
Loading