@iobroker/dm-utils 1.0.1 → 1.0.2
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 +3 -4
- package/build/types/base.d.ts +9 -0
- package/build/types/base.js +9 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -206,9 +206,6 @@ 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
|
-
|
|
212
209
|
### `handleDeviceControlState(deviceId: string, controlId: string, context: MessageContext)
|
|
213
210
|
|
|
214
211
|
This method is called when GUI requests the update of the state.
|
|
@@ -234,6 +231,8 @@ For interactions, there are methods you can call on `context`:
|
|
|
234
231
|
|
|
235
232
|
There are some reserved action names, you can find the list below:
|
|
236
233
|
- `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.
|
|
234
|
+
- `disable` - This action will be called when the user clicks on the `enabled` icon. `disable` and `enable` actions cannot be together.
|
|
235
|
+
- `enable` - This action will be called when the user clicks on the `disabled` icon. `disable` and `enable` actions cannot be together.
|
|
237
236
|
|
|
238
237
|
### `showMessage(text: ioBroker.StringOrTranslated)`
|
|
239
238
|
|
|
@@ -302,7 +301,7 @@ This method returns a promise that resolves to a `ProgressDialog` object.
|
|
|
302
301
|
### **WORK IN PROGRESS**
|
|
303
302
|
-->
|
|
304
303
|
## Changelog
|
|
305
|
-
### 1.0.
|
|
304
|
+
### 1.0.2 (2025-01-09)
|
|
306
305
|
|
|
307
306
|
* (@GermanBluefox) Added description for `disabled` control and `status` action.
|
|
308
307
|
|
package/build/types/base.d.ts
CHANGED
|
@@ -3,7 +3,16 @@ import type { ApiVersion, DeviceRefresh, DeviceStatus, RetVal } from './common';
|
|
|
3
3
|
type ActionType = 'api' | 'adapter';
|
|
4
4
|
export type Color = 'primary' | 'secondary' | (string & {});
|
|
5
5
|
export type ControlState = string | number | boolean | null;
|
|
6
|
+
/** Reserved action names */
|
|
7
|
+
export declare const ACTIONS: {
|
|
8
|
+
/** This action will be called when user clicks on connection icon */
|
|
9
|
+
STATUS: string;
|
|
10
|
+
/** This action will be called when user clicks on connection icon */
|
|
11
|
+
DISABLE: string;
|
|
12
|
+
ENABLE: string;
|
|
13
|
+
};
|
|
6
14
|
export interface ActionBase<T extends ActionType> {
|
|
15
|
+
/** Unique (for this adapter) action ID. It could be the name from ACTIONS too, but in this case some predefined appearance will be applied */
|
|
7
16
|
id: string;
|
|
8
17
|
/**
|
|
9
18
|
* This can either be base64 or the URL to an icon.
|
package/build/types/base.js
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ACTIONS = void 0;
|
|
4
|
+
/** Reserved action names */
|
|
5
|
+
exports.ACTIONS = {
|
|
6
|
+
/** This action will be called when user clicks on connection icon */
|
|
7
|
+
STATUS: 'status',
|
|
8
|
+
/** This action will be called when user clicks on connection icon */
|
|
9
|
+
DISABLE: 'disable',
|
|
10
|
+
ENABLE: 'enable',
|
|
11
|
+
};
|