@iobroker/types 7.2.2 → 7.2.3-alpha.1-20260621-61726ea22
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/build/config.d.ts +26 -0
- package/build/objects.d.ts +1 -1
- package/build/types.d.ts +1686 -1
- package/package.json +2 -2
package/build/types.d.ts
CHANGED
|
@@ -11,15 +11,23 @@ export declare const Adapter: typeof AdapterClass;
|
|
|
11
11
|
* Here we define dynamically created methods
|
|
12
12
|
*/
|
|
13
13
|
export declare interface AdapterClass {
|
|
14
|
+
/** Listen for state changes */
|
|
14
15
|
on(event: 'stateChange', listener: ioBroker.StateChangeHandler): this;
|
|
16
|
+
/** Listen for object changes */
|
|
15
17
|
on(event: 'objectChange', listener: ioBroker.ObjectChangeHandler): this;
|
|
18
|
+
/** Listen for file changes */
|
|
16
19
|
on(event: 'fileChange', listener: ioBroker.FileChangeHandler): this;
|
|
20
|
+
/** Emitted when the adapter is ready */
|
|
17
21
|
on(event: 'ready', listener: ioBroker.ReadyHandler): this;
|
|
22
|
+
/** Emitted when the adapter is installed */
|
|
18
23
|
on(event: 'install', listener: ioBroker.ReadyHandler): this;
|
|
24
|
+
/** Emitted when the adapter is unloaded */
|
|
19
25
|
on(event: 'unload', listener: ioBroker.UnloadHandler): this;
|
|
26
|
+
/** Emitted when a message is received */
|
|
20
27
|
on(event: 'message', listener: ioBroker.MessageHandler): this;
|
|
21
28
|
/** Only emitted for compact instances */
|
|
22
29
|
on(event: 'exit', listener: (exitCode: number, reason: string) => Promise<void> | void): this;
|
|
30
|
+
/** Emitted on a new log message */
|
|
23
31
|
on(event: 'log', listener: (message: ioBroker.LogMessage) => Promise<void> | void): this;
|
|
24
32
|
/**
|
|
25
33
|
* Extend an object and create it if it might not exist
|
|
@@ -70,11 +78,15 @@ export declare interface AdapterClass {
|
|
|
70
78
|
setForeignObjectNotExistsAsync<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, options?: unknown): ioBroker.SetObjectPromise;
|
|
71
79
|
/** deletes a device, its channels and states */
|
|
72
80
|
deleteDeviceAsync(deviceName: string, options?: unknown): Promise<void>;
|
|
81
|
+
/** Adds a channel to an enum */
|
|
73
82
|
addChannelToEnumAsync(enumName: string, addTo: string, parentDevice: string, channelName: string, options?: unknown): Promise<void>;
|
|
83
|
+
/** Removes a channel from an enum */
|
|
74
84
|
deleteChannelFromEnumAsync(enumName: string, parentDevice: string, channelName: string, options?: unknown): Promise<void>;
|
|
75
85
|
/** Returns a list of all devices in this adapter instance */
|
|
76
86
|
getDevicesAsync(options?: unknown): Promise<ioBroker.DeviceObject[]>;
|
|
87
|
+
/** Adds a state to an enum */
|
|
77
88
|
addStateToEnumAsync(enumName: string, addTo: string, parentDevice: string, parentChannel: string, stateName: string, options?: unknown): Promise<void>;
|
|
89
|
+
/** Removes a state from an enum */
|
|
78
90
|
deleteStateFromEnumAsync(enumName: string, parentDevice: string, parentChannel: string, stateName: string, options?: unknown): Promise<void>;
|
|
79
91
|
/** Changes access rights of all files in the adapter directory */
|
|
80
92
|
chmodFileAsync(adapter: string | null, path: string, options: {
|
|
@@ -83,6 +95,7 @@ export declare interface AdapterClass {
|
|
|
83
95
|
entries: ioBroker.ChownFileResult[];
|
|
84
96
|
id: string;
|
|
85
97
|
}>;
|
|
98
|
+
/** Changes the owner of all files in the adapter directory */
|
|
86
99
|
chownFileAsync(...args: any[]): Promise<any>;
|
|
87
100
|
/** reads the content of directory from DB for given adapter and path */
|
|
88
101
|
readDirAsync(adapterName: string | null, path: string, options?: unknown): ioBroker.ReadDirPromise;
|
|
@@ -90,10 +103,13 @@ export declare interface AdapterClass {
|
|
|
90
103
|
unlinkAsync(adapterName: string | null, path: string, options?: unknown): Promise<void>;
|
|
91
104
|
/** Deletes a given file */
|
|
92
105
|
delFileAsync(adapterName: string | null, path: string, options?: unknown): Promise<void>;
|
|
106
|
+
/** Renames a file in the DB */
|
|
93
107
|
renameAsync(adapterName: string | null, oldName: string, newName: string, options?: unknown): Promise<void>;
|
|
108
|
+
/** Creates a directory in the DB */
|
|
94
109
|
mkdirAsync(adapterName: string | null, path: string, options?: unknown): Promise<void>;
|
|
95
110
|
/** reads the content of directory from DB for given adapter and path */
|
|
96
111
|
readFileAsync(adapterName: string | null, path: string, options?: unknown): ioBroker.ReadFilePromise;
|
|
112
|
+
/** Writes a file into the DB */
|
|
97
113
|
writeFileAsync(adapterName: string | null, path: string, data: Buffer | string, options?: unknown): Promise<void>;
|
|
98
114
|
/** Checks if a file exists in the DB */
|
|
99
115
|
fileExistsAsync(adapterName: string | null, path: string, options?: unknown): Promise<boolean>;
|
|
@@ -145,6 +161,13 @@ export declare interface AdapterClass {
|
|
|
145
161
|
* @deprecated use `adapter.setForeignObject` without a callback instead
|
|
146
162
|
*/
|
|
147
163
|
setForeignObjectAsync<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, options?: unknown): ioBroker.SetObjectPromise;
|
|
164
|
+
/**
|
|
165
|
+
* Get the certificates of the system.
|
|
166
|
+
*
|
|
167
|
+
* @param publicName name of the public certificate
|
|
168
|
+
* @param privateName name of the private key
|
|
169
|
+
* @param chainedName name of the chained certificate
|
|
170
|
+
*/
|
|
148
171
|
getCertificatesAsync(publicName?: string, privateName?: string, chainedName?: string): Promise<GetCertificatesPromiseReturnType>;
|
|
149
172
|
/** Get all states, channels, devices and folders of this adapter */
|
|
150
173
|
getAdapterObjectsAsync(): Promise<Record<string, ioBroker.AdapterScopedObject>>;
|
|
@@ -154,28 +177,81 @@ export declare interface AdapterClass {
|
|
|
154
177
|
* Writes a value (which might not belong to this adapter) into the states DB only if it has changed.
|
|
155
178
|
*/
|
|
156
179
|
setForeignStateChangedAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack?: boolean): ioBroker.SetStateChangedPromise;
|
|
180
|
+
/**
|
|
181
|
+
* Writes a value (which might not belong to this adapter) into the states DB only if it has changed.
|
|
182
|
+
*
|
|
183
|
+
* @param id object ID of the state
|
|
184
|
+
* @param state simple value or object with attributes
|
|
185
|
+
* @param options optional user context
|
|
186
|
+
*/
|
|
157
187
|
setForeignStateChangedAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, options?: unknown): ioBroker.SetStateChangedPromise;
|
|
188
|
+
/**
|
|
189
|
+
* Writes a value (which might not belong to this adapter) into the states DB only if it has changed.
|
|
190
|
+
*
|
|
191
|
+
* @param id object ID of the state
|
|
192
|
+
* @param state simple value or object with attributes
|
|
193
|
+
* @param ack is command(false) or status(true)
|
|
194
|
+
* @param options optional user context
|
|
195
|
+
*/
|
|
158
196
|
setForeignStateChangedAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, options: unknown): ioBroker.SetStateChangedPromise;
|
|
159
197
|
/**
|
|
160
198
|
* Writes a value into the states DB only if it has changed.
|
|
161
199
|
*/
|
|
162
200
|
setStateChangedAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack?: boolean): ioBroker.SetStateChangedPromise;
|
|
201
|
+
/**
|
|
202
|
+
* Writes a value into the states DB only if it has changed.
|
|
203
|
+
*
|
|
204
|
+
* @param id object ID of the state
|
|
205
|
+
* @param state simple value or object with attributes
|
|
206
|
+
* @param options optional user context
|
|
207
|
+
*/
|
|
163
208
|
setStateChangedAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, options?: unknown): ioBroker.SetStateChangedPromise;
|
|
209
|
+
/**
|
|
210
|
+
* Writes a value into the states DB only if it has changed.
|
|
211
|
+
*
|
|
212
|
+
* @param id object ID of the state
|
|
213
|
+
* @param state simple value or object with attributes
|
|
214
|
+
* @param ack is command(false) or status(true)
|
|
215
|
+
* @param options optional user context
|
|
216
|
+
*/
|
|
164
217
|
setStateChangedAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, options: unknown): ioBroker.SetStateChangedPromise;
|
|
165
218
|
/**
|
|
166
219
|
* Sends a message to a specific host or all hosts.
|
|
167
220
|
*/
|
|
168
221
|
sendToHostAsync(hostName: string, message: ioBroker.MessagePayload): Promise<ioBroker.Message | undefined>;
|
|
222
|
+
/**
|
|
223
|
+
* Sends a message to a specific host or all hosts.
|
|
224
|
+
*
|
|
225
|
+
* @param hostName name of the host
|
|
226
|
+
* @param command command name
|
|
227
|
+
* @param message message to send
|
|
228
|
+
*/
|
|
169
229
|
sendToHostAsync(hostName: string, command: string, message: ioBroker.MessagePayload): Promise<ioBroker.Message | undefined>;
|
|
170
230
|
/**
|
|
171
231
|
* Sends a message to a specific instance or all instances of some specific adapter.
|
|
172
232
|
*/
|
|
173
233
|
sendToAsync(instanceName: string, message: ioBroker.MessagePayload): Promise<ioBroker.Message | undefined>;
|
|
234
|
+
/**
|
|
235
|
+
* Sends a message to a specific instance or all instances of some specific adapter.
|
|
236
|
+
*
|
|
237
|
+
* @param instanceName name of the instance
|
|
238
|
+
* @param command command name
|
|
239
|
+
* @param message message to send
|
|
240
|
+
* @param options optional options to control the send behaviour
|
|
241
|
+
*/
|
|
174
242
|
sendToAsync(instanceName: string, command: string, message: ioBroker.MessagePayload, options?: SendToOptions): Promise<ioBroker.Message | undefined>;
|
|
175
243
|
/**
|
|
176
244
|
* Deletes a given file
|
|
177
245
|
*/
|
|
178
246
|
delFile(adapterName: string | null, path: string, callback: ioBroker.ErrnoCallback): void;
|
|
247
|
+
/**
|
|
248
|
+
* Deletes a given file
|
|
249
|
+
*
|
|
250
|
+
* @param adapterName adapter name, or null for the current adapter
|
|
251
|
+
* @param path path to the file
|
|
252
|
+
* @param options optional user context
|
|
253
|
+
* @param callback return result
|
|
254
|
+
*/
|
|
179
255
|
delFile(adapterName: string | null, path: string, options: unknown, callback: ioBroker.ErrnoCallback): void;
|
|
180
256
|
/**
|
|
181
257
|
* Writes a value into the states DB.
|
|
@@ -191,13 +267,41 @@ export declare interface AdapterClass {
|
|
|
191
267
|
* Writes a value (which might not belong to this adapter) into the states DB.
|
|
192
268
|
*/
|
|
193
269
|
setForeignStateAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack?: boolean): ioBroker.SetStatePromise;
|
|
270
|
+
/**
|
|
271
|
+
* Writes a value (which might not belong to this adapter) into the states DB.
|
|
272
|
+
*
|
|
273
|
+
* @param id object ID of the state
|
|
274
|
+
* @param state simple value or object with attributes
|
|
275
|
+
* @param options optional user context
|
|
276
|
+
*/
|
|
194
277
|
setForeignStateAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, options?: unknown): ioBroker.SetStatePromise;
|
|
278
|
+
/**
|
|
279
|
+
* Writes a value (which might not belong to this adapter) into the states DB.
|
|
280
|
+
*
|
|
281
|
+
* @param id object ID of the state
|
|
282
|
+
* @param state simple value or object with attributes
|
|
283
|
+
* @param ack is command(false) or status(true)
|
|
284
|
+
* @param options optional user context
|
|
285
|
+
*/
|
|
195
286
|
setForeignStateAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, options: unknown): ioBroker.SetStatePromise;
|
|
196
287
|
/**
|
|
197
288
|
* Get foreign objects by pattern, by specific type and resolve their enums.
|
|
198
289
|
*/
|
|
199
290
|
getForeignObjectsAsync<T extends ioBroker.ObjectType>(pattern: Pattern, type: T, enums?: ioBroker.EnumList | null, options?: unknown): ioBroker.GetObjectsPromiseTyped<T>;
|
|
291
|
+
/**
|
|
292
|
+
* Get foreign objects by pattern and specific type.
|
|
293
|
+
*
|
|
294
|
+
* @param pattern the pattern to match object ids against
|
|
295
|
+
* @param type restrict the result to objects of this type
|
|
296
|
+
* @param options optional user context
|
|
297
|
+
*/
|
|
200
298
|
getForeignObjectsAsync<T extends ioBroker.ObjectType>(pattern: Pattern, type: T, options?: unknown): ioBroker.GetObjectsPromiseTyped<T>;
|
|
299
|
+
/**
|
|
300
|
+
* Get foreign objects by pattern.
|
|
301
|
+
*
|
|
302
|
+
* @param pattern the pattern to match object ids against
|
|
303
|
+
* @param options optional user context
|
|
304
|
+
*/
|
|
201
305
|
getForeignObjectsAsync(pattern: Pattern, options?: unknown): ioBroker.GetObjectsPromise;
|
|
202
306
|
/**
|
|
203
307
|
* creates an object with type device
|
|
@@ -252,18 +356,43 @@ export declare interface AdapterClass {
|
|
|
252
356
|
* of the parent device to filter the channels by @param options (optional) Some internal options.
|
|
253
357
|
*/
|
|
254
358
|
getChannelsOfAsync(): Promise<ioBroker.ChannelObject[]>;
|
|
359
|
+
/**
|
|
360
|
+
* Returns a list of all channels in this adapter instance, optionally filtered by parent device.
|
|
361
|
+
*
|
|
362
|
+
* @param parentDevice Name of the parent device to filter the channels by
|
|
363
|
+
* @param options Some internal options
|
|
364
|
+
*/
|
|
255
365
|
getChannelsOfAsync(parentDevice: string, options?: unknown): Promise<ioBroker.ChannelObject[]>;
|
|
256
366
|
/**
|
|
257
367
|
* Returns a list of all channels in this adapter instance
|
|
258
368
|
*/
|
|
259
369
|
getChannels(callback: ioBroker.GetObjectsCallback3<ioBroker.ChannelObject>): void;
|
|
370
|
+
/**
|
|
371
|
+
* Returns a list of all channels in this adapter instance
|
|
372
|
+
*
|
|
373
|
+
* @param parentDevice Name of the parent device to filter the channels by
|
|
374
|
+
* @param callback return result
|
|
375
|
+
*/
|
|
260
376
|
getChannels(parentDevice: string, callback: ioBroker.GetObjectsCallback3<ioBroker.ChannelObject>): void;
|
|
377
|
+
/**
|
|
378
|
+
* Returns a list of all channels in this adapter instance
|
|
379
|
+
*
|
|
380
|
+
* @param parentDevice Name of the parent device to filter the channels by
|
|
381
|
+
* @param options optional user context
|
|
382
|
+
* @param callback return result
|
|
383
|
+
*/
|
|
261
384
|
getChannels(parentDevice: string, options: unknown, callback: ioBroker.GetObjectsCallback3<ioBroker.ChannelObject>): void;
|
|
262
385
|
/**
|
|
263
386
|
* Returns a list of all channels in this adapter instance @param parentDevice (optional)
|
|
264
387
|
* Name of the parent device to filter the channels by @param options (optional) Some internal options.
|
|
265
388
|
*/
|
|
266
389
|
getChannelsAsync(): Promise<ioBroker.ChannelObject[]>;
|
|
390
|
+
/**
|
|
391
|
+
* Returns a list of all channels in this adapter instance, optionally filtered by parent device.
|
|
392
|
+
*
|
|
393
|
+
* @param parentDevice Name of the parent device to filter the channels by
|
|
394
|
+
* @param options Some internal options
|
|
395
|
+
*/
|
|
267
396
|
getChannelsAsync(parentDevice: string, options?: unknown): Promise<ioBroker.ChannelObject[]>;
|
|
268
397
|
/**
|
|
269
398
|
* Returns a list of all states in this adapter instance @param parentDevice (optional)
|
|
@@ -271,7 +400,20 @@ export declare interface AdapterClass {
|
|
|
271
400
|
* Name of the parent channel to filter the channels by @param options (optional) Some internal options.
|
|
272
401
|
*/
|
|
273
402
|
getStatesOfAsync(): Promise<ioBroker.StateObject[]>;
|
|
403
|
+
/**
|
|
404
|
+
* Returns a list of all states in this adapter instance, optionally filtered by parent device/channel.
|
|
405
|
+
*
|
|
406
|
+
* @param parentDevice Name of the parent device to filter the states by
|
|
407
|
+
* @param parentChannel Name of the parent channel to filter the states by
|
|
408
|
+
*/
|
|
274
409
|
getStatesOfAsync(parentDevice: string, parentChannel?: string): Promise<ioBroker.StateObject[]>;
|
|
410
|
+
/**
|
|
411
|
+
* Returns a list of all states in this adapter instance, optionally filtered by parent device/channel.
|
|
412
|
+
*
|
|
413
|
+
* @param parentDevice Name of the parent device to filter the states by
|
|
414
|
+
* @param parentChannel Name of the parent channel to filter the states by
|
|
415
|
+
* @param options Some internal options
|
|
416
|
+
*/
|
|
275
417
|
getStatesOfAsync(parentDevice: string, parentChannel: string, options?: unknown): Promise<ioBroker.StateObject[]>;
|
|
276
418
|
}
|
|
277
419
|
|
|
@@ -406,6 +548,9 @@ export declare class AdapterClass extends EventEmitter {
|
|
|
406
548
|
private readonly SUPPORTED_FEATURES;
|
|
407
549
|
/** Controller for messaging related functionality */
|
|
408
550
|
private readonly uiMessagingController;
|
|
551
|
+
/**
|
|
552
|
+
* @param options Adapter options, or the adapter name as a string
|
|
553
|
+
*/
|
|
409
554
|
constructor(options: AdapterOptions | string);
|
|
410
555
|
/**
|
|
411
556
|
* Get the adapter scoped package identifier of a node module
|
|
@@ -413,47 +558,201 @@ export declare class AdapterClass extends EventEmitter {
|
|
|
413
558
|
* @param moduleName name of the node module
|
|
414
559
|
*/
|
|
415
560
|
getAdapterScopedPackageIdentifier(moduleName: string): string;
|
|
561
|
+
/**
|
|
562
|
+
* Install specified npm module
|
|
563
|
+
*
|
|
564
|
+
* @param moduleName name of the node module
|
|
565
|
+
* @param options install options including the version
|
|
566
|
+
*/
|
|
416
567
|
installNodeModule(moduleName: string, options: InstallNodeModuleOptions): Promise<CommandResult>;
|
|
417
568
|
private _installNodeModule;
|
|
418
569
|
/**
|
|
419
570
|
* List all additional installed node modules from this adapter
|
|
420
571
|
*/
|
|
421
572
|
listInstalledNodeModules(): Promise<string[]>;
|
|
573
|
+
/**
|
|
574
|
+
* Uninstall specified npm module
|
|
575
|
+
*
|
|
576
|
+
* @param moduleName name of the node module
|
|
577
|
+
*/
|
|
422
578
|
uninstallNodeModule(moduleName: string): Promise<CommandResult>;
|
|
579
|
+
/**
|
|
580
|
+
* Import a node module which has been installed via `installNodeModule`
|
|
581
|
+
*
|
|
582
|
+
* @param moduleName name of the node module
|
|
583
|
+
* @returns the required node module
|
|
584
|
+
*/
|
|
423
585
|
importNodeModule(moduleName: string): Promise<unknown>;
|
|
586
|
+
/**
|
|
587
|
+
* Decrypt the password/value with given key
|
|
588
|
+
*
|
|
589
|
+
* @param secretVal to use for decrypt (or value if only one parameter is given)
|
|
590
|
+
* @param value value to decrypt (if secret is provided)
|
|
591
|
+
*/
|
|
424
592
|
decrypt(secretVal: string, value?: string): string;
|
|
593
|
+
/**
|
|
594
|
+
* Decrypt the password/value with the system secret
|
|
595
|
+
*
|
|
596
|
+
* @param value value to decrypt
|
|
597
|
+
*/
|
|
425
598
|
decrypt(value: string): string;
|
|
599
|
+
/**
|
|
600
|
+
* Encrypt the password/value with given key
|
|
601
|
+
*
|
|
602
|
+
* @param secretVal to use for encrypting (or value if only one parameter is given)
|
|
603
|
+
* @param value value to encrypt (if secret is provided)
|
|
604
|
+
*/
|
|
426
605
|
encrypt(secretVal: string, value?: string): string;
|
|
606
|
+
/**
|
|
607
|
+
* Encrypt the password/value with the system secret
|
|
608
|
+
*
|
|
609
|
+
* @param value value to encrypt
|
|
610
|
+
*/
|
|
427
611
|
encrypt(value: string): string;
|
|
612
|
+
/**
|
|
613
|
+
* Read a session from the states DB
|
|
614
|
+
*
|
|
615
|
+
* @param id the session id
|
|
616
|
+
* @param callback return result
|
|
617
|
+
*/
|
|
428
618
|
getSession(id: string, callback: ioBroker.GetSessionCallback): MaybePromise;
|
|
429
619
|
private _getSession;
|
|
620
|
+
/**
|
|
621
|
+
* Store a session in the states DB
|
|
622
|
+
*
|
|
623
|
+
* @param id the session id
|
|
624
|
+
* @param ttl time to live in seconds
|
|
625
|
+
* @param data the session data to store
|
|
626
|
+
* @param callback return result
|
|
627
|
+
*/
|
|
430
628
|
setSession(id: string, ttl: number, data: Record<string, any>, callback?: ioBroker.ErrorCallback): MaybePromise;
|
|
431
629
|
private _setSession;
|
|
630
|
+
/**
|
|
631
|
+
* Destroy a session in the states DB
|
|
632
|
+
*
|
|
633
|
+
* @param id the session id
|
|
634
|
+
* @param callback return result
|
|
635
|
+
*/
|
|
432
636
|
destroySession(id: string, callback?: ioBroker.ErrorCallback): MaybePromise;
|
|
433
637
|
private _destroySession;
|
|
434
638
|
private _getObjectsByArray;
|
|
639
|
+
/**
|
|
640
|
+
* Stops the execution of adapter, but does not disable it.
|
|
641
|
+
*
|
|
642
|
+
* @param exitCode optional exit code
|
|
643
|
+
*/
|
|
435
644
|
terminate(exitCode?: number): never;
|
|
645
|
+
/**
|
|
646
|
+
* Stops the execution of adapter, but does not disable it.
|
|
647
|
+
*
|
|
648
|
+
* @param reason optional reason for termination
|
|
649
|
+
* @param exitCode optional exit code
|
|
650
|
+
*/
|
|
436
651
|
terminate(reason?: string, exitCode?: number): never;
|
|
652
|
+
/**
|
|
653
|
+
* Helper function to find next free port
|
|
654
|
+
*
|
|
655
|
+
* @param port port to start searching from
|
|
656
|
+
* @param host host to bind to
|
|
657
|
+
* @param callback return result
|
|
658
|
+
*/
|
|
437
659
|
getPort(port: number, host?: string, callback?: (port: number) => void): void;
|
|
660
|
+
/**
|
|
661
|
+
* Helper function to find next free port
|
|
662
|
+
*
|
|
663
|
+
* @param port port to start searching from
|
|
664
|
+
* @param callback return result
|
|
665
|
+
*/
|
|
438
666
|
getPort(port: number, callback?: (port: number) => void): void;
|
|
439
667
|
private _getPort;
|
|
668
|
+
/**
|
|
669
|
+
* Method to check for available Features for adapter development
|
|
670
|
+
*
|
|
671
|
+
* @param featureName the name of the feature to check
|
|
672
|
+
* @returns true/false if the feature is in the list of supported features
|
|
673
|
+
*/
|
|
440
674
|
supportsFeature(featureName: ioBroker.SupportedFeature): boolean;
|
|
675
|
+
/**
|
|
676
|
+
* Validates user and password
|
|
677
|
+
*
|
|
678
|
+
* @param user user name as text
|
|
679
|
+
* @param pw password as text
|
|
680
|
+
* @param options optional user context
|
|
681
|
+
* @param callback return result
|
|
682
|
+
*/
|
|
441
683
|
checkPassword(user: string, pw: string, options: Record<string, any>, callback: CheckPasswordCallback): Promise<void>;
|
|
684
|
+
/**
|
|
685
|
+
* Validates user and password
|
|
686
|
+
*
|
|
687
|
+
* @param user user name as text
|
|
688
|
+
* @param pw password as text
|
|
689
|
+
* @param callback return result
|
|
690
|
+
*/
|
|
442
691
|
checkPassword(user: string, pw: string, callback: CheckPasswordCallback): Promise<void>;
|
|
443
692
|
private _checkPassword;
|
|
444
693
|
/**
|
|
445
694
|
* This method updates the cached values in `this.usernames`
|
|
446
695
|
*/
|
|
447
696
|
private _updateUsernameCache;
|
|
697
|
+
/**
|
|
698
|
+
* Return ID of given username
|
|
699
|
+
*
|
|
700
|
+
* @param username name of the user
|
|
701
|
+
*/
|
|
448
702
|
getUserID(username: string): Promise<string | undefined>;
|
|
449
703
|
private _getUserID;
|
|
704
|
+
/**
|
|
705
|
+
* Sets the user's password
|
|
706
|
+
*
|
|
707
|
+
* @param user user name as text
|
|
708
|
+
* @param pw password as text
|
|
709
|
+
* @param options optional user context
|
|
710
|
+
* @param callback return result
|
|
711
|
+
*/
|
|
450
712
|
setPassword(user: string, pw: string, options: Record<string, any>, callback?: ioBroker.ErrorCallback): Promise<void>;
|
|
713
|
+
/**
|
|
714
|
+
* Sets the user's password
|
|
715
|
+
*
|
|
716
|
+
* @param user user name as text
|
|
717
|
+
* @param pw password as text
|
|
718
|
+
* @param callback return result
|
|
719
|
+
*/
|
|
451
720
|
setPassword(user: string, pw: string, callback?: ioBroker.ErrorCallback): Promise<void>;
|
|
452
721
|
private _setPassword;
|
|
722
|
+
/**
|
|
723
|
+
* Returns if user exists and is in the group
|
|
724
|
+
*
|
|
725
|
+
* @param user user name as text
|
|
726
|
+
* @param group group name
|
|
727
|
+
* @param options optional user context
|
|
728
|
+
* @param callback return result
|
|
729
|
+
*/
|
|
453
730
|
checkGroup(user: string, group: string, options: Record<string, any>, callback?: CheckGroupCallback): Promise<void>;
|
|
731
|
+
/**
|
|
732
|
+
* Returns if user exists and is in the group
|
|
733
|
+
*
|
|
734
|
+
* @param user user name as text
|
|
735
|
+
* @param group group name
|
|
736
|
+
* @param callback return result
|
|
737
|
+
*/
|
|
454
738
|
checkGroup(user: string, group: string, callback?: CheckGroupCallback): Promise<void>;
|
|
455
739
|
private _checkGroup;
|
|
740
|
+
/**
|
|
741
|
+
* Calculate the effective permissions of a user for the given commands
|
|
742
|
+
*
|
|
743
|
+
* @param user user name as text
|
|
744
|
+
* @param commandsPermissions the permission requirements of the commands
|
|
745
|
+
* @param options optional user context
|
|
746
|
+
* @param callback return result
|
|
747
|
+
*/
|
|
456
748
|
calculatePermissions(user: string, commandsPermissions: CommandsPermissions, options?: Record<string, any>, callback?: CalculatePermissionsCallback): Promise<void | ioBroker.PermissionSet>;
|
|
749
|
+
/**
|
|
750
|
+
* Calculate the effective permissions of a user for the given commands
|
|
751
|
+
*
|
|
752
|
+
* @param user user name as text
|
|
753
|
+
* @param commandsPermissions the permission requirements of the commands
|
|
754
|
+
* @param callback return result
|
|
755
|
+
*/
|
|
457
756
|
calculatePermissions(user: string, commandsPermissions: CommandsPermissions, callback?: CalculatePermissionsCallback): Promise<void | ioBroker.PermissionSet>;
|
|
458
757
|
private _calculatePermissions;
|
|
459
758
|
/**
|
|
@@ -469,6 +768,14 @@ export declare class AdapterClass extends EventEmitter {
|
|
|
469
768
|
* @param cert cert or path to cert
|
|
470
769
|
*/
|
|
471
770
|
private _readFileCertificate;
|
|
771
|
+
/**
|
|
772
|
+
* Get the certificates of the system.
|
|
773
|
+
*
|
|
774
|
+
* @param publicName name of the public certificate
|
|
775
|
+
* @param privateName name of the private key
|
|
776
|
+
* @param chainedName name of the chained certificate
|
|
777
|
+
* @param callback return result
|
|
778
|
+
*/
|
|
472
779
|
getCertificates(publicName?: string, privateName?: string, chainedName?: string, callback?: GetCertificatesCallback): void;
|
|
473
780
|
private _getCertificates;
|
|
474
781
|
/**
|
|
@@ -476,6 +783,11 @@ export declare class AdapterClass extends EventEmitter {
|
|
|
476
783
|
*
|
|
477
784
|
*/
|
|
478
785
|
restart(): void;
|
|
786
|
+
/**
|
|
787
|
+
* Updates the adapter config with new values, merged with the existing config.
|
|
788
|
+
*
|
|
789
|
+
* @param newConfig the new configuration values to merge into the existing config
|
|
790
|
+
*/
|
|
479
791
|
updateConfig(newConfig: Record<string, any>): ioBroker.SetObjectPromise;
|
|
480
792
|
private _updateConfig;
|
|
481
793
|
/**
|
|
@@ -483,20 +795,86 @@ export declare class AdapterClass extends EventEmitter {
|
|
|
483
795
|
*
|
|
484
796
|
*/
|
|
485
797
|
disable(): ioBroker.SetObjectPromise;
|
|
798
|
+
/**
|
|
799
|
+
* Reads the encrypted parameter from config.
|
|
800
|
+
*
|
|
801
|
+
* @param attribute the config attribute to decrypt
|
|
802
|
+
* @param callback return result
|
|
803
|
+
*/
|
|
486
804
|
getEncryptedConfig(attribute: string, callback?: GetEncryptedConfigCallback): Promise<string | string[] | void>;
|
|
487
805
|
private _getEncryptedConfig;
|
|
488
806
|
/**
|
|
489
807
|
* Get the system secret, after retrieved once it will be read from the cache
|
|
490
808
|
*/
|
|
491
809
|
private getSystemSecret;
|
|
810
|
+
/**
|
|
811
|
+
* Same as setTimeout, but it clears the running timers during the unloading process
|
|
812
|
+
*
|
|
813
|
+
* @param cb timer callback
|
|
814
|
+
* @param timeout timeout in milliseconds
|
|
815
|
+
* @param args as many arguments as needed, which will be passed to setTimeout
|
|
816
|
+
* @returns timer id
|
|
817
|
+
*/
|
|
492
818
|
setTimeout<TCallback extends TimeoutCallback>(cb: TCallback, timeout: number, ...args: Parameters<TCallback>): ioBroker.Timeout | undefined;
|
|
819
|
+
/**
|
|
820
|
+
* Same as clearTimeout but it checks the running timers on unload
|
|
821
|
+
*
|
|
822
|
+
* @param timer the timer object
|
|
823
|
+
*/
|
|
493
824
|
clearTimeout(timer: ioBroker.Timeout | undefined): void;
|
|
825
|
+
/**
|
|
826
|
+
* Delays the fulfillment of the promise the amount of time.
|
|
827
|
+
*
|
|
828
|
+
* @param timeout timeout in milliseconds
|
|
829
|
+
* @returns promise when timeout is over
|
|
830
|
+
*/
|
|
494
831
|
delay(timeout: number): Promise<void>;
|
|
832
|
+
/**
|
|
833
|
+
* Same as setInterval, but it clears the running intervals during the unloading process
|
|
834
|
+
*
|
|
835
|
+
* @param cb interval callback
|
|
836
|
+
* @param timeout interval in milliseconds
|
|
837
|
+
* @param args as many arguments as needed, which will be passed to setInterval
|
|
838
|
+
* @returns interval id
|
|
839
|
+
*/
|
|
495
840
|
setInterval<TCallback extends TimeoutCallback>(cb: TCallback, timeout: number, ...args: Parameters<TCallback>): ioBroker.Interval | undefined;
|
|
841
|
+
/**
|
|
842
|
+
* Same as clearInterval but it checks the running intervals on unload
|
|
843
|
+
*
|
|
844
|
+
* @param interval interval object
|
|
845
|
+
*/
|
|
496
846
|
clearInterval(interval: ioBroker.Interval | undefined): void;
|
|
847
|
+
/**
|
|
848
|
+
* Creates or overwrites an object in objectDB.
|
|
849
|
+
*
|
|
850
|
+
* @param id object ID (without namespace)
|
|
851
|
+
* @param obj the object to write
|
|
852
|
+
*/
|
|
497
853
|
setObject(id: string, obj: ioBroker.SettableObject): Promise<ioBroker.NonNullCallbackReturnTypeOf<ioBroker.SetObjectCallback>>;
|
|
854
|
+
/**
|
|
855
|
+
* Creates or overwrites an object in objectDB.
|
|
856
|
+
*
|
|
857
|
+
* @param id object ID (without namespace)
|
|
858
|
+
* @param obj the object to write
|
|
859
|
+
* @param callback return result
|
|
860
|
+
*/
|
|
498
861
|
setObject(id: string, obj: ioBroker.SettableObject, callback: ioBroker.SetObjectCallback): void;
|
|
862
|
+
/**
|
|
863
|
+
* Creates or overwrites an object in objectDB.
|
|
864
|
+
*
|
|
865
|
+
* @param id object ID (without namespace)
|
|
866
|
+
* @param obj the object to write
|
|
867
|
+
* @param options optional user context
|
|
868
|
+
* @param callback return result
|
|
869
|
+
*/
|
|
499
870
|
setObject(id: string, obj: ioBroker.SettableObject, options: unknown, callback: ioBroker.SetObjectCallback): void;
|
|
871
|
+
/**
|
|
872
|
+
* Creates or overwrites an object in objectDB.
|
|
873
|
+
*
|
|
874
|
+
* @param id object ID (without namespace)
|
|
875
|
+
* @param obj the object to write
|
|
876
|
+
* @param options optional user context
|
|
877
|
+
*/
|
|
500
878
|
setObject(id: string, obj: ioBroker.SettableObject, options: unknown): Promise<ioBroker.NonNullCallbackReturnTypeOf<ioBroker.SetObjectCallback>>;
|
|
501
879
|
private _setObject;
|
|
502
880
|
/**
|
|
@@ -508,51 +886,296 @@ export declare class AdapterClass extends EventEmitter {
|
|
|
508
886
|
* @param callback optional callback
|
|
509
887
|
*/
|
|
510
888
|
private _setObjectWithDefaultValue;
|
|
889
|
+
/**
|
|
890
|
+
* Get all states, channels and devices of this adapter.
|
|
891
|
+
*
|
|
892
|
+
* @param callback return result
|
|
893
|
+
*/
|
|
511
894
|
getAdapterObjects(callback: (objects: Record<string, ioBroker.AdapterScopedObject>) => void): Promise<Record<string, ioBroker.AdapterScopedObject> | void>;
|
|
512
895
|
private _getAdapterObjects;
|
|
896
|
+
/**
|
|
897
|
+
* Extend some object and create it if it does not exist
|
|
898
|
+
*
|
|
899
|
+
* @param id object ID (without namespace)
|
|
900
|
+
* @param objPart the partial object to merge into the existing object
|
|
901
|
+
*/
|
|
513
902
|
extendObject(id: string, objPart: ioBroker.PartialObject): ioBroker.SetObjectPromise;
|
|
903
|
+
/**
|
|
904
|
+
* Extend some object and create it if it does not exist
|
|
905
|
+
*
|
|
906
|
+
* @param id object ID (without namespace)
|
|
907
|
+
* @param objPart the partial object to merge into the existing object
|
|
908
|
+
* @param callback return result
|
|
909
|
+
*/
|
|
514
910
|
extendObject(id: string, objPart: ioBroker.PartialObject, callback?: ioBroker.SetObjectCallback): void;
|
|
911
|
+
/**
|
|
912
|
+
* Extend some object and create it if it does not exist
|
|
913
|
+
*
|
|
914
|
+
* @param id object ID (without namespace)
|
|
915
|
+
* @param objPart the partial object to merge into the existing object
|
|
916
|
+
* @param options optional user context
|
|
917
|
+
*/
|
|
515
918
|
extendObject(id: string, objPart: ioBroker.PartialObject, options: ioBroker.ExtendObjectOptions): ioBroker.SetObjectPromise;
|
|
919
|
+
/**
|
|
920
|
+
* Extend some object and create it if it does not exist
|
|
921
|
+
*
|
|
922
|
+
* @param id object ID (without namespace)
|
|
923
|
+
* @param objPart the partial object to merge into the existing object
|
|
924
|
+
* @param options optional user context
|
|
925
|
+
* @param callback return result
|
|
926
|
+
*/
|
|
516
927
|
extendObject(id: string, objPart: ioBroker.PartialObject, options: ioBroker.ExtendObjectOptions, callback?: ioBroker.SetObjectCallback): void;
|
|
517
928
|
private _extendObject;
|
|
929
|
+
/**
|
|
930
|
+
* Same as {@link AdapterClass.setObject}, but for any object.
|
|
931
|
+
*
|
|
932
|
+
* @param id object ID with namespace
|
|
933
|
+
* @param obj new object
|
|
934
|
+
*/
|
|
518
935
|
setForeignObject<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T, 'write'>>): Promise<ioBroker.NonNullCallbackReturnTypeOf<ioBroker.SetObjectCallback>>;
|
|
936
|
+
/**
|
|
937
|
+
* Same as {@link AdapterClass.setObject}, but for any object.
|
|
938
|
+
*
|
|
939
|
+
* @param id object ID with namespace
|
|
940
|
+
* @param obj new object
|
|
941
|
+
* @param callback return result
|
|
942
|
+
*/
|
|
519
943
|
setForeignObject<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, callback: ioBroker.SetObjectCallback): void;
|
|
944
|
+
/**
|
|
945
|
+
* Same as {@link AdapterClass.setObject}, but for any object.
|
|
946
|
+
*
|
|
947
|
+
* @param id object ID with namespace
|
|
948
|
+
* @param obj new object
|
|
949
|
+
* @param options optional user context
|
|
950
|
+
*/
|
|
520
951
|
setForeignObject<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, options: unknown): Promise<ioBroker.NonNullCallbackReturnTypeOf<ioBroker.SetObjectCallback>>;
|
|
952
|
+
/**
|
|
953
|
+
* Same as {@link AdapterClass.setObject}, but for any object.
|
|
954
|
+
*
|
|
955
|
+
* @param id object ID with namespace
|
|
956
|
+
* @param obj new object
|
|
957
|
+
* @param options optional user context
|
|
958
|
+
* @param callback return result
|
|
959
|
+
*/
|
|
521
960
|
setForeignObject<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, options: unknown, callback?: ioBroker.SetObjectCallback): void | Promise<ioBroker.NonNullCallbackReturnTypeOf<ioBroker.SetObjectCallback>>;
|
|
522
961
|
private _setForeignObject;
|
|
962
|
+
/**
|
|
963
|
+
* Extend any object and create it if it might not exist.
|
|
964
|
+
*
|
|
965
|
+
* @param id object ID with namespace
|
|
966
|
+
* @param objPart the partial object to merge into the existing object
|
|
967
|
+
*/
|
|
523
968
|
extendForeignObject<T extends string>(id: T, objPart: ioBroker.PartialObject<ioBroker.ObjectIdToObjectType<T, 'write'>>): Promise<ioBroker.CallbackReturnTypeOf<ioBroker.SetObjectCallback>>;
|
|
969
|
+
/**
|
|
970
|
+
* Extend any object and create it if it might not exist.
|
|
971
|
+
*
|
|
972
|
+
* @param id object ID with namespace
|
|
973
|
+
* @param objPart the partial object to merge into the existing object
|
|
974
|
+
* @param callback return result
|
|
975
|
+
*/
|
|
524
976
|
extendForeignObject<T extends string>(id: T, objPart: ioBroker.PartialObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, callback: ioBroker.SetObjectCallback): void;
|
|
977
|
+
/**
|
|
978
|
+
* Extend any object and create it if it might not exist.
|
|
979
|
+
*
|
|
980
|
+
* @param id object ID with namespace
|
|
981
|
+
* @param objPart the partial object to merge into the existing object
|
|
982
|
+
* @param options optional user context
|
|
983
|
+
* @param callback return result
|
|
984
|
+
*/
|
|
525
985
|
extendForeignObject<T extends string>(id: T, objPart: ioBroker.PartialObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, options: ioBroker.ExtendObjectOptions, callback: ioBroker.SetObjectCallback): void;
|
|
986
|
+
/**
|
|
987
|
+
* Extend any object and create it if it might not exist.
|
|
988
|
+
*
|
|
989
|
+
* @param id object ID with namespace
|
|
990
|
+
* @param objPart the partial object to merge into the existing object
|
|
991
|
+
* @param options optional user context
|
|
992
|
+
*/
|
|
526
993
|
extendForeignObject<T extends string>(id: T, objPart: ioBroker.PartialObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, options: ioBroker.ExtendObjectOptions): Promise<ioBroker.CallbackReturnTypeOf<ioBroker.SetObjectCallback>>;
|
|
527
994
|
private _extendForeignObjectAsync;
|
|
995
|
+
/**
|
|
996
|
+
* Checks if an object exists to the given id, id will be fixed first
|
|
997
|
+
*
|
|
998
|
+
* @param id id of the object
|
|
999
|
+
* @param options optional user context
|
|
1000
|
+
*/
|
|
528
1001
|
objectExists(id: string, options?: Record<string, any> | null): Promise<boolean | void>;
|
|
1002
|
+
/**
|
|
1003
|
+
* Checks if an object exists to the given id
|
|
1004
|
+
*
|
|
1005
|
+
* @param id id of the object
|
|
1006
|
+
* @param options optional user context
|
|
1007
|
+
*/
|
|
529
1008
|
foreignObjectExists(id: string, options?: Record<string, any> | null): Promise<boolean | void>;
|
|
1009
|
+
/**
|
|
1010
|
+
* Get object of this instance.
|
|
1011
|
+
*
|
|
1012
|
+
* @param id exactly object ID (without namespace)
|
|
1013
|
+
* @param callback return result
|
|
1014
|
+
*/
|
|
530
1015
|
getObject(id: string, callback: ioBroker.GetObjectCallback): void;
|
|
1016
|
+
/**
|
|
1017
|
+
* Get object of this instance.
|
|
1018
|
+
*
|
|
1019
|
+
* @param id exactly object ID (without namespace)
|
|
1020
|
+
* @param options optional user context
|
|
1021
|
+
* @param callback return result
|
|
1022
|
+
*/
|
|
531
1023
|
getObject(id: string, options: unknown, callback: ioBroker.GetObjectCallback): void;
|
|
1024
|
+
/**
|
|
1025
|
+
* Read object view from DB.
|
|
1026
|
+
*
|
|
1027
|
+
* @param design name of the design
|
|
1028
|
+
* @param search name of the view
|
|
1029
|
+
* @param params object containing startkey: first id to include in result; endkey: last id to include in result
|
|
1030
|
+
* @param callback return result
|
|
1031
|
+
*/
|
|
532
1032
|
getObjectView<Design extends string = string, Search extends string = string>(design: Design, search: Search, params: ioBroker.GetObjectViewParams | null | undefined, callback: ioBroker.GetObjectViewCallback<ioBroker.InferGetObjectViewItemType<Design, Search>>): void;
|
|
1033
|
+
/**
|
|
1034
|
+
* Read object view from DB.
|
|
1035
|
+
*
|
|
1036
|
+
* @param design name of the design
|
|
1037
|
+
* @param search name of the view
|
|
1038
|
+
* @param params object containing startkey: first id to include in result; endkey: last id to include in result
|
|
1039
|
+
* @param options additional options, e.g. for permissions
|
|
1040
|
+
* @param callback return result
|
|
1041
|
+
*/
|
|
533
1042
|
getObjectView<Design extends string = string, Search extends string = string>(design: Design, search: Search, params: ioBroker.GetObjectViewParams | null | undefined, options: unknown, callback: ioBroker.GetObjectViewCallback<ioBroker.InferGetObjectViewItemType<Design, Search>>): void;
|
|
534
1043
|
private _getObjectView;
|
|
1044
|
+
/**
|
|
1045
|
+
* Read object list from DB.
|
|
1046
|
+
*
|
|
1047
|
+
* @param params startkey and endkey information
|
|
1048
|
+
* @param callback optional callback
|
|
1049
|
+
*/
|
|
535
1050
|
getObjectList(params: ioBroker.GetObjectListParams | null, callback: ioBroker.GetObjectListCallback<ioBroker.Object>): void;
|
|
1051
|
+
/**
|
|
1052
|
+
* Read object list from DB.
|
|
1053
|
+
*
|
|
1054
|
+
* @param params startkey and endkey information
|
|
1055
|
+
* @param options additional options, e.g. for permissions
|
|
1056
|
+
* @param callback optional callback
|
|
1057
|
+
*/
|
|
536
1058
|
getObjectList(params: ioBroker.GetObjectListParams | null, options: {
|
|
537
1059
|
sorted?: boolean;
|
|
538
1060
|
} | Record<string, any>, callback: ioBroker.GetObjectListCallback<ioBroker.Object>): void;
|
|
1061
|
+
/**
|
|
1062
|
+
* Get the enum tree.
|
|
1063
|
+
*
|
|
1064
|
+
* @param callback return result
|
|
1065
|
+
*/
|
|
539
1066
|
getEnum(callback: ioBroker.GetEnumCallback): void;
|
|
1067
|
+
/**
|
|
1068
|
+
* Get the enum tree.
|
|
1069
|
+
*
|
|
1070
|
+
* @param name the enum name to read
|
|
1071
|
+
* @param callback return result
|
|
1072
|
+
*/
|
|
540
1073
|
getEnum(name: string, callback: ioBroker.GetEnumCallback): void;
|
|
1074
|
+
/**
|
|
1075
|
+
* Get the enum tree.
|
|
1076
|
+
*
|
|
1077
|
+
* @param name the enum name to read
|
|
1078
|
+
* @param options optional user context
|
|
1079
|
+
* @param callback return result
|
|
1080
|
+
*/
|
|
541
1081
|
getEnum(name: string, options: unknown, callback: ioBroker.GetEnumCallback): void;
|
|
542
1082
|
private _getEnum;
|
|
1083
|
+
/**
|
|
1084
|
+
* Read the members of given enums.
|
|
1085
|
+
*
|
|
1086
|
+
* @param callback return result
|
|
1087
|
+
*/
|
|
543
1088
|
getEnums(callback: ioBroker.GetEnumsCallback): void;
|
|
1089
|
+
/**
|
|
1090
|
+
* Read the members of given enums.
|
|
1091
|
+
*
|
|
1092
|
+
* @param enumList the enum(s) to read
|
|
1093
|
+
* @param callback return result
|
|
1094
|
+
*/
|
|
544
1095
|
getEnums(enumList: ioBroker.EnumList, callback: ioBroker.GetEnumsCallback): void;
|
|
1096
|
+
/**
|
|
1097
|
+
* Read the members of given enums.
|
|
1098
|
+
*
|
|
1099
|
+
* @param enumList the enum(s) to read
|
|
1100
|
+
* @param options optional user context
|
|
1101
|
+
* @param callback return result
|
|
1102
|
+
*/
|
|
545
1103
|
getEnums(enumList: ioBroker.EnumList, options: unknown, callback: ioBroker.GetEnumsCallback): void;
|
|
546
1104
|
private _getEnums;
|
|
1105
|
+
/**
|
|
1106
|
+
* Get all objects matching the given pattern.
|
|
1107
|
+
*
|
|
1108
|
+
* @param patter the pattern to match object ids against
|
|
1109
|
+
*/
|
|
547
1110
|
getForeignObjects(patter: Pattern): Promise<ioBroker.NonNullCallbackReturnTypeOf<ioBroker.GetObjectsCallback>>;
|
|
1111
|
+
/**
|
|
1112
|
+
* Get all objects matching the given pattern.
|
|
1113
|
+
*
|
|
1114
|
+
* @param pattern the pattern to match object ids against
|
|
1115
|
+
* @param callback return result
|
|
1116
|
+
*/
|
|
548
1117
|
getForeignObjects(pattern: Pattern, callback: ioBroker.GetObjectsCallback): void;
|
|
1118
|
+
/**
|
|
1119
|
+
* Get all objects matching the given pattern.
|
|
1120
|
+
*
|
|
1121
|
+
* @param pattern the pattern to match object ids against
|
|
1122
|
+
* @param options optional user context
|
|
1123
|
+
* @param callback return result
|
|
1124
|
+
*/
|
|
549
1125
|
getForeignObjects(pattern: Pattern, options: unknown, callback: ioBroker.GetObjectsCallback): void;
|
|
1126
|
+
/**
|
|
1127
|
+
* Get all objects of the given type matching the given pattern.
|
|
1128
|
+
*
|
|
1129
|
+
* @param pattern the pattern to match object ids against
|
|
1130
|
+
* @param type restrict the result to objects of this type
|
|
1131
|
+
* @param callback return result
|
|
1132
|
+
*/
|
|
550
1133
|
getForeignObjects<T extends ioBroker.ObjectType>(pattern: Pattern, type: T, callback: ioBroker.GetObjectsCallbackTyped<T>): void;
|
|
1134
|
+
/**
|
|
1135
|
+
* Get all objects of the given type matching the given pattern.
|
|
1136
|
+
*
|
|
1137
|
+
* @param pattern the pattern to match object ids against
|
|
1138
|
+
* @param type restrict the result to objects of this type
|
|
1139
|
+
* @param enums restrict the result to objects within these enums
|
|
1140
|
+
* @param callback return result
|
|
1141
|
+
*/
|
|
551
1142
|
getForeignObjects<T extends ioBroker.ObjectType>(pattern: Pattern, type: T, enums: ioBroker.EnumList, callback: ioBroker.GetObjectsCallbackTyped<T>): void;
|
|
1143
|
+
/**
|
|
1144
|
+
* Get all objects of the given type matching the given pattern.
|
|
1145
|
+
*
|
|
1146
|
+
* @param pattern the pattern to match object ids against
|
|
1147
|
+
* @param type restrict the result to objects of this type
|
|
1148
|
+
* @param options optional user context
|
|
1149
|
+
* @param callback return result
|
|
1150
|
+
*/
|
|
552
1151
|
getForeignObjects<T extends ioBroker.ObjectType>(pattern: Pattern, type: T, options: unknown, callback: ioBroker.GetObjectsCallbackTyped<T>): void;
|
|
1152
|
+
/**
|
|
1153
|
+
* Get all objects of the given type matching the given pattern.
|
|
1154
|
+
*
|
|
1155
|
+
* @param pattern the pattern to match object ids against
|
|
1156
|
+
* @param type restrict the result to objects of this type
|
|
1157
|
+
* @param enums restrict the result to objects within these enums
|
|
1158
|
+
* @param options optional user context
|
|
1159
|
+
* @param callback return result
|
|
1160
|
+
*/
|
|
553
1161
|
getForeignObjects<T extends ioBroker.ObjectType>(pattern: Pattern, type: T, enums: ioBroker.EnumList | null, options: unknown, callback: ioBroker.GetObjectsCallbackTyped<T>): void;
|
|
554
1162
|
private _getForeignObjects;
|
|
1163
|
+
/**
|
|
1164
|
+
* Find any object by name or ID.
|
|
1165
|
+
*
|
|
1166
|
+
* @param idOrName exactly object ID or name (without namespace)
|
|
1167
|
+
* @param type optional `common.type` of state: 'number', 'string', 'boolean', 'file', ...
|
|
1168
|
+
* @param callback return result
|
|
1169
|
+
*/
|
|
555
1170
|
findForeignObject(idOrName: string, type: ioBroker.CommonType | null, callback: ioBroker.FindObjectCallback): void;
|
|
1171
|
+
/**
|
|
1172
|
+
* Find any object by name or ID.
|
|
1173
|
+
*
|
|
1174
|
+
* @param idOrName exactly object ID or name (without namespace)
|
|
1175
|
+
* @param type optional `common.type` of state: 'number', 'string', 'boolean', 'file', ...
|
|
1176
|
+
* @param options optional user context
|
|
1177
|
+
* @param callback return result
|
|
1178
|
+
*/
|
|
556
1179
|
findForeignObject(idOrName: string, type: ioBroker.CommonType | null, options: {
|
|
557
1180
|
user?: `system.user.${string}`;
|
|
558
1181
|
language?: ioBroker.Languages;
|
|
@@ -569,7 +1192,7 @@ export declare class AdapterClass extends EventEmitter {
|
|
|
569
1192
|
* @param options optional user context with language
|
|
570
1193
|
* @param options.user current user
|
|
571
1194
|
* @param options.language language in which the search must be done for multi-language names
|
|
572
|
-
* @
|
|
1195
|
+
* @returns if the object was found by ID it will return id and may be the multi-language name it exists. If the object was found by name it will return id and the multi-language name. If the object was not found, it will return only name that was searched for.
|
|
573
1196
|
*/
|
|
574
1197
|
findForeignObjectAsync(id: string, type: ioBroker.CommonType | null, options?: {
|
|
575
1198
|
user?: `system.user.${string}`;
|
|
@@ -578,29 +1201,164 @@ export declare class AdapterClass extends EventEmitter {
|
|
|
578
1201
|
id?: string;
|
|
579
1202
|
name: ioBroker.StringOrTranslated;
|
|
580
1203
|
}>;
|
|
1204
|
+
/**
|
|
1205
|
+
* Get any object.
|
|
1206
|
+
*
|
|
1207
|
+
* @param id exactly object ID (with namespace)
|
|
1208
|
+
* @param callback return result
|
|
1209
|
+
*/
|
|
581
1210
|
getForeignObject<T extends string>(id: T, callback: ioBroker.GetObjectCallback<T>): void | Promise<void | ioBroker.ObjectIdToObjectType<T> | null>;
|
|
1211
|
+
/**
|
|
1212
|
+
* Get any object.
|
|
1213
|
+
*
|
|
1214
|
+
* @param id exactly object ID (with namespace)
|
|
1215
|
+
* @param options optional user context
|
|
1216
|
+
* @param callback return result
|
|
1217
|
+
*/
|
|
582
1218
|
getForeignObject<T extends string>(id: T, options: unknown, callback: ioBroker.GetObjectCallback<T>): void | Promise<void | ioBroker.ObjectIdToObjectType<T> | null>;
|
|
583
1219
|
private _getForeignObject;
|
|
1220
|
+
/**
|
|
1221
|
+
* Delete an object of this instance.
|
|
1222
|
+
*
|
|
1223
|
+
* @param id exactly object ID (without namespace)
|
|
1224
|
+
* @param callback return result
|
|
1225
|
+
*/
|
|
584
1226
|
delObject(id: string, callback?: ioBroker.ErrorCallback): void;
|
|
1227
|
+
/**
|
|
1228
|
+
* Delete an object of this instance.
|
|
1229
|
+
*
|
|
1230
|
+
* @param id exactly object ID (without namespace)
|
|
1231
|
+
* @param options optional user context. E.g. recursive option could be true
|
|
1232
|
+
* @param callback return result
|
|
1233
|
+
*/
|
|
585
1234
|
delObject(id: string, options?: ioBroker.DelObjectOptions | null, callback?: ioBroker.ErrorCallback): void;
|
|
586
1235
|
private _deleteObjects;
|
|
1236
|
+
/**
|
|
1237
|
+
* Delete any object.
|
|
1238
|
+
*
|
|
1239
|
+
* @param id exactly object ID (with namespace)
|
|
1240
|
+
* @param callback return result
|
|
1241
|
+
*/
|
|
587
1242
|
delForeignObject(id: string, callback?: ioBroker.ErrorCallback): void;
|
|
1243
|
+
/**
|
|
1244
|
+
* Delete any object.
|
|
1245
|
+
*
|
|
1246
|
+
* @param id exactly object ID (with namespace)
|
|
1247
|
+
* @param options optional user context or `{ recursive: true }` to delete all underlying objects
|
|
1248
|
+
* @param callback return result
|
|
1249
|
+
*/
|
|
588
1250
|
delForeignObject(id: string, options: ioBroker.DelObjectOptions, callback?: ioBroker.ErrorCallback): void;
|
|
589
1251
|
private _delForeignObject;
|
|
1252
|
+
/**
|
|
1253
|
+
* Subscribe for the changes of objects in this instance.
|
|
1254
|
+
*
|
|
1255
|
+
* @param pattern pattern like 'channel.*' or '*' (all objects of this adapter) - without namespaces
|
|
1256
|
+
* @param callback optional returns result
|
|
1257
|
+
*/
|
|
590
1258
|
subscribeObjects(pattern: Pattern, callback?: ioBroker.ErrorCallback): void;
|
|
1259
|
+
/**
|
|
1260
|
+
* Subscribe for the changes of objects in this instance.
|
|
1261
|
+
*
|
|
1262
|
+
* @param pattern pattern like 'channel.*' or '*' (all objects of this adapter) - without namespaces
|
|
1263
|
+
* @param options optional user context
|
|
1264
|
+
* @param callback optional returns result
|
|
1265
|
+
*/
|
|
591
1266
|
subscribeObjects(pattern: Pattern, options: unknown, callback?: ioBroker.ErrorCallback): void;
|
|
1267
|
+
/**
|
|
1268
|
+
* Unsubscribe on the changes of objects in this instance.
|
|
1269
|
+
*
|
|
1270
|
+
* @param pattern pattern like 'channel.*' or '*' (all objects) - without namespaces
|
|
1271
|
+
* @param callback optional returns result
|
|
1272
|
+
*/
|
|
592
1273
|
unsubscribeObjects(pattern: Pattern, callback?: ioBroker.ErrorCallback): void;
|
|
1274
|
+
/**
|
|
1275
|
+
* Unsubscribe on the changes of objects in this instance.
|
|
1276
|
+
*
|
|
1277
|
+
* @param pattern pattern like 'channel.*' or '*' (all objects) - without namespaces
|
|
1278
|
+
* @param options optional user context
|
|
1279
|
+
* @param callback optional returns result
|
|
1280
|
+
*/
|
|
593
1281
|
unsubscribeObjects(pattern: Pattern, options: unknown, callback?: ioBroker.ErrorCallback): void;
|
|
1282
|
+
/**
|
|
1283
|
+
* Subscribe for the changes of objects in any instance.
|
|
1284
|
+
*
|
|
1285
|
+
* @param pattern pattern like 'channel.*' or '*' (all objects) - without namespaces. You can use array of patterns
|
|
1286
|
+
* @param callback optional returns result
|
|
1287
|
+
*/
|
|
594
1288
|
subscribeForeignObjects(pattern: string | string[], callback?: ioBroker.ErrorCallback): void;
|
|
1289
|
+
/**
|
|
1290
|
+
* Subscribe for the changes of objects in any instance.
|
|
1291
|
+
*
|
|
1292
|
+
* @param pattern pattern like 'channel.*' or '*' (all objects) - without namespaces. You can use array of patterns
|
|
1293
|
+
* @param options optional user context
|
|
1294
|
+
* @param callback optional returns result
|
|
1295
|
+
*/
|
|
595
1296
|
subscribeForeignObjects(pattern: string | string[], options: unknown, callback?: ioBroker.ErrorCallback): void;
|
|
1297
|
+
/**
|
|
1298
|
+
* Unsubscribe for the patterns on all objects.
|
|
1299
|
+
*
|
|
1300
|
+
* @param pattern pattern like 'channel.*' or '*' (all objects) - without namespaces
|
|
1301
|
+
* @param callback optional returns result
|
|
1302
|
+
*/
|
|
596
1303
|
unsubscribeForeignObjects(pattern: string | string[], callback?: ioBroker.ErrorCallback): void;
|
|
1304
|
+
/**
|
|
1305
|
+
* Unsubscribe for the patterns on all objects.
|
|
1306
|
+
*
|
|
1307
|
+
* @param pattern pattern like 'channel.*' or '*' (all objects) - without namespaces
|
|
1308
|
+
* @param options optional user context
|
|
1309
|
+
* @param callback optional returns result
|
|
1310
|
+
*/
|
|
597
1311
|
unsubscribeForeignObjects(pattern: string | string[], options: unknown, callback?: ioBroker.ErrorCallback): void;
|
|
1312
|
+
/**
|
|
1313
|
+
* Subscribe for the changes of files in specific instance.
|
|
1314
|
+
*
|
|
1315
|
+
* @param id adapter ID like 'vis-2.0' or 'vis-2.admin'
|
|
1316
|
+
* @param pattern pattern like 'channel.*' or '*' (all files) - without namespaces. You can use array of patterns
|
|
1317
|
+
* @param options optional user context
|
|
1318
|
+
*/
|
|
598
1319
|
subscribeForeignFiles(id: string, pattern: string | string[], options?: unknown): Promise<void>;
|
|
1320
|
+
/**
|
|
1321
|
+
* Unsubscribe for the changes of files on specific instance.
|
|
1322
|
+
*
|
|
1323
|
+
* @param id adapter ID like 'vis-2.0' or 'vis-2.admin'
|
|
1324
|
+
* @param pattern pattern like 'channel.*' or '*' (all objects) - without namespaces
|
|
1325
|
+
* @param options optional user context
|
|
1326
|
+
*/
|
|
599
1327
|
unsubscribeForeignFiles(id: string, pattern: string | string[], options?: unknown): Promise<void>;
|
|
1328
|
+
/**
|
|
1329
|
+
* Same as {@link AdapterClass.setObject}, but with check if the object exists.
|
|
1330
|
+
*
|
|
1331
|
+
* @param id object ID, that must be overwritten or created.
|
|
1332
|
+
* @param obj new object
|
|
1333
|
+
* @param callback return result
|
|
1334
|
+
*/
|
|
600
1335
|
setObjectNotExists(id: string, obj: ioBroker.SettableObject, callback?: ioBroker.SetObjectCallback): Promise<void | ioBroker.CallbackReturnTypeOf<ioBroker.SetObjectCallback>> | void;
|
|
1336
|
+
/**
|
|
1337
|
+
* Same as {@link AdapterClass.setObject}, but with check if the object exists.
|
|
1338
|
+
*
|
|
1339
|
+
* @param id object ID, that must be overwritten or created.
|
|
1340
|
+
* @param obj new object
|
|
1341
|
+
* @param options optional user context
|
|
1342
|
+
* @param callback return result
|
|
1343
|
+
*/
|
|
601
1344
|
setObjectNotExists(id: string, obj: ioBroker.SettableObject, options: unknown, callback?: ioBroker.SetObjectCallback): Promise<void | ioBroker.CallbackReturnTypeOf<ioBroker.SetObjectCallback>> | void;
|
|
602
1345
|
private _setObjectNotExists;
|
|
1346
|
+
/**
|
|
1347
|
+
* Same as {@link AdapterClass.setForeignObject}, but with check if the object exists.
|
|
1348
|
+
*
|
|
1349
|
+
* @param id object ID, that must be overwritten or created.
|
|
1350
|
+
* @param obj new object
|
|
1351
|
+
* @param callback return result
|
|
1352
|
+
*/
|
|
603
1353
|
setForeignObjectNotExists<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, callback?: ioBroker.SetObjectCallback): void;
|
|
1354
|
+
/**
|
|
1355
|
+
* Same as {@link AdapterClass.setForeignObject}, but with check if the object exists.
|
|
1356
|
+
*
|
|
1357
|
+
* @param id object ID, that must be overwritten or created.
|
|
1358
|
+
* @param obj new object
|
|
1359
|
+
* @param options optional user context
|
|
1360
|
+
* @param callback return result
|
|
1361
|
+
*/
|
|
604
1362
|
setForeignObjectNotExists<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, options: unknown, callback?: ioBroker.SetObjectCallback): void;
|
|
605
1363
|
private _setForeignObjectNotExists;
|
|
606
1364
|
private _DCS2ID;
|
|
@@ -635,10 +1393,46 @@ export declare class AdapterClass extends EventEmitter {
|
|
|
635
1393
|
/** @deprecated use `this.delObject` instead */
|
|
636
1394
|
deleteDevice(deviceName: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
|
|
637
1395
|
private _deleteDevice;
|
|
1396
|
+
/**
|
|
1397
|
+
* Add a channel to an enum.
|
|
1398
|
+
*
|
|
1399
|
+
* @param enumName the enum category (e.g. rooms, functions)
|
|
1400
|
+
* @param addTo the enum id to add the channel to
|
|
1401
|
+
* @param parentDevice the parent device name
|
|
1402
|
+
* @param channelName the name of the channel
|
|
1403
|
+
* @param callback return result
|
|
1404
|
+
*/
|
|
638
1405
|
addChannelToEnum(enumName: string, addTo: string, parentDevice: string, channelName: string, callback?: ioBroker.ErrorCallback): void;
|
|
1406
|
+
/**
|
|
1407
|
+
* Add a channel to an enum.
|
|
1408
|
+
*
|
|
1409
|
+
* @param enumName the enum category (e.g. rooms, functions)
|
|
1410
|
+
* @param addTo the enum id to add the channel to
|
|
1411
|
+
* @param parentDevice the parent device name
|
|
1412
|
+
* @param channelName the name of the channel
|
|
1413
|
+
* @param options optional user context
|
|
1414
|
+
* @param callback return result
|
|
1415
|
+
*/
|
|
639
1416
|
addChannelToEnum(enumName: string, addTo: string, parentDevice: string, channelName: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
|
|
640
1417
|
private _addChannelToEnum;
|
|
1418
|
+
/**
|
|
1419
|
+
* Remove a channel from an enum.
|
|
1420
|
+
*
|
|
1421
|
+
* @param enumName the enum category (e.g. rooms, functions)
|
|
1422
|
+
* @param parentDevice the parent device name
|
|
1423
|
+
* @param channelName the name of the channel
|
|
1424
|
+
* @param callback return result
|
|
1425
|
+
*/
|
|
641
1426
|
deleteChannelFromEnum(enumName: string, parentDevice: string, channelName: string, callback?: ioBroker.ErrorCallback): void;
|
|
1427
|
+
/**
|
|
1428
|
+
* Remove a channel from an enum.
|
|
1429
|
+
*
|
|
1430
|
+
* @param enumName the enum category (e.g. rooms, functions)
|
|
1431
|
+
* @param parentDevice the parent device name
|
|
1432
|
+
* @param channelName the name of the channel
|
|
1433
|
+
* @param options optional user context
|
|
1434
|
+
* @param callback return result
|
|
1435
|
+
*/
|
|
642
1436
|
deleteChannelFromEnum(enumName: string, parentDevice: string, channelName: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
|
|
643
1437
|
private _deleteChannelFromEnum;
|
|
644
1438
|
/** @deprecated use `this.delObject` instead */
|
|
@@ -655,61 +1449,403 @@ export declare class AdapterClass extends EventEmitter {
|
|
|
655
1449
|
/** @deprecated use `this.delObject` instead */
|
|
656
1450
|
deleteState(parentDevice: string | null, parentChannel: string | null, stateName: string, options?: unknown, callback?: ioBroker.ErrorCallback): void;
|
|
657
1451
|
private _deleteState;
|
|
1452
|
+
/**
|
|
1453
|
+
* Get all devices of this adapter.
|
|
1454
|
+
*
|
|
1455
|
+
* @param callback return result
|
|
1456
|
+
*/
|
|
658
1457
|
getDevices(callback: ioBroker.GetObjectsCallback3<ioBroker.DeviceObject>): void;
|
|
1458
|
+
/**
|
|
1459
|
+
* Get all devices of this adapter.
|
|
1460
|
+
*
|
|
1461
|
+
* @param options optional user context
|
|
1462
|
+
* @param callback return result
|
|
1463
|
+
*/
|
|
659
1464
|
getDevices(options: unknown, callback: ioBroker.GetObjectsCallback3<ioBroker.DeviceObject>): void;
|
|
660
1465
|
private _getDevices;
|
|
1466
|
+
/**
|
|
1467
|
+
* Get all channels of this adapter or of the given device.
|
|
1468
|
+
*
|
|
1469
|
+
* @param callback return result
|
|
1470
|
+
*/
|
|
661
1471
|
getChannelsOf(callback: ioBroker.GetObjectsCallback3<ioBroker.ChannelObject>): void;
|
|
1472
|
+
/**
|
|
1473
|
+
* Get all channels of this adapter or of the given device.
|
|
1474
|
+
*
|
|
1475
|
+
* @param parentDevice the parent device name
|
|
1476
|
+
* @param callback return result
|
|
1477
|
+
*/
|
|
662
1478
|
getChannelsOf(parentDevice: string, callback: ioBroker.GetObjectsCallback3<ioBroker.ChannelObject>): void;
|
|
1479
|
+
/**
|
|
1480
|
+
* Get all channels of this adapter or of the given device.
|
|
1481
|
+
*
|
|
1482
|
+
* @param parentDevice the parent device name
|
|
1483
|
+
* @param options optional user context
|
|
1484
|
+
* @param callback return result
|
|
1485
|
+
*/
|
|
663
1486
|
getChannelsOf(parentDevice: string, options: unknown, callback: ioBroker.GetObjectsCallback3<ioBroker.ChannelObject>): void;
|
|
664
1487
|
private _getChannelsOf;
|
|
1488
|
+
/**
|
|
1489
|
+
* Get all states of this adapter or of the given device/channel.
|
|
1490
|
+
*
|
|
1491
|
+
* @param callback return result
|
|
1492
|
+
*/
|
|
665
1493
|
getStatesOf(callback: ioBroker.GetObjectsCallback3<ioBroker.StateObject>): void;
|
|
1494
|
+
/**
|
|
1495
|
+
* Get all states of this adapter or of the given device/channel.
|
|
1496
|
+
*
|
|
1497
|
+
* @param parentDevice the parent device name
|
|
1498
|
+
* @param callback return result
|
|
1499
|
+
*/
|
|
666
1500
|
getStatesOf(parentDevice: string, callback: ioBroker.GetObjectsCallback3<ioBroker.StateObject>): void;
|
|
1501
|
+
/**
|
|
1502
|
+
* Get all states of this adapter or of the given device/channel.
|
|
1503
|
+
*
|
|
1504
|
+
* @param parentDevice the parent device name
|
|
1505
|
+
* @param parentChannel the parent channel name
|
|
1506
|
+
* @param callback return result
|
|
1507
|
+
*/
|
|
667
1508
|
getStatesOf(parentDevice: string | null | undefined, parentChannel: string | null | undefined, callback: ioBroker.GetObjectsCallback3<ioBroker.StateObject>): void;
|
|
1509
|
+
/**
|
|
1510
|
+
* Get all states of this adapter or of the given device/channel.
|
|
1511
|
+
*
|
|
1512
|
+
* @param parentDevice the parent device name
|
|
1513
|
+
* @param parentChannel the parent channel name
|
|
1514
|
+
* @param options optional user context
|
|
1515
|
+
* @param callback return result
|
|
1516
|
+
*/
|
|
668
1517
|
getStatesOf(parentDevice: string | null | undefined, parentChannel: string | null | undefined, options: unknown, callback: ioBroker.GetObjectsCallback3<ioBroker.StateObject>): void;
|
|
669
1518
|
private _getStatesOf;
|
|
1519
|
+
/**
|
|
1520
|
+
* Add a state to an enum.
|
|
1521
|
+
*
|
|
1522
|
+
* @param enumName the enum category (e.g. rooms, functions)
|
|
1523
|
+
* @param addTo the enum id to add the state to
|
|
1524
|
+
* @param parentDevice the parent device name
|
|
1525
|
+
* @param parentChannel the parent channel name
|
|
1526
|
+
* @param stateName the name of the state
|
|
1527
|
+
* @param callback return result
|
|
1528
|
+
*/
|
|
670
1529
|
addStateToEnum(enumName: string, addTo: string, parentDevice: string, parentChannel: string, stateName: string, callback?: ioBroker.ErrorCallback): void;
|
|
1530
|
+
/**
|
|
1531
|
+
* Add a state to an enum.
|
|
1532
|
+
*
|
|
1533
|
+
* @param enumName the enum category (e.g. rooms, functions)
|
|
1534
|
+
* @param addTo the enum id to add the state to
|
|
1535
|
+
* @param parentDevice the parent device name
|
|
1536
|
+
* @param parentChannel the parent channel name
|
|
1537
|
+
* @param stateName the name of the state
|
|
1538
|
+
* @param options optional user context
|
|
1539
|
+
* @param callback return result
|
|
1540
|
+
*/
|
|
671
1541
|
addStateToEnum(enumName: string, addTo: string, parentDevice: string, parentChannel: string, stateName: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
|
|
672
1542
|
private _addStateToEnum;
|
|
1543
|
+
/**
|
|
1544
|
+
* Remove a state from an enum.
|
|
1545
|
+
*
|
|
1546
|
+
* @param enumName the enum category (e.g. rooms, functions)
|
|
1547
|
+
* @param parentDevice the parent device name
|
|
1548
|
+
* @param parentChannel the parent channel name
|
|
1549
|
+
* @param stateName the name of the state
|
|
1550
|
+
* @param callback return result
|
|
1551
|
+
*/
|
|
673
1552
|
deleteStateFromEnum(enumName: string, parentDevice: string, parentChannel: string, stateName: string, callback?: ioBroker.ErrorCallback): void;
|
|
1553
|
+
/**
|
|
1554
|
+
* Remove a state from an enum.
|
|
1555
|
+
*
|
|
1556
|
+
* @param enumName the enum category (e.g. rooms, functions)
|
|
1557
|
+
* @param parentDevice the parent device name
|
|
1558
|
+
* @param parentChannel the parent channel name
|
|
1559
|
+
* @param stateName the name of the state
|
|
1560
|
+
* @param options optional user context
|
|
1561
|
+
* @param callback return result
|
|
1562
|
+
*/
|
|
674
1563
|
deleteStateFromEnum(enumName: string, parentDevice: string, parentChannel: string, stateName: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
|
|
675
1564
|
private _deleteStateFromEnum;
|
|
1565
|
+
/**
|
|
1566
|
+
* Change file access rights
|
|
1567
|
+
*
|
|
1568
|
+
* @param adapter adapter name, or null for the current adapter
|
|
1569
|
+
* @param path path to file without adapter name
|
|
1570
|
+
* @param options data with mode
|
|
1571
|
+
* @param callback return result
|
|
1572
|
+
*/
|
|
676
1573
|
chmodFile(adapter: string | null, path: string, options: {
|
|
677
1574
|
mode: number | string;
|
|
678
1575
|
} | Record<string, any>, callback: ioBroker.ChownFileCallback): void;
|
|
1576
|
+
/**
|
|
1577
|
+
* Change file access rights
|
|
1578
|
+
*
|
|
1579
|
+
* @param adapter adapter name, or null for the current adapter
|
|
1580
|
+
* @param path path to file without adapter name
|
|
1581
|
+
* @param callback return result
|
|
1582
|
+
*/
|
|
679
1583
|
chmodFile(adapter: string | null, path: string, callback: ioBroker.ChownFileCallback): void;
|
|
1584
|
+
/**
|
|
1585
|
+
* Change a file owner
|
|
1586
|
+
*
|
|
1587
|
+
* @param _adapter adapter name, or null for the current adapter
|
|
1588
|
+
* @param path path to file without adapter name
|
|
1589
|
+
* @param options data with owner and ownerGroup
|
|
1590
|
+
* @param callback return result
|
|
1591
|
+
*/
|
|
680
1592
|
chownFile(_adapter: string, path: string, options: unknown, callback: (err?: Error | null, processedFiles?: any) => void): void;
|
|
1593
|
+
/**
|
|
1594
|
+
* Change a file owner
|
|
1595
|
+
*
|
|
1596
|
+
* @param _adapter adapter name, or null for the current adapter
|
|
1597
|
+
* @param path path to file without adapter name
|
|
1598
|
+
* @param callback return result
|
|
1599
|
+
*/
|
|
681
1600
|
chownFile(_adapter: string, path: string, callback: (err?: Error | null, processedFiles?: any) => void): void;
|
|
1601
|
+
/**
|
|
1602
|
+
* Read directory from DB.
|
|
1603
|
+
*
|
|
1604
|
+
* @param adapterName adapter name, or null for the current adapter
|
|
1605
|
+
* @param path path to the directory
|
|
1606
|
+
* @param callback return result
|
|
1607
|
+
*/
|
|
682
1608
|
readDir(adapterName: string | null, path: string, callback: ioBroker.ReadDirCallback): void;
|
|
1609
|
+
/**
|
|
1610
|
+
* Read directory from DB.
|
|
1611
|
+
*
|
|
1612
|
+
* @param adapterName adapter name, or null for the current adapter
|
|
1613
|
+
* @param path path to the directory
|
|
1614
|
+
* @param options optional user context
|
|
1615
|
+
* @param callback return result
|
|
1616
|
+
*/
|
|
683
1617
|
readDir(adapterName: string | null, path: string, options: unknown, callback: ioBroker.ReadDirCallback): void;
|
|
1618
|
+
/**
|
|
1619
|
+
* Deletes a file in the DB.
|
|
1620
|
+
*
|
|
1621
|
+
* @param adapterName adapter name, or null for the current adapter
|
|
1622
|
+
* @param path path to the file
|
|
1623
|
+
* @param callback return result
|
|
1624
|
+
*/
|
|
684
1625
|
unlink(adapterName: string | null, path: string, callback: ioBroker.ErrnoCallback): void;
|
|
1626
|
+
/**
|
|
1627
|
+
* Deletes a file in the DB.
|
|
1628
|
+
*
|
|
1629
|
+
* @param adapterName adapter name, or null for the current adapter
|
|
1630
|
+
* @param path path to the file
|
|
1631
|
+
* @param options optional user context
|
|
1632
|
+
* @param callback return result
|
|
1633
|
+
*/
|
|
685
1634
|
unlink(adapterName: string | null, path: string, options: unknown, callback: ioBroker.ErrnoCallback): void;
|
|
1635
|
+
/**
|
|
1636
|
+
* Renames a file in the DB.
|
|
1637
|
+
*
|
|
1638
|
+
* @param adapterName adapter name, or null for the current adapter
|
|
1639
|
+
* @param oldName current path to the file
|
|
1640
|
+
* @param newName new path to the file
|
|
1641
|
+
* @param callback return result
|
|
1642
|
+
*/
|
|
686
1643
|
rename(adapterName: string | null, oldName: string, newName: string, callback: ioBroker.ErrnoCallback): void;
|
|
1644
|
+
/**
|
|
1645
|
+
* Renames a file in the DB.
|
|
1646
|
+
*
|
|
1647
|
+
* @param adapterName adapter name, or null for the current adapter
|
|
1648
|
+
* @param oldName current path to the file
|
|
1649
|
+
* @param newName new path to the file
|
|
1650
|
+
* @param options optional user context
|
|
1651
|
+
* @param callback return result
|
|
1652
|
+
*/
|
|
687
1653
|
rename(adapterName: string | null, oldName: string, newName: string, options: unknown, callback: ioBroker.ErrnoCallback): void;
|
|
1654
|
+
/**
|
|
1655
|
+
* Creates a directory in the DB.
|
|
1656
|
+
*
|
|
1657
|
+
* @param adapterName adapter name, or null for the current adapter
|
|
1658
|
+
* @param path path to the directory
|
|
1659
|
+
* @param callback return result
|
|
1660
|
+
*/
|
|
688
1661
|
mkdir(adapterName: string | null, path: string, callback: ioBroker.ErrnoCallback): void;
|
|
1662
|
+
/**
|
|
1663
|
+
* Creates a directory in the DB.
|
|
1664
|
+
*
|
|
1665
|
+
* @param adapterName adapter name, or null for the current adapter
|
|
1666
|
+
* @param path path to the directory
|
|
1667
|
+
* @param options optional user context
|
|
1668
|
+
* @param callback return result
|
|
1669
|
+
*/
|
|
689
1670
|
mkdir(adapterName: string | null, path: string, options: unknown, callback: ioBroker.ErrnoCallback): void;
|
|
1671
|
+
/**
|
|
1672
|
+
* Read file from DB.
|
|
1673
|
+
*
|
|
1674
|
+
* @param adapterName adapter name, or null for the current adapter
|
|
1675
|
+
* @param path path to file without adapter name
|
|
1676
|
+
* @param callback return result
|
|
1677
|
+
*/
|
|
690
1678
|
readFile(adapterName: string | null, path: string, callback: ioBroker.ReadFileCallback): void;
|
|
1679
|
+
/**
|
|
1680
|
+
* Read file from DB.
|
|
1681
|
+
*
|
|
1682
|
+
* @param adapterName adapter name, or null for the current adapter
|
|
1683
|
+
* @param path path to file without adapter name
|
|
1684
|
+
* @param options optional user context
|
|
1685
|
+
* @param callback return result
|
|
1686
|
+
*/
|
|
691
1687
|
readFile(adapterName: string | null, path: string, options: unknown, callback: ioBroker.ReadFileCallback): void;
|
|
1688
|
+
/**
|
|
1689
|
+
* Write file to DB.
|
|
1690
|
+
*
|
|
1691
|
+
* @param adapterName adapter name, or null for the current adapter
|
|
1692
|
+
* @param path path to the file
|
|
1693
|
+
* @param data data to write
|
|
1694
|
+
* @param callback return result
|
|
1695
|
+
*/
|
|
692
1696
|
writeFile(adapterName: string | null, path: string, data: Buffer | string, callback: ioBroker.ErrnoCallback): void;
|
|
1697
|
+
/**
|
|
1698
|
+
* Write file to DB.
|
|
1699
|
+
*
|
|
1700
|
+
* @param adapterName adapter name, or null for the current adapter
|
|
1701
|
+
* @param path path to the file
|
|
1702
|
+
* @param data data to write
|
|
1703
|
+
* @param options optional user context
|
|
1704
|
+
* @param callback return result
|
|
1705
|
+
*/
|
|
693
1706
|
writeFile(adapterName: string | null, path: string, data: Buffer | string, options: unknown, callback: ioBroker.ErrnoCallback): void;
|
|
1707
|
+
/**
|
|
1708
|
+
* Checks if file exists in DB.
|
|
1709
|
+
*
|
|
1710
|
+
* @param adapterName adapter name
|
|
1711
|
+
* @param path path to file without adapter name
|
|
1712
|
+
*/
|
|
694
1713
|
fileExists(adapterName: string | null, path: string): Promise<boolean>;
|
|
1714
|
+
/**
|
|
1715
|
+
* Checks if file exists in DB.
|
|
1716
|
+
*
|
|
1717
|
+
* @param adapterName adapter name
|
|
1718
|
+
* @param path path to file without adapter name
|
|
1719
|
+
* @param callback cb function if none provided, a promise is returned
|
|
1720
|
+
*/
|
|
695
1721
|
fileExists(adapterName: string | null, path: string, callback?: ioBroker.GenericCallback<boolean>): void;
|
|
1722
|
+
/**
|
|
1723
|
+
* Checks if file exists in DB.
|
|
1724
|
+
*
|
|
1725
|
+
* @param adapterName adapter name
|
|
1726
|
+
* @param path path to file without adapter name
|
|
1727
|
+
* @param options optional user context
|
|
1728
|
+
* @param callback cb function if none provided, a promise is returned
|
|
1729
|
+
*/
|
|
696
1730
|
fileExists(adapterName: string | null, path: string, options: unknown, callback: ioBroker.GenericCallback<boolean>): void;
|
|
1731
|
+
/**
|
|
1732
|
+
* Formats a numeric value using the given format string.
|
|
1733
|
+
*
|
|
1734
|
+
* @param value the value to format
|
|
1735
|
+
* @param format optional format string for the decimal and thousands separator
|
|
1736
|
+
*/
|
|
697
1737
|
formatValue(value: number | string, format?: string): string;
|
|
1738
|
+
/**
|
|
1739
|
+
* Formats a numeric value using the given format string.
|
|
1740
|
+
*
|
|
1741
|
+
* @param value the value to format
|
|
1742
|
+
* @param decimals number of decimals to keep
|
|
1743
|
+
* @param format optional format string for the decimal and thousands separator
|
|
1744
|
+
*/
|
|
698
1745
|
formatValue(value: number | string, decimals: number, format?: string): string;
|
|
1746
|
+
/**
|
|
1747
|
+
* Formats a date according to the given format string.
|
|
1748
|
+
*
|
|
1749
|
+
* @param dateObj the date to format
|
|
1750
|
+
* @param format optional format string
|
|
1751
|
+
*/
|
|
699
1752
|
formatDate(dateObj: string | Date | number, format?: string): string;
|
|
1753
|
+
/**
|
|
1754
|
+
* Formats a date or duration according to the given format string.
|
|
1755
|
+
*
|
|
1756
|
+
* @param dateObj the date to format
|
|
1757
|
+
* @param isDuration whether the value represents a duration
|
|
1758
|
+
* @param format optional format string
|
|
1759
|
+
*/
|
|
700
1760
|
formatDate(dateObj: string | Date | number, isDuration: boolean | string, format?: string): string;
|
|
701
1761
|
private _formatDate;
|
|
1762
|
+
/**
|
|
1763
|
+
* Send a message to a specific instance or all instances of some specific adapter.
|
|
1764
|
+
*
|
|
1765
|
+
* @param instanceName name of the instance to send the message to
|
|
1766
|
+
* @param message message to send
|
|
1767
|
+
* @param callback optional return result
|
|
1768
|
+
*/
|
|
702
1769
|
sendTo(instanceName: string, message: any, callback?: ioBroker.MessageCallback | ioBroker.MessageCallbackInfo): void;
|
|
1770
|
+
/**
|
|
1771
|
+
* Send a message to a specific instance or all instances of some specific adapter.
|
|
1772
|
+
*
|
|
1773
|
+
* @param instanceName name of the instance to send the message to
|
|
1774
|
+
* @param command command name
|
|
1775
|
+
* @param message message to send
|
|
1776
|
+
* @param callback optional return result
|
|
1777
|
+
* @param options optional options to control the send behaviour
|
|
1778
|
+
*/
|
|
703
1779
|
sendTo(instanceName: string, command: string, message: any, callback?: ioBroker.MessageCallback | ioBroker.MessageCallbackInfo, options?: SendToOptions): void;
|
|
704
1780
|
private _sendTo;
|
|
1781
|
+
/**
|
|
1782
|
+
* Send a message to a specific host or all hosts.
|
|
1783
|
+
*
|
|
1784
|
+
* @param hostName name of the host to send the message to, or null for all hosts
|
|
1785
|
+
* @param message message to send
|
|
1786
|
+
* @param callback optional return result
|
|
1787
|
+
*/
|
|
705
1788
|
sendToHost(hostName: string | null, message: any, callback?: ioBroker.MessageCallback | ioBroker.MessageCallbackInfo): void;
|
|
1789
|
+
/**
|
|
1790
|
+
* Send a message to a specific host or all hosts.
|
|
1791
|
+
*
|
|
1792
|
+
* @param hostName name of the host to send the message to, or null for all hosts
|
|
1793
|
+
* @param command command name
|
|
1794
|
+
* @param message message to send
|
|
1795
|
+
* @param callback optional return result
|
|
1796
|
+
*/
|
|
706
1797
|
sendToHost(hostName: string | null, command: string, message: any, callback?: ioBroker.MessageCallback | ioBroker.MessageCallbackInfo): void;
|
|
707
1798
|
private _sendToHost;
|
|
1799
|
+
/**
|
|
1800
|
+
* Send a message to an active UI Client
|
|
1801
|
+
*
|
|
1802
|
+
* @param options clientId and data options
|
|
1803
|
+
*/
|
|
708
1804
|
sendToUI(options: SendToUserInterfaceClientOptions): Promise<void>;
|
|
1805
|
+
/**
|
|
1806
|
+
* Send notification with given scope and category to host of this adapter
|
|
1807
|
+
*
|
|
1808
|
+
* @param scope scope to be addressed
|
|
1809
|
+
* @param category to be addressed, if a null message will be checked by regex of given scope
|
|
1810
|
+
* @param message message to be stored/checked
|
|
1811
|
+
* @param options Additional options for the notification, currently `contextData` is supported
|
|
1812
|
+
*/
|
|
709
1813
|
registerNotification<Scope extends keyof ioBroker.NotificationScopes>(scope: Scope, category: ioBroker.NotificationScopes[Scope] | null, message: string, options?: NotificationOptions): Promise<void>;
|
|
1814
|
+
/**
|
|
1815
|
+
* Writes value into states DB.
|
|
1816
|
+
*
|
|
1817
|
+
* @param id object ID of the state.
|
|
1818
|
+
* @param state simple value or object with attributes.
|
|
1819
|
+
* @param callback return result
|
|
1820
|
+
*/
|
|
710
1821
|
setState<T extends ioBroker.SetStateCallback | undefined>(id: string | ioBroker.IdObject, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, callback?: T): T extends unknown ? ioBroker.SetStatePromise : void;
|
|
1822
|
+
/**
|
|
1823
|
+
* Writes value into states DB.
|
|
1824
|
+
*
|
|
1825
|
+
* @param id object ID of the state.
|
|
1826
|
+
* @param state simple value or object with attributes.
|
|
1827
|
+
* @param ack optional is command(false) or status(true)
|
|
1828
|
+
* @param callback return result
|
|
1829
|
+
*/
|
|
711
1830
|
setState<T extends ioBroker.SetStateCallback | undefined>(id: string | ioBroker.IdObject, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, callback?: T): T extends unknown ? ioBroker.SetStatePromise : void;
|
|
1831
|
+
/**
|
|
1832
|
+
* Writes value into states DB.
|
|
1833
|
+
*
|
|
1834
|
+
* @param id object ID of the state.
|
|
1835
|
+
* @param state simple value or object with attributes.
|
|
1836
|
+
* @param options optional user context
|
|
1837
|
+
* @param callback return result
|
|
1838
|
+
*/
|
|
712
1839
|
setState<T extends ioBroker.SetStateCallback | undefined>(id: string | ioBroker.IdObject, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, options?: Partial<GetUserGroupsOptions> | null, callback?: T): T extends unknown ? ioBroker.SetStatePromise : void;
|
|
1840
|
+
/**
|
|
1841
|
+
* Writes value into states DB.
|
|
1842
|
+
*
|
|
1843
|
+
* @param id object ID of the state.
|
|
1844
|
+
* @param state simple value or object with attributes.
|
|
1845
|
+
* @param ack optional is command(false) or status(true)
|
|
1846
|
+
* @param options optional user context
|
|
1847
|
+
* @param callback return result
|
|
1848
|
+
*/
|
|
713
1849
|
setState<T extends ioBroker.SetStateCallback | undefined>(id: string | ioBroker.IdObject, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, options?: Partial<GetUserGroupsOptions> | null, callback?: T): T extends unknown ? ioBroker.SetStatePromise : void;
|
|
714
1850
|
private _setState;
|
|
715
1851
|
private _getUserGroups;
|
|
@@ -717,40 +1853,220 @@ export declare class AdapterClass extends EventEmitter {
|
|
|
717
1853
|
private _checkStates;
|
|
718
1854
|
private _getGroups;
|
|
719
1855
|
private _setStateChangedHelper;
|
|
1856
|
+
/**
|
|
1857
|
+
* Writes value into states DB only if the value really changed.
|
|
1858
|
+
*
|
|
1859
|
+
* @param id object ID of the state.
|
|
1860
|
+
* @param state simple value or object with attributes.
|
|
1861
|
+
* @param callback return result
|
|
1862
|
+
*/
|
|
720
1863
|
setStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, callback?: ioBroker.SetStateChangedCallback): void;
|
|
1864
|
+
/**
|
|
1865
|
+
* Writes value into states DB only if the value really changed.
|
|
1866
|
+
*
|
|
1867
|
+
* @param id object ID of the state.
|
|
1868
|
+
* @param state simple value or object with attributes.
|
|
1869
|
+
* @param ack optional is command(false) or status(true)
|
|
1870
|
+
* @param callback return result
|
|
1871
|
+
*/
|
|
721
1872
|
setStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, callback?: ioBroker.SetStateChangedCallback): void;
|
|
1873
|
+
/**
|
|
1874
|
+
* Writes value into states DB only if the value really changed.
|
|
1875
|
+
*
|
|
1876
|
+
* @param id object ID of the state.
|
|
1877
|
+
* @param state simple value or object with attributes.
|
|
1878
|
+
* @param options optional user context
|
|
1879
|
+
* @param callback return result
|
|
1880
|
+
*/
|
|
722
1881
|
setStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, options: unknown, callback?: ioBroker.SetStateChangedCallback): void;
|
|
1882
|
+
/**
|
|
1883
|
+
* Writes value into states DB only if the value really changed.
|
|
1884
|
+
*
|
|
1885
|
+
* @param id object ID of the state.
|
|
1886
|
+
* @param state simple value or object with attributes.
|
|
1887
|
+
* @param ack optional is command(false) or status(true)
|
|
1888
|
+
* @param options optional user context
|
|
1889
|
+
* @param callback return result
|
|
1890
|
+
*/
|
|
723
1891
|
setStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, options: unknown, callback?: ioBroker.SetStateChangedCallback): void;
|
|
724
1892
|
private _setStateChanged;
|
|
1893
|
+
/**
|
|
1894
|
+
* Writes value into states DB for any instance.
|
|
1895
|
+
*
|
|
1896
|
+
* @param id object ID of the state.
|
|
1897
|
+
* @param state simple value or object with attributes.
|
|
1898
|
+
* @param callback return result
|
|
1899
|
+
*/
|
|
725
1900
|
setForeignState(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, callback?: ioBroker.SetStateCallback): void;
|
|
1901
|
+
/**
|
|
1902
|
+
* Writes value into states DB for any instance.
|
|
1903
|
+
*
|
|
1904
|
+
* @param id object ID of the state.
|
|
1905
|
+
* @param state simple value or object with attributes.
|
|
1906
|
+
* @param ack optional is command(false) or status(true)
|
|
1907
|
+
* @param callback return result
|
|
1908
|
+
*/
|
|
726
1909
|
setForeignState(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, callback?: ioBroker.SetStateCallback): void;
|
|
1910
|
+
/**
|
|
1911
|
+
* Writes value into states DB for any instance.
|
|
1912
|
+
*
|
|
1913
|
+
* @param id object ID of the state.
|
|
1914
|
+
* @param state simple value or object with attributes.
|
|
1915
|
+
* @param options optional user context
|
|
1916
|
+
* @param callback return result
|
|
1917
|
+
*/
|
|
727
1918
|
setForeignState(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, options: unknown, callback?: ioBroker.SetStateCallback): void;
|
|
1919
|
+
/**
|
|
1920
|
+
* Writes value into states DB for any instance.
|
|
1921
|
+
*
|
|
1922
|
+
* @param id object ID of the state.
|
|
1923
|
+
* @param state simple value or object with attributes.
|
|
1924
|
+
* @param ack optional is command(false) or status(true)
|
|
1925
|
+
* @param options optional user context
|
|
1926
|
+
* @param callback return result
|
|
1927
|
+
*/
|
|
728
1928
|
setForeignState(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, options: unknown, callback?: ioBroker.SetStateCallback): void;
|
|
1929
|
+
/**
|
|
1930
|
+
* Writes value into states DB for any instance only if the value really changed.
|
|
1931
|
+
*
|
|
1932
|
+
* @param id object ID of the state.
|
|
1933
|
+
* @param state simple value or object with attributes.
|
|
1934
|
+
* @param callback return result
|
|
1935
|
+
*/
|
|
729
1936
|
setForeignStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, callback?: ioBroker.SetStateChangedCallback): void;
|
|
1937
|
+
/**
|
|
1938
|
+
* Writes value into states DB for any instance only if the value really changed.
|
|
1939
|
+
*
|
|
1940
|
+
* @param id object ID of the state.
|
|
1941
|
+
* @param state simple value or object with attributes.
|
|
1942
|
+
* @param ack optional is command(false) or status(true)
|
|
1943
|
+
* @param callback return result
|
|
1944
|
+
*/
|
|
730
1945
|
setForeignStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, callback?: ioBroker.SetStateChangedCallback): void;
|
|
1946
|
+
/**
|
|
1947
|
+
* Writes value into states DB for any instance only if the value really changed.
|
|
1948
|
+
*
|
|
1949
|
+
* @param id object ID of the state.
|
|
1950
|
+
* @param state simple value or object with attributes.
|
|
1951
|
+
* @param options optional user context
|
|
1952
|
+
* @param callback return result
|
|
1953
|
+
*/
|
|
731
1954
|
setForeignStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, options: unknown, callback?: ioBroker.SetStateChangedCallback): void;
|
|
1955
|
+
/**
|
|
1956
|
+
* Writes value into states DB for any instance only if the value really changed.
|
|
1957
|
+
*
|
|
1958
|
+
* @param id object ID of the state.
|
|
1959
|
+
* @param state simple value or object with attributes.
|
|
1960
|
+
* @param ack optional is command(false) or status(true)
|
|
1961
|
+
* @param options optional user context
|
|
1962
|
+
* @param callback return result
|
|
1963
|
+
*/
|
|
732
1964
|
setForeignStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, options: unknown, callback?: ioBroker.SetStateChangedCallback): void;
|
|
1965
|
+
/**
|
|
1966
|
+
* Read value from states DB.
|
|
1967
|
+
*
|
|
1968
|
+
* @param id object ID of the state.
|
|
1969
|
+
* @param callback return result
|
|
1970
|
+
*/
|
|
733
1971
|
getState(id: string, callback: ioBroker.GetStateCallback): void;
|
|
1972
|
+
/**
|
|
1973
|
+
* Read value from states DB.
|
|
1974
|
+
*
|
|
1975
|
+
* @param id object ID of the state.
|
|
1976
|
+
* @param options optional user context
|
|
1977
|
+
* @param callback return result
|
|
1978
|
+
*/
|
|
734
1979
|
getState(id: string, options: unknown, callback: ioBroker.GetStateCallback): void;
|
|
1980
|
+
/**
|
|
1981
|
+
* Read value from states DB for any instance and system state.
|
|
1982
|
+
*
|
|
1983
|
+
* @param id object ID of the state.
|
|
1984
|
+
* @param callback return result
|
|
1985
|
+
*/
|
|
735
1986
|
getForeignState(id: string, callback: ioBroker.GetStateCallback): ioBroker.GetStatePromise;
|
|
1987
|
+
/**
|
|
1988
|
+
* Read value from states DB for any instance and system state.
|
|
1989
|
+
*
|
|
1990
|
+
* @param id object ID of the state.
|
|
1991
|
+
* @param options optional user context
|
|
1992
|
+
* @param callback return result
|
|
1993
|
+
*/
|
|
736
1994
|
getForeignState(id: string, options: unknown, callback: ioBroker.GetStateCallback): ioBroker.GetStatePromise;
|
|
737
1995
|
private _getForeignState;
|
|
738
1996
|
private _getDefaultHistory;
|
|
1997
|
+
/**
|
|
1998
|
+
* Read historian data for states of any instance or system state.
|
|
1999
|
+
*
|
|
2000
|
+
* @param id object ID of the state.
|
|
2001
|
+
* @param options the query options for the history
|
|
2002
|
+
* @param callback return result
|
|
2003
|
+
*/
|
|
739
2004
|
getHistory(id: string, options: ioBroker.GetHistoryOptions, callback: ioBroker.GetHistoryCallback): void;
|
|
2005
|
+
/**
|
|
2006
|
+
* Read historian data for states of any instance or system state.
|
|
2007
|
+
*
|
|
2008
|
+
* @param id object ID of the state.
|
|
2009
|
+
* @param callback return result
|
|
2010
|
+
*/
|
|
740
2011
|
getHistory(id: string, callback: ioBroker.GetHistoryCallback): void;
|
|
741
2012
|
private _getHistory;
|
|
2013
|
+
/**
|
|
2014
|
+
* Convert ID into object with device's, channel's and state's name.
|
|
2015
|
+
*
|
|
2016
|
+
* @param id short or long string of ID like "stateID" or "adapterName.0.stateID".
|
|
2017
|
+
* @returns parsed ID as an object
|
|
2018
|
+
*/
|
|
742
2019
|
idToDCS(id: string): {
|
|
743
2020
|
device: string;
|
|
744
2021
|
channel: string;
|
|
745
2022
|
state: string;
|
|
746
2023
|
} | null;
|
|
2024
|
+
/**
|
|
2025
|
+
* Deletes a state of this instance. The object is NOT deleted.
|
|
2026
|
+
*
|
|
2027
|
+
* @param id exactly object ID (without namespace)
|
|
2028
|
+
* @param callback return result
|
|
2029
|
+
*/
|
|
747
2030
|
delState(id: string, callback?: ioBroker.ErrorCallback): void;
|
|
2031
|
+
/**
|
|
2032
|
+
* Deletes a state of this instance. The object is NOT deleted.
|
|
2033
|
+
*
|
|
2034
|
+
* @param id exactly object ID (without namespace)
|
|
2035
|
+
* @param options optional user context
|
|
2036
|
+
* @param callback return result
|
|
2037
|
+
*/
|
|
748
2038
|
delState(id: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
|
|
749
2039
|
private _delState;
|
|
2040
|
+
/**
|
|
2041
|
+
* Deletes a state of any adapter. The object is NOT deleted.
|
|
2042
|
+
*
|
|
2043
|
+
* @param id long string for ID like "adapterName.0.stateID".
|
|
2044
|
+
* @param callback return result
|
|
2045
|
+
*/
|
|
750
2046
|
delForeignState(id: string, callback?: ioBroker.ErrorCallback): void;
|
|
2047
|
+
/**
|
|
2048
|
+
* Deletes a state of any adapter. The object is NOT deleted.
|
|
2049
|
+
*
|
|
2050
|
+
* @param id long string for ID like "adapterName.0.stateID".
|
|
2051
|
+
* @param options optional argument to describe the user context
|
|
2052
|
+
* @param callback return result
|
|
2053
|
+
*/
|
|
751
2054
|
delForeignState(id: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
|
|
752
2055
|
private _delForeignState;
|
|
2056
|
+
/**
|
|
2057
|
+
* Read all states of this adapter, that pass the pattern
|
|
2058
|
+
*
|
|
2059
|
+
* @param pattern string in form 'adapter.0.*' or like this. It can be an array of IDs too.
|
|
2060
|
+
* @param callback return result
|
|
2061
|
+
*/
|
|
753
2062
|
getStates(pattern: Pattern, callback: ioBroker.GetStatesCallback): void;
|
|
2063
|
+
/**
|
|
2064
|
+
* Read all states of this adapter, that pass the pattern
|
|
2065
|
+
*
|
|
2066
|
+
* @param pattern string in form 'adapter.0.*' or like this. It can be an array of IDs too.
|
|
2067
|
+
* @param options optional argument to describe the user context
|
|
2068
|
+
* @param callback return result
|
|
2069
|
+
*/
|
|
754
2070
|
getStates(pattern: Pattern, options: unknown, callback: ioBroker.GetStatesCallback): void;
|
|
755
2071
|
private _processStatesSecondary;
|
|
756
2072
|
/**
|
|
@@ -761,7 +2077,20 @@ export declare class AdapterClass extends EventEmitter {
|
|
|
761
2077
|
* @param targetObjs the target objects (e.g. alias objects or the actual objects)
|
|
762
2078
|
*/
|
|
763
2079
|
private _processStates;
|
|
2080
|
+
/**
|
|
2081
|
+
* Read all states of all adapters (and system states), that pass the pattern
|
|
2082
|
+
*
|
|
2083
|
+
* @param pattern string in form 'adapter.0.*' or like this. It can be an array of IDs too.
|
|
2084
|
+
* @param callback return result
|
|
2085
|
+
*/
|
|
764
2086
|
getForeignStates(pattern: Pattern, callback: ioBroker.GetStatesCallback): void;
|
|
2087
|
+
/**
|
|
2088
|
+
* Read all states of all adapters (and system states), that pass the pattern
|
|
2089
|
+
*
|
|
2090
|
+
* @param pattern string in form 'adapter.0.*' or like this. It can be an array of IDs too.
|
|
2091
|
+
* @param options optional user context
|
|
2092
|
+
* @param callback return result
|
|
2093
|
+
*/
|
|
765
2094
|
getForeignStates(pattern: Pattern, options: unknown, callback: ioBroker.GetStatesCallback): void;
|
|
766
2095
|
private _getForeignStates;
|
|
767
2096
|
/**
|
|
@@ -778,19 +2107,90 @@ export declare class AdapterClass extends EventEmitter {
|
|
|
778
2107
|
* @param aliasObjOrIdx the alias target or the index of the targets array
|
|
779
2108
|
*/
|
|
780
2109
|
private _removeAliasSubscribe;
|
|
2110
|
+
/**
|
|
2111
|
+
* Subscribe for changes on all states of all adapters (and system states), that pass the pattern
|
|
2112
|
+
*
|
|
2113
|
+
* @param pattern string in form 'adapter.0.*' or like this. It can be an array of IDs too.
|
|
2114
|
+
* @param callback optional callback
|
|
2115
|
+
*/
|
|
781
2116
|
subscribeForeignStates(pattern: Pattern, callback?: ioBroker.ErrorCallback): void;
|
|
2117
|
+
/**
|
|
2118
|
+
* Subscribe for changes on all states of all adapters (and system states), that pass the pattern
|
|
2119
|
+
*
|
|
2120
|
+
* @param pattern string in form 'adapter.0.*' or like this. It can be an array of IDs too.
|
|
2121
|
+
* @param options optional argument to describe the user context
|
|
2122
|
+
* @param callback optional callback
|
|
2123
|
+
*/
|
|
782
2124
|
subscribeForeignStates(pattern: Pattern, options: unknown, callback?: ioBroker.ErrorCallback): void;
|
|
783
2125
|
private _subscribeForeignStates;
|
|
2126
|
+
/**
|
|
2127
|
+
* Unsubscribe for changes for given pattern
|
|
2128
|
+
*
|
|
2129
|
+
* @param pattern string in form 'adapter.0.*'. Must be the same as subscribe.
|
|
2130
|
+
* @param callback optional callback
|
|
2131
|
+
*/
|
|
784
2132
|
unsubscribeForeignStates(pattern: string | string[], callback?: ioBroker.ErrorCallback): void;
|
|
2133
|
+
/**
|
|
2134
|
+
* Unsubscribe for changes for given pattern
|
|
2135
|
+
*
|
|
2136
|
+
* @param pattern string in form 'adapter.0.*'. Must be the same as subscribe.
|
|
2137
|
+
* @param options optional argument to describe the user context
|
|
2138
|
+
* @param callback optional callback
|
|
2139
|
+
*/
|
|
785
2140
|
unsubscribeForeignStates(pattern: string | string[], options: unknown, callback?: ioBroker.ErrorCallback): void;
|
|
786
2141
|
private _unsubscribeForeignStates;
|
|
2142
|
+
/**
|
|
2143
|
+
* Subscribe for changes on all states of this instance, that pass the pattern
|
|
2144
|
+
*
|
|
2145
|
+
* @param pattern string in form 'adapter.0.*' or like this. Only string allowed
|
|
2146
|
+
* @param callback optional callback
|
|
2147
|
+
*/
|
|
787
2148
|
subscribeStates(pattern: Pattern, callback?: ioBroker.ErrorCallback): void;
|
|
2149
|
+
/**
|
|
2150
|
+
* Subscribe for changes on all states of this instance, that pass the pattern
|
|
2151
|
+
*
|
|
2152
|
+
* @param pattern string in form 'adapter.0.*' or like this. Only string allowed
|
|
2153
|
+
* @param options optional argument to describe the user context
|
|
2154
|
+
* @param callback optional callback
|
|
2155
|
+
*/
|
|
788
2156
|
subscribeStates(pattern: Pattern, options: unknown, callback?: ioBroker.ErrorCallback): void;
|
|
2157
|
+
/**
|
|
2158
|
+
* Unsubscribe for changes for given pattern for own states.
|
|
2159
|
+
*
|
|
2160
|
+
* @param pattern string in form 'adapter.0.*'. Must be the same as subscribe.
|
|
2161
|
+
* @param callback optional callback
|
|
2162
|
+
*/
|
|
789
2163
|
unsubscribeStates(pattern: Pattern, callback?: ioBroker.ErrorCallback): void;
|
|
2164
|
+
/**
|
|
2165
|
+
* Unsubscribe for changes for given pattern for own states.
|
|
2166
|
+
*
|
|
2167
|
+
* @param pattern string in form 'adapter.0.*'. Must be the same as subscribe.
|
|
2168
|
+
* @param options optional argument to describe the user context
|
|
2169
|
+
* @param callback optional callback
|
|
2170
|
+
*/
|
|
790
2171
|
unsubscribeStates(pattern: Pattern, options: unknown, callback?: ioBroker.ErrorCallback): void;
|
|
2172
|
+
/**
|
|
2173
|
+
* Return plugin instance
|
|
2174
|
+
*
|
|
2175
|
+
* @param name name of the plugin to return
|
|
2176
|
+
* @returns plugin instance or null if not existent or not isActive
|
|
2177
|
+
*/
|
|
791
2178
|
getPluginInstance(name: string): ioBroker.Plugin | null;
|
|
2179
|
+
/**
|
|
2180
|
+
* Return plugin configuration
|
|
2181
|
+
*
|
|
2182
|
+
* @param name name of the plugin to return
|
|
2183
|
+
* @returns plugin configuration or null if not existent or not isActive
|
|
2184
|
+
*/
|
|
792
2185
|
getPluginConfig(name: string): Record<string, any> | null;
|
|
793
2186
|
private _autoSubscribeOn;
|
|
2187
|
+
/**
|
|
2188
|
+
* This method returns the list of license that can be used by this adapter
|
|
2189
|
+
*
|
|
2190
|
+
* @param all if return the licenses, that used by other instances (true) or only for this instance (false)
|
|
2191
|
+
* @param adapterName Return licenses for specific adapter
|
|
2192
|
+
* @returns list of suitable licenses
|
|
2193
|
+
*/
|
|
794
2194
|
getSuitableLicenses(all?: boolean, adapterName?: string): Promise<any[]>;
|
|
795
2195
|
/**
|
|
796
2196
|
* Add given id to log redirect list
|
|
@@ -847,8 +2247,11 @@ export declare class AdapterClass extends EventEmitter {
|
|
|
847
2247
|
private _init;
|
|
848
2248
|
}
|
|
849
2249
|
|
|
2250
|
+
/** Options passed to the adapter constructor */
|
|
850
2251
|
export declare interface AdapterOptions {
|
|
2252
|
+
/** Called with the current subscriptions whenever they change */
|
|
851
2253
|
subscribesChange?: (subs: Record<string, {
|
|
2254
|
+
/** Compiled regular expression of the subscription pattern */
|
|
852
2255
|
regex: RegExp;
|
|
853
2256
|
}>) => void;
|
|
854
2257
|
/** If the adapter collects logs from all adapters (experts only). Default: false */
|
|
@@ -901,31 +2304,50 @@ export declare interface AdapterOptions {
|
|
|
901
2304
|
error?: ioBroker.ErrorHandler;
|
|
902
2305
|
}
|
|
903
2306
|
|
|
2307
|
+
/** Subset of the adapter config relevant for the connection to the controller */
|
|
904
2308
|
export declare interface AdapterOptionsConfig {
|
|
2309
|
+
/** Logging configuration */
|
|
905
2310
|
log: {
|
|
2311
|
+
/** The log level to use */
|
|
906
2312
|
level: ioBroker.LogLevel;
|
|
907
2313
|
};
|
|
908
2314
|
}
|
|
909
2315
|
|
|
2316
|
+
/** Details about an alias and its targets */
|
|
910
2317
|
export declare interface AliasDetails {
|
|
2318
|
+
/** Source definition of the alias */
|
|
911
2319
|
source?: AliasDetailsSource;
|
|
2320
|
+
/** Target states the alias points to */
|
|
912
2321
|
targets: AliasTargetEntry[];
|
|
913
2322
|
}
|
|
914
2323
|
|
|
2324
|
+
/** Source definition of an alias */
|
|
915
2325
|
export declare interface AliasDetailsSource {
|
|
2326
|
+
/** Minimum value of the source */
|
|
916
2327
|
min?: number;
|
|
2328
|
+
/** Maximum value of the source */
|
|
917
2329
|
max?: number;
|
|
2330
|
+
/** Common type of the source */
|
|
918
2331
|
type?: ioBroker.CommonType;
|
|
2332
|
+
/** Unit of the source value */
|
|
919
2333
|
unit?: string;
|
|
920
2334
|
}
|
|
921
2335
|
|
|
2336
|
+
/** A single target of an alias */
|
|
922
2337
|
export declare interface AliasTargetEntry {
|
|
2338
|
+
/** Alias definition of the target's common section */
|
|
923
2339
|
alias: ioBroker.StateCommon['alias'];
|
|
2340
|
+
/** The id of the target state */
|
|
924
2341
|
id: string;
|
|
2342
|
+
/** The subscription pattern of the target */
|
|
925
2343
|
pattern: string;
|
|
2344
|
+
/** Common type of the target */
|
|
926
2345
|
type?: ioBroker.CommonType;
|
|
2346
|
+
/** Maximum value of the target */
|
|
927
2347
|
max?: number;
|
|
2348
|
+
/** Minimum value of the target */
|
|
928
2349
|
min?: number;
|
|
2350
|
+
/** Unit of the target value */
|
|
929
2351
|
unit?: string;
|
|
930
2352
|
}
|
|
931
2353
|
|
|
@@ -943,8 +2365,11 @@ export declare type CheckPasswordCallback = (success: boolean, user: string) =>
|
|
|
943
2365
|
|
|
944
2366
|
export declare type CheckStateCommand = 'getState' | 'setState' | 'delState';
|
|
945
2367
|
|
|
2368
|
+
/** Result of checking a set of states */
|
|
946
2369
|
export declare interface CheckStatesResult {
|
|
2370
|
+
/** The matching state objects */
|
|
947
2371
|
objs: ioBroker.StateObject[];
|
|
2372
|
+
/** The matching state ids */
|
|
948
2373
|
ids: string[];
|
|
949
2374
|
}
|
|
950
2375
|
|
|
@@ -965,8 +2390,11 @@ declare interface CommandResult {
|
|
|
965
2390
|
|
|
966
2391
|
export declare type CommandsPermissions = CommandsPermissionsObject | CommandsPermissionsEntry[];
|
|
967
2392
|
|
|
2393
|
+
/** A single command permission requirement */
|
|
968
2394
|
export declare type CommandsPermissionsEntry = {
|
|
2395
|
+
/** The object category the permission applies to */
|
|
969
2396
|
type: 'object' | 'state' | '' | 'other' | 'file';
|
|
2397
|
+
/** The operation requiring the permission */
|
|
970
2398
|
operation: string;
|
|
971
2399
|
};
|
|
972
2400
|
|
|
@@ -980,11 +2408,15 @@ export declare type GetCertificatesPromiseReturnType = [cert: ioBroker.Certifica
|
|
|
980
2408
|
|
|
981
2409
|
export declare type GetEncryptedConfigCallback = (error: Error | null | undefined, result?: string | string[]) => void;
|
|
982
2410
|
|
|
2411
|
+
/** Options for resolving the groups of a user */
|
|
983
2412
|
export declare interface GetUserGroupsOptions {
|
|
2413
|
+
/** The user whose groups should be resolved */
|
|
984
2414
|
user: `system.user.${string}`;
|
|
2415
|
+
/** Additional request options */
|
|
985
2416
|
[other: string]: any;
|
|
986
2417
|
}
|
|
987
2418
|
|
|
2419
|
+
/** Options for installing a node module */
|
|
988
2420
|
export declare interface InstallNodeModuleOptions {
|
|
989
2421
|
/** Version of node module */
|
|
990
2422
|
version: string;
|
|
@@ -1010,229 +2442,383 @@ declare interface InternalAdapterJsonConfig extends ioBroker.IoBrokerJson {
|
|
|
1010
2442
|
instance?: number;
|
|
1011
2443
|
}
|
|
1012
2444
|
|
|
2445
|
+
/** Options for adding a channel to an enum */
|
|
1013
2446
|
export declare interface InternalAddChannelToEnumOptions {
|
|
2447
|
+
/** The category of the enum (e.g. rooms, functions) */
|
|
1014
2448
|
enumName: string;
|
|
2449
|
+
/** The enum id to add the channel to */
|
|
1015
2450
|
addTo: string;
|
|
2451
|
+
/** The parent device name */
|
|
1016
2452
|
parentDevice: string;
|
|
2453
|
+
/** The name of the channel */
|
|
1017
2454
|
channelName: string;
|
|
2455
|
+
/** Optional settings including the user context */
|
|
1018
2456
|
options?: Record<string, any> | null;
|
|
2457
|
+
/** Called once the channel has been added */
|
|
1019
2458
|
callback?: ioBroker.ErrorCallback;
|
|
1020
2459
|
}
|
|
1021
2460
|
|
|
2461
|
+
/** Options for adding a state to an enum */
|
|
1022
2462
|
export declare interface InternalAddStateToEnumOptions {
|
|
2463
|
+
/** The category of the enum (e.g. rooms, functions) */
|
|
1023
2464
|
enumName: string;
|
|
2465
|
+
/** The enum id to add the state to */
|
|
1024
2466
|
addTo: string;
|
|
2467
|
+
/** The parent device name */
|
|
1025
2468
|
parentDevice: string;
|
|
2469
|
+
/** The parent channel name */
|
|
1026
2470
|
parentChannel: string;
|
|
2471
|
+
/** The name of the state */
|
|
1027
2472
|
stateName: string;
|
|
2473
|
+
/** Optional settings including the user context */
|
|
1028
2474
|
options?: Record<string, any> | null;
|
|
2475
|
+
/** Called once the state has been added */
|
|
1029
2476
|
callback?: ioBroker.ErrorCallback;
|
|
1030
2477
|
}
|
|
1031
2478
|
|
|
2479
|
+
/** Options for calculating the permissions of a user */
|
|
1032
2480
|
export declare interface InternalCalculatePermissionsOptions {
|
|
2481
|
+
/** The user to calculate the permissions for */
|
|
1033
2482
|
user: string;
|
|
2483
|
+
/** The permission requirements of the commands */
|
|
1034
2484
|
commandsPermissions: CommandsPermissions;
|
|
2485
|
+
/** Optional settings including the user context */
|
|
1035
2486
|
options?: Record<string, any> | null;
|
|
2487
|
+
/** Called with the calculated permission set */
|
|
1036
2488
|
callback?: CalculatePermissionsCallback;
|
|
1037
2489
|
}
|
|
1038
2490
|
|
|
2491
|
+
/** Options for checking whether a user belongs to a group */
|
|
1039
2492
|
export declare interface InternalCheckGroupOptions {
|
|
2493
|
+
/** The user to check */
|
|
1040
2494
|
user: string;
|
|
2495
|
+
/** The group to check membership of */
|
|
1041
2496
|
group: string;
|
|
2497
|
+
/** Optional settings including the user context */
|
|
1042
2498
|
options?: Record<string, any> | null;
|
|
2499
|
+
/** Called with the result of the check */
|
|
1043
2500
|
callback?: CheckGroupCallback;
|
|
1044
2501
|
}
|
|
1045
2502
|
|
|
2503
|
+
/** Options for checking a user's password */
|
|
1046
2504
|
export declare interface InternalCheckPasswordOptions {
|
|
2505
|
+
/** The user to check */
|
|
1047
2506
|
user: string;
|
|
2507
|
+
/** The password to verify */
|
|
1048
2508
|
pw: string;
|
|
2509
|
+
/** Optional settings including the user context */
|
|
1049
2510
|
options?: Record<string, any> | null;
|
|
2511
|
+
/** Called with the result of the check */
|
|
1050
2512
|
callback: CheckPasswordCallback;
|
|
1051
2513
|
}
|
|
1052
2514
|
|
|
2515
|
+
/** Options for creating a device */
|
|
1053
2516
|
export declare interface InternalCreateDeviceOptions {
|
|
2517
|
+
/** The name of the device */
|
|
1054
2518
|
deviceName: string;
|
|
2519
|
+
/** The common section of the device object */
|
|
1055
2520
|
common?: Partial<ioBroker.DeviceCommon>;
|
|
2521
|
+
/** The native section of the device object */
|
|
1056
2522
|
_native?: Record<string, any> | null;
|
|
2523
|
+
/** Optional settings including the user context */
|
|
1057
2524
|
options: unknown;
|
|
2525
|
+
/** Called once the device has been created */
|
|
1058
2526
|
callback?: ioBroker.SetObjectCallback;
|
|
1059
2527
|
}
|
|
1060
2528
|
|
|
2529
|
+
/** Options for creating a state */
|
|
1061
2530
|
export declare interface InternalCreateStateOptions {
|
|
2531
|
+
/** The parent device name */
|
|
1062
2532
|
parentDevice: string;
|
|
2533
|
+
/** The parent channel name */
|
|
1063
2534
|
parentChannel: string;
|
|
2535
|
+
/** The name of the state */
|
|
1064
2536
|
stateName: string;
|
|
2537
|
+
/** The common section of the state object */
|
|
1065
2538
|
common: Partial<ioBroker.StateCommon>;
|
|
2539
|
+
/** The native section of the state object */
|
|
1066
2540
|
_native: Record<string, any>;
|
|
2541
|
+
/** Optional settings including the user context */
|
|
1067
2542
|
options?: Record<string, any> | null;
|
|
2543
|
+
/** Called once the state has been created */
|
|
1068
2544
|
callback?: ioBroker.SetObjectCallback;
|
|
1069
2545
|
}
|
|
1070
2546
|
|
|
2547
|
+
/** Options for removing a channel from an enum */
|
|
1071
2548
|
export declare interface InternalDeleteChannelFromEnumOptions {
|
|
2549
|
+
/** The category of the enum (e.g. rooms, functions) */
|
|
1072
2550
|
enumName: string;
|
|
2551
|
+
/** The parent device name */
|
|
1073
2552
|
parentDevice: string;
|
|
2553
|
+
/** The name of the channel */
|
|
1074
2554
|
channelName: string;
|
|
2555
|
+
/** Optional settings including the user context */
|
|
1075
2556
|
options?: Record<string, any> | null;
|
|
2557
|
+
/** Called once the channel has been removed */
|
|
1076
2558
|
callback?: ioBroker.ErrorCallback;
|
|
1077
2559
|
}
|
|
1078
2560
|
|
|
2561
|
+
/** Options for deleting a channel */
|
|
1079
2562
|
export declare interface InternalDeleteChannelOptions {
|
|
2563
|
+
/** The parent device name */
|
|
1080
2564
|
parentDevice: string;
|
|
2565
|
+
/** The name of the channel */
|
|
1081
2566
|
channelName: string;
|
|
2567
|
+
/** Called once the channel has been deleted */
|
|
1082
2568
|
callback?: ioBroker.ErrorCallback;
|
|
1083
2569
|
}
|
|
1084
2570
|
|
|
2571
|
+
/** Options for deleting a device */
|
|
1085
2572
|
export declare interface InternalDeleteDeviceOptions {
|
|
2573
|
+
/** The name of the device */
|
|
1086
2574
|
deviceName: string;
|
|
2575
|
+
/** Called once the device has been deleted */
|
|
1087
2576
|
callback?: ioBroker.ErrorCallback;
|
|
1088
2577
|
}
|
|
1089
2578
|
|
|
2579
|
+
/** Options for removing a state from an enum */
|
|
1090
2580
|
export declare interface InternalDeleteStateFromEnumOptions {
|
|
2581
|
+
/** The category of the enum (e.g. rooms, functions) */
|
|
1091
2582
|
enumName: string;
|
|
2583
|
+
/** The parent device name */
|
|
1092
2584
|
parentDevice: string;
|
|
2585
|
+
/** The parent channel name */
|
|
1093
2586
|
parentChannel: string;
|
|
2587
|
+
/** The name of the state */
|
|
1094
2588
|
stateName: string;
|
|
2589
|
+
/** Optional settings including the user context */
|
|
1095
2590
|
options?: Record<string, any> | null;
|
|
2591
|
+
/** Called once the state has been removed */
|
|
1096
2592
|
callback?: ioBroker.ErrorCallback;
|
|
1097
2593
|
}
|
|
1098
2594
|
|
|
2595
|
+
/** Options for deleting a state by device/channel/name */
|
|
1099
2596
|
export declare interface InternalDeleteStateOptions {
|
|
2597
|
+
/** The parent device name */
|
|
1100
2598
|
parentDevice: string;
|
|
2599
|
+
/** The parent channel name */
|
|
1101
2600
|
parentChannel: string;
|
|
2601
|
+
/** The name of the state */
|
|
1102
2602
|
stateName: string;
|
|
2603
|
+
/** Optional settings including the user context */
|
|
1103
2604
|
options?: Record<string, any> | null;
|
|
2605
|
+
/** Called once the state has been deleted */
|
|
1104
2606
|
callback?: ioBroker.ErrorCallback;
|
|
1105
2607
|
}
|
|
1106
2608
|
|
|
2609
|
+
/** Options for deleting an object */
|
|
1107
2610
|
export declare interface InternalDelObjectOptions {
|
|
2611
|
+
/** The id of the object */
|
|
1108
2612
|
id: string;
|
|
2613
|
+
/** Options controlling the deletion */
|
|
1109
2614
|
options?: ioBroker.DelObjectOptions | null;
|
|
2615
|
+
/** Called once the object has been deleted */
|
|
1110
2616
|
callback?: ioBroker.ErrorCallback;
|
|
1111
2617
|
}
|
|
1112
2618
|
|
|
2619
|
+
/** Options for deleting a state */
|
|
1113
2620
|
export declare interface InternalDelStateOptions {
|
|
2621
|
+
/** The id of the state */
|
|
1114
2622
|
id: string;
|
|
2623
|
+
/** Optional settings including the user context */
|
|
1115
2624
|
options?: Record<string, any> | null;
|
|
2625
|
+
/** Called once the state has been deleted */
|
|
1116
2626
|
callback?: ioBroker.ErrorCallback;
|
|
1117
2627
|
}
|
|
1118
2628
|
|
|
2629
|
+
/** Options for destroying a session */
|
|
1119
2630
|
export declare interface InternalDestroySessionOptions {
|
|
2631
|
+
/** The session id */
|
|
1120
2632
|
id: string;
|
|
2633
|
+
/** Called once the session has been destroyed */
|
|
1121
2634
|
callback?: ioBroker.ErrorCallback;
|
|
1122
2635
|
}
|
|
1123
2636
|
|
|
2637
|
+
/** Internal options for formatting a date */
|
|
1124
2638
|
export declare interface InternalFormatDateOptions {
|
|
2639
|
+
/** The date to format, as Date, timestamp or string */
|
|
1125
2640
|
dateObj: string | Date | number;
|
|
2641
|
+
/** Whether the value represents a duration instead of a point in time */
|
|
1126
2642
|
isDuration: boolean;
|
|
2643
|
+
/** Optional explicit format string */
|
|
1127
2644
|
_format?: string;
|
|
1128
2645
|
}
|
|
1129
2646
|
|
|
2647
|
+
/** Options for reading all objects of the adapter */
|
|
1130
2648
|
export declare interface InternalGetAdapterObjectsOptions {
|
|
2649
|
+
/** Called with the adapter's objects */
|
|
1131
2650
|
callback?: (objects: Record<string, ioBroker.AdapterScopedObject>) => void;
|
|
1132
2651
|
}
|
|
1133
2652
|
|
|
2653
|
+
/** Options for reading the SSL certificates */
|
|
1134
2654
|
export declare interface InternalGetCertificatesOptions {
|
|
2655
|
+
/** Name of the public certificate */
|
|
1135
2656
|
publicName?: string;
|
|
2657
|
+
/** Name of the private key */
|
|
1136
2658
|
privateName?: string;
|
|
2659
|
+
/** Name of the chained certificate */
|
|
1137
2660
|
chainedName?: string;
|
|
2661
|
+
/** Called with the certificates */
|
|
1138
2662
|
callback?: GetCertificatesCallback;
|
|
1139
2663
|
}
|
|
1140
2664
|
|
|
2665
|
+
/** Options for reading the channels of a device */
|
|
1141
2666
|
export declare interface InternalGetChannelsOfOptions {
|
|
2667
|
+
/** The parent device to read the channels of */
|
|
1142
2668
|
parentDevice?: string;
|
|
2669
|
+
/** Called with the channels */
|
|
1143
2670
|
callback?: ioBroker.GetObjectsCallback3<ioBroker.ChannelObject>;
|
|
2671
|
+
/** Optional settings including the user context */
|
|
1144
2672
|
options?: Record<string, any> | null;
|
|
1145
2673
|
}
|
|
1146
2674
|
|
|
2675
|
+
/** Options for reading all devices */
|
|
1147
2676
|
export declare interface InternalGetDevicesOptions {
|
|
2677
|
+
/** Optional settings including the user context */
|
|
1148
2678
|
options?: Record<string, any> | null;
|
|
2679
|
+
/** Called with the devices */
|
|
1149
2680
|
callback: ioBroker.GetObjectsCallback3<ioBroker.DeviceObject>;
|
|
1150
2681
|
}
|
|
1151
2682
|
|
|
2683
|
+
/** Options for reading an encrypted config value */
|
|
1152
2684
|
export declare interface InternalGetEncryptedConfigOptions {
|
|
2685
|
+
/** The config attribute to decrypt */
|
|
1153
2686
|
attribute: string;
|
|
2687
|
+
/** Called with the decrypted value */
|
|
1154
2688
|
callback?: GetEncryptedConfigCallback;
|
|
1155
2689
|
}
|
|
1156
2690
|
|
|
2691
|
+
/** Options for reading a single enum */
|
|
1157
2692
|
export declare interface InternalGetEnumOptions {
|
|
2693
|
+
/** The name of the enum to read */
|
|
1158
2694
|
_enum: string;
|
|
2695
|
+
/** Optional settings including the user context */
|
|
1159
2696
|
options?: Record<string, any> | null;
|
|
2697
|
+
/** Called with the enum */
|
|
1160
2698
|
callback?: ioBroker.GetEnumCallback;
|
|
1161
2699
|
}
|
|
1162
2700
|
|
|
2701
|
+
/** Options for reading multiple enums */
|
|
1163
2702
|
export declare interface InternalGetEnumsOptions {
|
|
2703
|
+
/** The list of enums to read */
|
|
1164
2704
|
_enumList?: ioBroker.EnumList;
|
|
2705
|
+
/** Optional settings including the user context */
|
|
1165
2706
|
options?: Record<string, any> | null;
|
|
2707
|
+
/** Called with the enums */
|
|
1166
2708
|
callback?: ioBroker.GetEnumsCallback;
|
|
1167
2709
|
}
|
|
1168
2710
|
|
|
2711
|
+
/** Options for reading the history of a state */
|
|
1169
2712
|
export declare interface InternalGetHistoryOptions {
|
|
2713
|
+
/** The id of the state */
|
|
1170
2714
|
id: string;
|
|
2715
|
+
/** Options controlling the history query */
|
|
1171
2716
|
options?: ioBroker.GetHistoryOptions | null;
|
|
2717
|
+
/** Called with the history data */
|
|
1172
2718
|
callback: ioBroker.GetHistoryCallback;
|
|
1173
2719
|
}
|
|
1174
2720
|
|
|
2721
|
+
/** Options for reading an object */
|
|
1175
2722
|
export declare interface InternalGetObjectOptions {
|
|
2723
|
+
/** The id of the object */
|
|
1176
2724
|
id: string;
|
|
2725
|
+
/** Optional settings including the user context */
|
|
1177
2726
|
options: unknown;
|
|
2727
|
+
/** Called with the object */
|
|
1178
2728
|
callback?: ioBroker.GetObjectCallback<any>;
|
|
1179
2729
|
}
|
|
1180
2730
|
|
|
2731
|
+
/** Options for reading multiple objects */
|
|
1181
2732
|
export declare interface InternalGetObjectsOptions {
|
|
2733
|
+
/** The pattern to match object ids against */
|
|
1182
2734
|
pattern: Pattern;
|
|
2735
|
+
/** Restrict the result to objects of this type */
|
|
1183
2736
|
type?: string;
|
|
2737
|
+
/** Restrict the result to objects within these enums */
|
|
1184
2738
|
enums?: ioBroker.EnumList;
|
|
2739
|
+
/** Optional settings including the user context */
|
|
1185
2740
|
options?: Record<string, any> | null;
|
|
2741
|
+
/** Called with the matching objects */
|
|
1186
2742
|
callback?: ioBroker.GetObjectsCallbackTyped<any>;
|
|
1187
2743
|
}
|
|
1188
2744
|
|
|
2745
|
+
/** Options for querying an object view */
|
|
1189
2746
|
export declare interface InternalGetObjectViewOptions {
|
|
2747
|
+
/** The design document name */
|
|
1190
2748
|
design: string;
|
|
2749
|
+
/** The view name within the design document */
|
|
1191
2750
|
search: string;
|
|
2751
|
+
/** Query parameters such as startkey and endkey */
|
|
1192
2752
|
params: ioBroker.GetObjectViewParams;
|
|
2753
|
+
/** Optional settings including the user context */
|
|
1193
2754
|
options?: Record<string, any> | null;
|
|
2755
|
+
/** Called with the matching rows */
|
|
1194
2756
|
callback?: ioBroker.GetObjectViewCallback<ioBroker.AnyObject>;
|
|
1195
2757
|
}
|
|
1196
2758
|
|
|
2759
|
+
/** Options for finding a free port */
|
|
1197
2760
|
export declare interface InternalGetPortOptions {
|
|
2761
|
+
/** The preferred port to start searching from */
|
|
1198
2762
|
port: number;
|
|
2763
|
+
/** The host to bind to */
|
|
1199
2764
|
host?: string;
|
|
2765
|
+
/** Called with the free port that was found */
|
|
1200
2766
|
callback?: (port: number) => void;
|
|
1201
2767
|
}
|
|
1202
2768
|
|
|
2769
|
+
/** Options for reading a session */
|
|
1203
2770
|
export declare interface InternalGetSessionOptions {
|
|
2771
|
+
/** The session id */
|
|
1204
2772
|
id: string;
|
|
2773
|
+
/** Called with the session data */
|
|
1205
2774
|
callback: ioBroker.GetSessionCallback;
|
|
1206
2775
|
}
|
|
1207
2776
|
|
|
2777
|
+
/** Options for reading a state */
|
|
1208
2778
|
export declare interface InternalGetStateOptions {
|
|
2779
|
+
/** The id of the state */
|
|
1209
2780
|
id: string;
|
|
2781
|
+
/** Optional settings including the user context */
|
|
1210
2782
|
options?: Record<string, any> | null;
|
|
2783
|
+
/** Called with the state */
|
|
1211
2784
|
callback?: ioBroker.GetStateCallback;
|
|
1212
2785
|
}
|
|
1213
2786
|
|
|
2787
|
+
/** Options for reading the states of a device or channel */
|
|
1214
2788
|
export declare interface InternalGetStatesOfOptions {
|
|
2789
|
+
/** The parent device name */
|
|
1215
2790
|
parentDevice: string | null | undefined;
|
|
2791
|
+
/** The parent channel name */
|
|
1216
2792
|
parentChannel: string | null | undefined;
|
|
2793
|
+
/** Optional settings including the user context */
|
|
1217
2794
|
options?: Record<string, any> | null;
|
|
2795
|
+
/** Called with the states */
|
|
1218
2796
|
callback: ioBroker.GetObjectsCallback3<ioBroker.StateObject>;
|
|
1219
2797
|
}
|
|
1220
2798
|
|
|
2799
|
+
/** Options for reading multiple states */
|
|
1221
2800
|
export declare interface InternalGetStatesOptions {
|
|
2801
|
+
/** The pattern to match state ids against */
|
|
1222
2802
|
pattern: Pattern;
|
|
2803
|
+
/** Optional settings including the user context */
|
|
1223
2804
|
options: Record<string, any>;
|
|
2805
|
+
/** Called with the matching states */
|
|
1224
2806
|
callback: ioBroker.GetStatesCallback;
|
|
1225
2807
|
}
|
|
1226
2808
|
|
|
2809
|
+
/** Options for resolving a user id */
|
|
1227
2810
|
export declare interface InternalGetUserIDOptions {
|
|
2811
|
+
/** The user name to resolve */
|
|
1228
2812
|
username: string;
|
|
1229
2813
|
}
|
|
1230
2814
|
|
|
2815
|
+
/** Internal options for installing a node module */
|
|
1231
2816
|
export declare interface InternalInstallNodeModuleOptions extends InstallNodeModuleOptions {
|
|
1232
2817
|
/** Name of the npm module or an installable url ẁorking with `npm install` */
|
|
1233
2818
|
moduleNameOrUrl: string;
|
|
1234
2819
|
}
|
|
1235
2820
|
|
|
2821
|
+
/** Options for reporting a deprecation warning */
|
|
1236
2822
|
export declare interface InternalReportDeprecationOption {
|
|
1237
2823
|
/** Version in which this warning will throw an error instead */
|
|
1238
2824
|
version?: string;
|
|
@@ -1240,55 +2826,89 @@ export declare interface InternalReportDeprecationOption {
|
|
|
1240
2826
|
deprecationMessage: string;
|
|
1241
2827
|
}
|
|
1242
2828
|
|
|
2829
|
+
/** Options for sending a message to a host */
|
|
1243
2830
|
export declare interface InternalSendToHostOptions {
|
|
1244
2831
|
/** if null, send to all hosts */
|
|
1245
2832
|
hostName: string | null;
|
|
2833
|
+
/** The command to send */
|
|
1246
2834
|
command: string;
|
|
2835
|
+
/** The message payload */
|
|
1247
2836
|
message: any;
|
|
2837
|
+
/** Called with the response */
|
|
1248
2838
|
callback?: ioBroker.MessageCallback | ioBroker.MessageCallbackInfo;
|
|
1249
2839
|
}
|
|
1250
2840
|
|
|
2841
|
+
/** Options for sending a message to another instance */
|
|
1251
2842
|
export declare interface InternalSendToOptions {
|
|
2843
|
+
/** The instance to send the message to */
|
|
1252
2844
|
instanceName: string;
|
|
2845
|
+
/** The command to send */
|
|
1253
2846
|
command: string;
|
|
2847
|
+
/** The message payload */
|
|
1254
2848
|
message: any;
|
|
2849
|
+
/** Called with the response */
|
|
1255
2850
|
callback?: ioBroker.MessageCallback | ioBroker.MessageCallbackInfo;
|
|
2851
|
+
/** Additional send options */
|
|
1256
2852
|
options?: SendToOptions;
|
|
1257
2853
|
}
|
|
1258
2854
|
|
|
2855
|
+
/** Options for setting an object */
|
|
1259
2856
|
export declare interface InternalSetObjectOptions {
|
|
2857
|
+
/** The id of the object */
|
|
1260
2858
|
id: string;
|
|
2859
|
+
/** Optional settings including the user context */
|
|
1261
2860
|
options?: Record<string, any> | null;
|
|
2861
|
+
/** The object to set */
|
|
1262
2862
|
obj: ioBroker.SettableObject;
|
|
2863
|
+
/** Called once the object has been set */
|
|
1263
2864
|
callback?: ioBroker.SetObjectCallback;
|
|
1264
2865
|
}
|
|
1265
2866
|
|
|
2867
|
+
/** Options for setting a user's password */
|
|
1266
2868
|
export declare interface InternalSetPasswordOptions {
|
|
2869
|
+
/** The user whose password is set */
|
|
1267
2870
|
user: string;
|
|
2871
|
+
/** The new password */
|
|
1268
2872
|
pw: string;
|
|
2873
|
+
/** Optional settings including the user context */
|
|
1269
2874
|
options?: Record<string, any> | null;
|
|
2875
|
+
/** Called once the password has been set */
|
|
1270
2876
|
callback?: ioBroker.ErrorCallback;
|
|
1271
2877
|
}
|
|
1272
2878
|
|
|
2879
|
+
/** Options for storing a session */
|
|
1273
2880
|
export declare interface InternalSetSessionOptions {
|
|
2881
|
+
/** The session id */
|
|
1274
2882
|
id: string;
|
|
2883
|
+
/** Time to live in seconds */
|
|
1275
2884
|
ttl: number;
|
|
2885
|
+
/** The session data to store */
|
|
1276
2886
|
data: Record<string, any>;
|
|
2887
|
+
/** Called once the session has been stored */
|
|
1277
2888
|
callback?: ioBroker.ErrorCallback;
|
|
1278
2889
|
}
|
|
1279
2890
|
|
|
2891
|
+
/** Options for setting a state only if it changed */
|
|
1280
2892
|
export declare interface InternalSetStateChangedOptions extends InternalSetStateOptions {
|
|
2893
|
+
/** Called with whether the state was changed */
|
|
1281
2894
|
callback?: ioBroker.SetStateChangedCallback;
|
|
1282
2895
|
}
|
|
1283
2896
|
|
|
2897
|
+
/** Options for setting a state */
|
|
1284
2898
|
export declare interface InternalSetStateOptions {
|
|
2899
|
+
/** The id of the state, or an id object */
|
|
1285
2900
|
id: string | ioBroker.IdObject;
|
|
2901
|
+
/** The value (or full state object) to set */
|
|
1286
2902
|
state: ioBroker.StateValue | ioBroker.SettableState;
|
|
2903
|
+
/** Whether the state should be acknowledged */
|
|
1287
2904
|
ack?: boolean;
|
|
2905
|
+
/** Optional settings including the user context */
|
|
1288
2906
|
options?: Partial<GetUserGroupsOptions> | null;
|
|
2907
|
+
/** Called once the state has been set */
|
|
1289
2908
|
callback?: ioBroker.SetStateCallback;
|
|
1290
2909
|
}
|
|
1291
2910
|
|
|
2911
|
+
/** Internal parameters controlling how the adapter stops */
|
|
1292
2912
|
export declare interface InternalStopParameters extends StopParameters {
|
|
1293
2913
|
/** If mode is schedule or once */
|
|
1294
2914
|
isPause?: boolean;
|
|
@@ -1298,13 +2918,19 @@ export declare interface InternalStopParameters extends StopParameters {
|
|
|
1298
2918
|
updateAliveState?: boolean;
|
|
1299
2919
|
}
|
|
1300
2920
|
|
|
2921
|
+
/** Options for subscribing to states or objects */
|
|
1301
2922
|
export declare interface InternalSubscribeOptions {
|
|
2923
|
+
/** The pattern to subscribe to */
|
|
1302
2924
|
pattern: Pattern;
|
|
2925
|
+
/** Optional settings including the user context */
|
|
1303
2926
|
options?: Record<string, any> | null;
|
|
2927
|
+
/** Called once the subscription is registered */
|
|
1304
2928
|
callback?: ioBroker.ErrorCallback;
|
|
1305
2929
|
}
|
|
1306
2930
|
|
|
2931
|
+
/** Options for updating the adapter config */
|
|
1307
2932
|
export declare interface InternalUpdateConfigOptions {
|
|
2933
|
+
/** The new configuration values */
|
|
1308
2934
|
newConfig: Record<string, any>;
|
|
1309
2935
|
}
|
|
1310
2936
|
|
|
@@ -1327,10 +2953,35 @@ declare class Log implements ioBroker.Logger {
|
|
|
1327
2953
|
* @param logger logger instance
|
|
1328
2954
|
*/
|
|
1329
2955
|
constructor(namespaceLog: string, level: ioBroker.LogLevel, logger: any);
|
|
2956
|
+
/**
|
|
2957
|
+
* Log a message at the silly level, prefixed with the adapter namespace
|
|
2958
|
+
*
|
|
2959
|
+
* @param msg the message to log
|
|
2960
|
+
*/
|
|
1330
2961
|
silly(msg: string): void;
|
|
2962
|
+
/**
|
|
2963
|
+
* Log a message at the debug level, prefixed with the adapter namespace
|
|
2964
|
+
*
|
|
2965
|
+
* @param msg the message to log
|
|
2966
|
+
*/
|
|
1331
2967
|
debug(msg: string): void;
|
|
2968
|
+
/**
|
|
2969
|
+
* Log a message at the info level, prefixed with the adapter namespace
|
|
2970
|
+
*
|
|
2971
|
+
* @param msg the message to log
|
|
2972
|
+
*/
|
|
1332
2973
|
info(msg: string): void;
|
|
2974
|
+
/**
|
|
2975
|
+
* Log a message at the error level, prefixed with the adapter namespace
|
|
2976
|
+
*
|
|
2977
|
+
* @param msg the message to log
|
|
2978
|
+
*/
|
|
1333
2979
|
error(msg: string): void;
|
|
2980
|
+
/**
|
|
2981
|
+
* Log a message at the warn level, prefixed with the adapter namespace
|
|
2982
|
+
*
|
|
2983
|
+
* @param msg the message to log
|
|
2984
|
+
*/
|
|
1334
2985
|
warn(msg: string): void;
|
|
1335
2986
|
}
|
|
1336
2987
|
|
|
@@ -1364,11 +3015,13 @@ export declare type Pattern = string | string[];
|
|
|
1364
3015
|
|
|
1365
3016
|
declare type Pattern_2 = string | string[];
|
|
1366
3017
|
|
|
3018
|
+
/** Options controlling how a message is sent */
|
|
1367
3019
|
export declare interface SendToOptions {
|
|
1368
3020
|
/** Method throws or calls error cb, if callback not called in time, works for single targets only */
|
|
1369
3021
|
timeout?: number;
|
|
1370
3022
|
}
|
|
1371
3023
|
|
|
3024
|
+
/** Options for sending data to a UI client */
|
|
1372
3025
|
export declare interface SendToUserInterfaceClientOptions {
|
|
1373
3026
|
/** id of the UI client, if not given send to all active clients */
|
|
1374
3027
|
clientId?: string;
|
|
@@ -1376,8 +3029,11 @@ export declare interface SendToUserInterfaceClientOptions {
|
|
|
1376
3029
|
data: unknown;
|
|
1377
3030
|
}
|
|
1378
3031
|
|
|
3032
|
+
/** Result of setting a state only if it changed */
|
|
1379
3033
|
export declare interface SetStateChangedResult {
|
|
3034
|
+
/** Whether the state value was unchanged */
|
|
1380
3035
|
notChanged: boolean;
|
|
3036
|
+
/** The id of the state */
|
|
1381
3037
|
id: string;
|
|
1382
3038
|
}
|
|
1383
3039
|
|
|
@@ -1415,6 +3071,7 @@ declare enum STATE_QUALITY {
|
|
|
1415
3071
|
SENSOR_ERROR_REPORT = 132
|
|
1416
3072
|
}
|
|
1417
3073
|
|
|
3074
|
+
/** Parameters controlling how the adapter stops */
|
|
1418
3075
|
export declare interface StopParameters {
|
|
1419
3076
|
/** Specify an optional exit code */
|
|
1420
3077
|
exitCode?: number;
|
|
@@ -1422,6 +3079,7 @@ export declare interface StopParameters {
|
|
|
1422
3079
|
reason?: string;
|
|
1423
3080
|
}
|
|
1424
3081
|
|
|
3082
|
+
/** A license that may be suitable for use by an adapter */
|
|
1425
3083
|
export declare interface SuitableLicense {
|
|
1426
3084
|
/** Name of the license type, not necessarily matching adapter */
|
|
1427
3085
|
product: string;
|
|
@@ -1447,6 +3105,7 @@ export declare interface SuitableLicense {
|
|
|
1447
3105
|
decoded: {
|
|
1448
3106
|
/** E-Mail of license owner */
|
|
1449
3107
|
email: string;
|
|
3108
|
+
/** Free text comment */
|
|
1450
3109
|
comment: string;
|
|
1451
3110
|
/** License type, eg private */
|
|
1452
3111
|
type: string;
|
|
@@ -1454,15 +3113,24 @@ export declare interface SuitableLicense {
|
|
|
1454
3113
|
name: string;
|
|
1455
3114
|
/** Address of license owner */
|
|
1456
3115
|
address: {
|
|
3116
|
+
/** Country of the license owner */
|
|
1457
3117
|
Country: string;
|
|
3118
|
+
/** Name of the license owner */
|
|
1458
3119
|
Name: string;
|
|
3120
|
+
/** First address line */
|
|
1459
3121
|
AddressLine1: string;
|
|
3122
|
+
/** Second address line */
|
|
1460
3123
|
AddressLine2: string;
|
|
3124
|
+
/** ZIP / postal code */
|
|
1461
3125
|
ZIP: string;
|
|
3126
|
+
/** City of the license owner */
|
|
1462
3127
|
City: string;
|
|
1463
3128
|
};
|
|
3129
|
+
/** License type identifier */
|
|
1464
3130
|
ltype: string;
|
|
3131
|
+
/** Country code of the license owner */
|
|
1465
3132
|
country: string;
|
|
3133
|
+
/** Whether the license owner is within the EU */
|
|
1466
3134
|
eu: string;
|
|
1467
3135
|
/** VAT in percent */
|
|
1468
3136
|
vatP: 19;
|
|
@@ -1474,7 +3142,9 @@ export declare interface SuitableLicense {
|
|
|
1474
3142
|
expires: number;
|
|
1475
3143
|
/** How long license is valid, always in future if valid */
|
|
1476
3144
|
valid_till: string;
|
|
3145
|
+
/** Unique id of the license */
|
|
1477
3146
|
id: string;
|
|
3147
|
+
/** Issued-at timestamp of the JWT */
|
|
1478
3148
|
iat: number;
|
|
1479
3149
|
/** Version for which this license is valid */
|
|
1480
3150
|
version: string;
|
|
@@ -1488,21 +3158,30 @@ export declare interface SuitableLicense {
|
|
|
1488
3158
|
export declare type TimeoutCallback = (...args: any[]) => void;
|
|
1489
3159
|
|
|
1490
3160
|
export declare type UserInterfaceClientRemoveMessage = (Omit<ioBroker.Message, 'message' | 'command'> & {
|
|
3161
|
+
/** Command identifying this as a client unsubscribe message */
|
|
1491
3162
|
command: 'clientUnsubscribe';
|
|
3163
|
+
/** Details of the unsubscribe */
|
|
1492
3164
|
message: {
|
|
3165
|
+
/** Reason for unsubscribing */
|
|
1493
3166
|
reason: MessageUnsubscribeReason;
|
|
3167
|
+
/** The subscription types affected */
|
|
1494
3168
|
type: string[];
|
|
1495
3169
|
};
|
|
1496
3170
|
}) | (Omit<ioBroker.Message, 'message' | 'command'> & {
|
|
3171
|
+
/** Command identifying this as a client subscribe error message */
|
|
1497
3172
|
command: 'clientSubscribeError';
|
|
3173
|
+
/** Details of the subscribe error */
|
|
1498
3174
|
message: {
|
|
3175
|
+
/** No reason is provided for a subscribe error */
|
|
1499
3176
|
reason: undefined;
|
|
3177
|
+
/** The subscription types affected */
|
|
1500
3178
|
type: string[];
|
|
1501
3179
|
};
|
|
1502
3180
|
});
|
|
1503
3181
|
|
|
1504
3182
|
export declare type UserInterfaceClientSubscribeHandler = (subscribeInfo: UserInterfaceSubscribeInfo) => UserInterfaceClientSubscribeReturnType | Promise<UserInterfaceClientSubscribeReturnType>;
|
|
1505
3183
|
|
|
3184
|
+
/** Result returned by the adapter when a UI client subscribes */
|
|
1506
3185
|
export declare interface UserInterfaceClientSubscribeReturnType {
|
|
1507
3186
|
/** If the adapter has accepted the client subscription */
|
|
1508
3187
|
accepted: boolean;
|
|
@@ -1516,6 +3195,7 @@ export declare type UserInterfaceClientUnsubscribeHandler = (unsubscribeInfo: Us
|
|
|
1516
3195
|
|
|
1517
3196
|
declare type UserInterfaceClientUnsubscribeReason = ClientUnsubscribeReason | 'timeout';
|
|
1518
3197
|
|
|
3198
|
+
/** Information about a UI client subscription */
|
|
1519
3199
|
export declare interface UserInterfaceSubscribeInfo {
|
|
1520
3200
|
/** The client id, which can be used to send information to clients */
|
|
1521
3201
|
clientId: string;
|
|
@@ -1526,6 +3206,7 @@ export declare interface UserInterfaceSubscribeInfo {
|
|
|
1526
3206
|
export declare type UserInterfaceUnsubscribeInfo = UserInterfaceUnsubscribeInfoBaseObject & ({
|
|
1527
3207
|
/** Reason for unsubscribing */
|
|
1528
3208
|
reason: Exclude<UserInterfaceClientUnsubscribeReason, ClientUnsubscribeReason>;
|
|
3209
|
+
/** No message is present for this unsubscribe reason */
|
|
1529
3210
|
message?: undefined;
|
|
1530
3211
|
} | {
|
|
1531
3212
|
/** Reason for unsubscribing */
|
|
@@ -1539,6 +3220,7 @@ declare type UserInterfaceUnsubscribeInfoBaseObject = {
|
|
|
1539
3220
|
clientId: string;
|
|
1540
3221
|
};
|
|
1541
3222
|
|
|
3223
|
+
/** Options for validating an object/state id */
|
|
1542
3224
|
declare interface ValidateIdOptions {
|
|
1543
3225
|
/** in maintenance mode, we can access invalid ids to delete them, only works with the admin user */
|
|
1544
3226
|
maintenance?: boolean;
|
|
@@ -1546,6 +3228,9 @@ declare interface ValidateIdOptions {
|
|
|
1546
3228
|
user?: string;
|
|
1547
3229
|
}
|
|
1548
3230
|
|
|
3231
|
+
/**
|
|
3232
|
+
* Validates arguments passed to the adapter's public methods
|
|
3233
|
+
*/
|
|
1549
3234
|
export declare class Validator {
|
|
1550
3235
|
private readonly objects;
|
|
1551
3236
|
private readonly states;
|