Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
89a1ffc
Fixed name of custom messagebox setting
UncleSamSwiss Jan 26, 2026
8080e28
Upgrade vscode settings
UncleSamSwiss Jan 26, 2026
e865d21
Add missing ignoreApplyDisabled documentation
UncleSamSwiss Feb 16, 2026
7ce8d5d
Formatted with prettier
UncleSamSwiss Feb 16, 2026
f38104b
Update dynamic generated code from json-config
UncleSamSwiss Feb 16, 2026
39b865e
Fix issue with JsonConfigContext referencing React
UncleSamSwiss Feb 16, 2026
ab9b4b1
Allow device list to load incrementally
UncleSamSwiss Feb 16, 2026
2afd43a
Simplify icon type (union with string)
UncleSamSwiss Feb 16, 2026
da13e60
Removed direct access to `DeviceManagement.handleXxx()` methods
UncleSamSwiss Feb 16, 2026
f0294a4
Allow device ID to be any valid JSON
UncleSamSwiss Feb 16, 2026
81414b5
Add identifier to device info
UncleSamSwiss Feb 16, 2026
1245e4f
Allow to update and delete a device after an action
UncleSamSwiss Feb 16, 2026
e47a759
Allow actions to be links
UncleSamSwiss Feb 16, 2026
23dab75
Remove requirement to add common.supportedMessages.custom
UncleSamSwiss Feb 16, 2026
47e07e5
Add response types to the API exports
UncleSamSwiss Feb 18, 2026
1078cd7
Fixing API confusion with better types
UncleSamSwiss Feb 25, 2026
c326310
Added required types export
GermanBluefox Feb 25, 2026
be0b53b
MOved tasks.js to TS
GermanBluefox Feb 25, 2026
7595bac
Added README.md
GermanBluefox Feb 25, 2026
3bec16f
Formatting
GermanBluefox Feb 25, 2026
e681091
Change protocol version for this PR to v3
UncleSamSwiss Feb 25, 2026
6c2eca2
Formatting
GermanBluefox Feb 25, 2026
ae5b5a5
Adding build folder to git
GermanBluefox Feb 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
*.code-workspace
node_modules
nbproject
build/

Thumbs.db
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[typescript]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
"source.organizeImports": "explicit"
}
}
}
321 changes: 197 additions & 124 deletions README.md

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions build/ActionContext.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type { BackEndCommandJsonFormOptions, JsonFormData, JsonFormSchema, ProgressOptions } from '.';
import type { ProgressDialog } from './ProgressDialog';
export interface ActionContext {
showMessage(text: ioBroker.StringOrTranslated): Promise<void>;
showConfirmation(text: ioBroker.StringOrTranslated): Promise<boolean>;
showForm(schema: JsonFormSchema, options?: BackEndCommandJsonFormOptions): Promise<JsonFormData | undefined>;
openProgress(title: string, options?: ProgressOptions): Promise<ProgressDialog>;
}
2 changes: 2 additions & 0 deletions build/ActionContext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
56 changes: 56 additions & 0 deletions build/DeviceManagement.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import type { AdapterInstance } from '@iobroker/adapter-core';
import type { ActionContext } from './ActionContext';
import type { ProgressDialog } from './ProgressDialog';
import { type ActionButton, type DeviceDetails, type DeviceId, type DeviceInfo, type DeviceStatus, type ErrorResponse, type InstanceDetails, type JsonFormData, type JsonFormSchema, type RetVal } from './types';
import type { BackendToGuiCommand, DeviceRefreshResponse, InstanceRefreshResponse } from './types/base';
import type { ProgressOptions } from './types/common';
export type DeviceLoadContext<TId extends DeviceId> = {
addDevice(device: DeviceInfo<TId>): void;
setTotalDevices(count: number): void;
};
export declare abstract class DeviceManagement<TAdapter extends AdapterInstance = AdapterInstance, TId extends DeviceId = string> {
protected readonly adapter: TAdapter;
private instanceInfo?;
private devices?;
private readonly communicationStateId;
private readonly deviceLoadContexts;
private readonly messageContexts;
constructor(adapter: TAdapter, communicationStateId?: string | boolean);
private ensureCommunicationState;
protected sendCommandToGui(command: BackendToGuiCommand<TId>): Promise<void>;
protected get log(): ioBroker.Log;
protected getInstanceInfo(): RetVal<InstanceDetails>;
protected abstract loadDevices(context: DeviceLoadContext<TId>): RetVal<void>;
protected getDeviceInfo(_deviceId: TId): RetVal<DeviceInfo<TId>>;
protected getDeviceStatus(_deviceId: TId): RetVal<DeviceStatus | DeviceStatus[]>;
protected getDeviceDetails(id: TId): RetVal<DeviceDetails<TId> | null | {
error: string;
}>;
private handleInstanceAction;
private handleDeviceAction;
private handleDeviceControl;
private handleDeviceControlState;
private onMessage;
private handleMessage;
private sendReply;
}
export declare class MessageContext<TId extends DeviceId> implements ActionContext {
private readonly adapter;
private hasOpenProgressDialog;
private lastMessage?;
private progressHandler?;
constructor(msg: ioBroker.Message, adapter: AdapterInstance);
showMessage(text: ioBroker.StringOrTranslated): Promise<void>;
showConfirmation(text: ioBroker.StringOrTranslated): Promise<boolean>;
showForm(schema: JsonFormSchema, options?: {
data?: JsonFormData;
title?: ioBroker.StringOrTranslated;
buttons?: (ActionButton | 'apply' | 'cancel' | 'close')[];
}): Promise<JsonFormData | undefined>;
openProgress(title: ioBroker.StringOrTranslated, options?: ProgressOptions): Promise<ProgressDialog>;
sendFinalResult(result: ErrorResponse | DeviceRefreshResponse<'api', TId> | InstanceRefreshResponse): void;
sendControlResult(deviceId: TId, controlId: string, result: ErrorResponse | ioBroker.State): void;
handleProgress(message: ioBroker.Message): void;
private checkPreconditions;
private send;
}
Loading
Loading