@iobroker/dm-utils 0.1.4 → 0.1.6

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/README.md CHANGED
@@ -294,6 +294,12 @@ This method returns a promise that resolves to a `ProgressDialog` object.
294
294
  ### **WORK IN PROGRESS**
295
295
  -->
296
296
  ## Changelog
297
+ ### 0.1.6 (2023-12-16)
298
+ * (bluefox) added channel info
299
+
300
+ ### 0.1.5 (2023-12-16)
301
+ * (bluefox) extended controls with unit and new control types
302
+
297
303
  ### 0.1.4 (2023-12-13)
298
304
  * (bluefox) added error codes
299
305
 
@@ -14,15 +14,23 @@ export interface ActionBase<T extends ActionType> {
14
14
  color?: Color;
15
15
  backgroundColor?: Color;
16
16
  }
17
+ export interface ChannelInfo {
18
+ name: ioBroker.StringOrTranslated;
19
+ icon?: string;
20
+ color?: Color;
21
+ backgroundColor?: Color;
22
+ order?: number;
23
+ }
17
24
  export interface ControlBase {
18
25
  id: string;
19
- type: "button" | "switch" | "slider" | "select" | "icon" | "color";
26
+ type: "button" | "switch" | "slider" | "select" | "icon" | "color" | "text" | "number" | "info";
20
27
  state?: ioBroker.State;
21
28
  stateId?: string;
22
29
  icon?: string;
23
30
  iconOn?: string;
24
31
  min?: number;
25
32
  max?: number;
33
+ unit?: string;
26
34
  label?: ioBroker.StringOrTranslated;
27
35
  labelOn?: ioBroker.StringOrTranslated;
28
36
  description?: ioBroker.StringOrTranslated;
@@ -35,6 +43,7 @@ export interface ControlBase {
35
43
  icon?: string;
36
44
  color?: Color;
37
45
  }[];
46
+ channel?: ChannelInfo;
38
47
  }
39
48
  export interface DeviceControl<T extends ActionType = "api"> extends ControlBase {
40
49
  handler?: T extends "api" ? never : (deviceId: string, actionId: string, state: ControlState, context: MessageContext) => RetVal<ErrorResponse | ioBroker.State>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iobroker/dm-utils",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "ioBroker Device Manager utilities for backend",
5
5
  "main": "build/index.js",
6
6
  "publishConfig": {
@@ -27,9 +27,9 @@
27
27
  "@alcalzone/release-script": "^3.7.0",
28
28
  "@alcalzone/release-script-plugin-license": "^3.7.0",
29
29
  "@types/node": "^20.10.4",
30
- "@typescript-eslint/eslint-plugin": "^6.13.2",
31
- "@typescript-eslint/parser": "^6.13.2",
32
- "eslint": "^8.55.0",
30
+ "@typescript-eslint/eslint-plugin": "^6.14.0",
31
+ "@typescript-eslint/parser": "^6.14.0",
32
+ "eslint": "^8.56.0",
33
33
  "eslint-config-prettier": "^9.1.0",
34
34
  "prettier": "^3.1.1",
35
35
  "typescript": "^5.3.3"