@iobroker/dm-utils 3.0.3 → 3.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -388,12 +388,75 @@ In version 3.x, the refresh response of device actions has changed.
388
388
  | `'device'` | `'devices'` | the entire device list will be reloaded |
389
389
  | `'instance'` | `'instance'` | (unchanged) only the instance information will be reloaded |
390
390
 
391
+ ## Icon names
392
+
393
+ You can use the following icon names for actions and controls.
394
+ Icons are resolved by the action/control `id` or by the `icon` property. You can also provide a `data:image/...` base64 string for custom icons.
395
+
396
+ ### Action and control icons (by name)
397
+
398
+ | Name(s) | MUI Icon | Description |
399
+ |----------------------------|--------------------|--------------------------------------|
400
+ | `edit`, `rename` | Edit | Edit or rename an item |
401
+ | `delete` | Delete | Delete an item |
402
+ | `refresh` | Refresh | Refresh / reload |
403
+ | `newDevice`, `new`, `add` | Add | Add or create a new item |
404
+ | `discover`, `search` | Search | Discover or search for devices |
405
+ | `unpairDevice`, `unpair` | LinkOff | Unpair / unlink a device |
406
+ | `pairDevice`, `pair` | Link | Pair / link a device |
407
+ | `identify` | NotListedLocation | Identify / locate a device |
408
+ | `play` | PlayArrow | Start playback |
409
+ | `stop` | Stop | Stop playback |
410
+ | `pause` | Pause | Pause playback |
411
+ | `forward`, `next` | FastForward | Skip forward / next track |
412
+ | `rewind`, `previous` | FastRewind | Skip backward / previous track |
413
+ | `lamp`, `light` | Lightbulb | Light / lamp control |
414
+ | `backlight` | Fluorescent | Backlight control |
415
+ | `dimmer` | WbIncandescent | Dimmer control |
416
+ | `socket` | Power | Power socket control |
417
+ | `settings` | Settings | Settings / configuration |
418
+ | `users`, `group` | Group | User group |
419
+ | `user` | Person | Single user |
420
+ | `update` | Upgrade | Update / upgrade |
421
+ | `qrcode` | QrCode | QR code |
422
+ | `info` | Info | Information |
423
+ | `lines` | Article | Text lines / log |
424
+ | `web` | Launch | Open web link |
425
+
426
+ Any unrecognized name renders a **QuestionMark** icon as fallback.
427
+
428
+ ### Legacy Font Awesome icons
429
+
430
+ These names are supported for backward compatibility. Prefer the names from the table above.
431
+
432
+ | Name(s) | MUI Icon | Description |
433
+ |--------------------------------|--------------------|--------------------------------|
434
+ | `fa-trash-can`, `fa-trash` | Delete | Delete |
435
+ | `fa-pen` | Edit | Edit |
436
+ | `fa-redo-alt` | Refresh | Refresh / redo |
437
+ | `fa-plus` | Add | Add |
438
+ | `fa-qrcode`, `qrcode` | QrCode | QR code |
439
+ | `fa-wifi` | Wifi | Wi-Fi enabled |
440
+ | `fa-wifi-slash` | WifiOff | Wi-Fi disabled |
441
+ | `fa-bluetooth` | Bluetooth | Bluetooth enabled |
442
+ | `fa-bluetooth-slash` | BluetoothDisabled | Bluetooth disabled |
443
+ | `fa-eye` | Visibility | View / visible |
444
+ | `fa-search` | Search | Search |
445
+ | `fa-unlink` | LinkOff | Unlink |
446
+ | `fa-link` | Link | Link |
447
+ | `fa-search-location` | NotListedLocation | Search location / identify |
448
+ | `fa-play` | PlayArrow | Play |
449
+ | `fa-stop` | Stop | Stop |
450
+ | `fa-pause` | Pause | Pause |
391
451
  ## Changelog
392
452
 
