@iobroker/dm-utils 0.6.11 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023-2024 ioBroker Community Developers
3
+ Copyright (c) 2023-2025 ioBroker Community Developers
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -114,7 +114,7 @@ In most cases, you will get all states of your instance and fill the array with
114
114
 
115
115
  Every array entry is an object of type `DeviceInfo` which has the following properties:
116
116
 
117
- - `id` (string): a unique (human readable) identifier of the device (it must be unique for your adapter instance only)
117
+ - `id` (string): a unique (human-readable) identifier of the device (it must be unique for your adapter instance only)
118
118
  - `name` (string or translations): the human-readable name of this device
119
119
  - `status` (optional): the current status of the device, which can be one of:
120
120
  - `"disconnected"`
@@ -197,8 +197,8 @@ This method is called when the user clicks on a control (i.e., slider) in the de
197
197
 
198
198
  The parameters of this method are:
199
199
  - `deviceId` (string): the `id` that was given in `listDevices()` --> `[].id`
200
- - `controlId` (string): the `id` that was given in `listDevices()` --> `[].controls[].id`
201
- - `state` (string | number | boolean): new state for the control, that will be sent to real device
200
+ - `controlId` (string): the `id` that was given in `listDevices()` --> `[].controls[].id`. There are some reserved control names, you can find the list below.
201
+ - `state` (string | number | boolean): new state for the control, that will be sent to a real device
202
202
  - `context` (object): object containing helper methods that can be used when executing the action
203
203
 
204
204
  The returned object must contain:
@@ -206,6 +206,9 @@ The returned object must contain:
206
206
 
207
207
  This method can be implemented asynchronously and can take a lot of time to complete.
208
208
 
209
+ Reserved control names:
210
+ - `disabled` - The disabled control has its own pre-defined place on the device card and is used to disable the device. The state of this control is boolean.
211
+
209
212
  ### `handleDeviceControlState(deviceId: string, controlId: string, context: MessageContext)
210
213
 
211
214
  This method is called when GUI requests the update of the state.
@@ -226,7 +229,11 @@ To allow your adapter to interact with the user, you can use "actions".
226
229
 
227
230
  As described above, there are actions on the instance and on devices. The behavior of both methods is similar.
228
231
 
229
- Inside an action method (`handleInstanceAction()` or `handleDeviceAction()`) you can perform arbitrary actions, like talking to a device or API, and you can interact with the user. For interactions, there are methods you can call on `context`:
232
+ Inside an action method (`handleInstanceAction()` or `handleDeviceAction()`) you can perform arbitrary actions, like talking to a device or API, and you can interact with the user.
233
+ For interactions, there are methods you can call on `context`:
234
+
235
+ There are some reserved action names, you can find the list below:
236
+ - `status` - This action is called when the user clicks on the status icon. So to implement the "click-on-status" functionality, the developer has to implement this action.
230
237
 
231
238
  ### `showMessage(text: ioBroker.StringOrTranslated)`
232
239
 
@@ -295,6 +302,15 @@ This method returns a promise that resolves to a `ProgressDialog` object.
295
302
  ### **WORK IN PROGRESS**
296
303
  -->
297
304
  ## Changelog
305
+ ### 1.0.1 (2025-01-09)
306
+
307
+ * (@GermanBluefox) Added description for `disabled` control and `status` action.
308
+
309
+ ### 1.0.0 (2025-01-08)
310
+
311
+ * (@GermanBluefox) Added `disabled` options for a device
312
+ * (@GermanBluefox) Major release just because is good enough. No breaking changes.
313
+
298
314
  ### 0.6.11 (2024-12-11)
299
315
 
300
316
  * (@GermanBluefox) Do not close handler for progress
@@ -366,7 +382,7 @@ This method returns a promise that resolves to a `ProgressDialog` object.
366
382
  ## License
367
383
  MIT License
368
384
 
369
- Copyright (c) 2023-2024 ioBroker Community Developers
385
+ Copyright (c) 2023-2025 ioBroker Community Developers
370
386
 
371
387
  Permission is hereby granted, free of charge, to any person obtaining a copy
372
388
  of this software and associated documentation files (the "Software"), to deal
@@ -101,6 +101,7 @@ export interface DeviceInfo<T extends ActionType = 'api'> {
101
101
  actions?: DeviceAction<T>[];
102
102
  controls?: DeviceControl<T>[];
103
103
  hasDetails?: boolean;
104
+ /** Device type for grouping */
104
105
  group?: {
105
106
  key: string;
106
107
  name?: ioBroker.StringOrTranslated;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iobroker/dm-utils",
3
- "version": "0.6.11",
3
+ "version": "1.0.1",
4
4
  "description": "ioBroker Device Manager utilities for backend",
5
5
  "main": "build/index.js",
6
6
  "publishConfig": {
@@ -16,7 +16,7 @@
16
16
  "release-patch": "release-script patch --yes",
17
17
  "release-minor": "release-script minor --yes",
18
18
  "release-major": "release-script major --yes",
19
- "update-packages": "ncu --upgrade",
19
+ "update-packages": "npx -y npm-check-updates --upgrade",
20
20
  "npm": "npm i -f"
21
21
  },
22
22
  "author": "UncleSamSwiss",
@@ -28,7 +28,7 @@
28
28
  "@alcalzone/release-script": "^3.8.0",
29
29
  "@alcalzone/release-script-plugin-license": "^3.7.0",
30
30
  "@iobroker/eslint-config": "^1.0.0",
31
- "@types/node": "^22.10.2",
31
+ "@types/node": "^22.10.5",
32
32
  "axios": "^1.7.9",
33
33
  "typescript": "^5.7.2"
34
34
  },