393
453
  <!--
394
454
  Placeholder for the next version (at the beginning of the line):
395
455
  ### **WORK IN PROGRESS**
396
456
  -->
457
+ ### 3.0.6 (2026-03-27)
458
+ - (@GermanBluefox) Added description of icons and the possibility to show an information directly on the card
459
+
397
460
  ### 3.0.3 (2026-03-26)
398
461
 
399
462
  - (@UncleSamSwiss) Enabled incremental loading of devices
@@ -1,4 +1,4 @@
1
- import type { ActionContext, ConfigConnectionType, ErrorResponse, MessageContext, ValueOrObject, ValueOrState, ValueOrStateOrObject } from '..';
1
+ import type { ActionContext, ConfigConnectionType, DeviceDetails, ErrorResponse, MessageContext, ValueOrObject, ValueOrState, ValueOrStateOrObject } from '..';
2
2
  import type { ApiVersion, DeviceId, DeviceStatus, RetVal } from './common';
3
3
  type ActionType = 'api' | 'adapter';
4
4
  export type Color = 'primary' | 'secondary' | (string & {});
@@ -94,7 +94,7 @@ export type WithHandlerOrUrl<TType extends ActionType, THandler> = {
94
94
  url: ioBroker.StringOrTranslated;
95
95
  };
96
96
  export type InstanceAction<T extends ActionType = 'api'> = ActionBase<T> & WithHandlerOrUrl<T, (context: ActionContext, options?: Record<string, any>) => RetVal<InstanceRefreshResponse>> & {
97
- title: ioBroker.StringOrTranslated;
97
+ title?: ioBroker.StringOrTranslated;
98
98
  };
99
99
  export type DeviceUpdate<T extends ActionType = 'api', TId extends DeviceId = DeviceId> = {
100
100
  update: DeviceInfo<T, TId>;
@@ -142,6 +142,8 @@ export interface DeviceInfo<T extends ActionType = 'api', TId extends DeviceId =
142
142
  controls?: DeviceControl<T, TId>[];
143
143
  /** If true, the button `more` will be shown on the card and called `dm:deviceDetails` action to get the details */
144
144
  hasDetails?: ValueOrStateOrObject<boolean>;
145
+ /** Following optional information will be shown on the card directly. Do not try to show a table or other big objects on a card. It is suggested to use "state" components */
146
+ customInfo?: DeviceDetails<TId>;
145
147
  /** Device type for grouping */
146
148
  group?: {
147
149
  key: string;
@@ -925,6 +925,7 @@ export type ActionButton = {
925
925
  /** Name of the attribute in data that should be copied to clipboard */
926
926
  copyToClipboardAttr?: string;
927
927
  };
928
+ export type JsonFormData = Record<string, any>;
928
929
  export type BackEndCommandJsonFormOptions = {
929
930
  /** Data for the form */
930
931
  data?: JsonFormData;
@@ -936,13 +937,12 @@ export type BackEndCommandJsonFormOptions = {
936
937
  maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
937
938
  /** Minimal width of the dialog */
938
939
  minWidth?: number;
939
- /** Do not translate title */
940
+ /** Do not translate a title */
940
941
  noTranslation?: boolean;
941
942
  /** Always allow the apply button. Even when nothing was changed */
942
943
  ignoreApplyDisabled?: boolean;
943
944
  };
944
945
  export type JsonFormSchema = ConfigItemPanel | ConfigItemTabs;
945
- export type JsonFormData = Record<string, any>;
946
946
  export interface DeviceDetails<TId extends DeviceId = DeviceId> {
947
947
  id: TId;
948
948
  schema: JsonFormSchema;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iobroker/dm-utils",
3
- "version": "3.0.3",
3
+ "version": "3.0.6",
4
4
  "description": "ioBroker Device Manager utilities for backend",
5
5
  "main": "build/index.js",
6
6
  "publishConfig": {