Skip to content

Commit

Permalink
Merge pull request #1052 from Jey-Cee/device-manager
Browse files Browse the repository at this point in the history
added device manager
  • Loading branch information
GermanBluefox authored Dec 12, 2023
2 parents 4dd8fa4 + 62ff813 commit 411ebbe
Show file tree
Hide file tree
Showing 11 changed files with 618 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ admin/i18n/flat.txt
admin/i18n/*/flat.txt
remove.sh
result


# ioBroker dev-server
.dev-server/
15 changes: 15 additions & 0 deletions build/lib/devicemgmt.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { ActionContext, DeviceDetails, DeviceInfo, DeviceManagement, DeviceRefresh, InstanceDetails } from '@jey-cee/dm-utils';
import { HomematicRpc } from '../main';
export declare class dmHmRpc extends DeviceManagement<HomematicRpc> {
protected getInstanceInfo(): InstanceDetails;
protected handleRefresh(context: object): Promise<{
refresh: boolean;
}>;
protected listDevices(): Promise<DeviceInfo[]>;
protected getDeviceDetails(id: string, context: ActionContext): Promise<DeviceDetails | null | {
error: string;
}>;
handleRenameDevice(id: string, context: ActionContext): Promise<{
refresh: DeviceRefresh;
} | undefined>;
}
190 changes: 190 additions & 0 deletions build/lib/devicemgmt.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/lib/devicemgmt.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

134 changes: 133 additions & 1 deletion build/main.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,133 @@
export {};
import * as utils from '@iobroker/adapter-core';
export declare class HomematicRpc extends utils.Adapter {
/** On failed rpc call retry in X ms */
private readonly RETRY_DELAY_MS;
private readonly metaValues;
private readonly dpTypes;
private lastEvent;
private eventInterval;
private connInterval;
private connTimeout;
private daemonURL;
private daemonProto;
private homematicPath;
private readonly COMMON_TYPE_MAPPING;
private readonly deviceManagement;
private readonly methods;
constructor(options?: Partial<utils.AdapterOptions>);
/**
* Is called when databases are connected and adapter received configuration.
*/
private onReady;
/**
* Is called when adapter shuts down - callback has to be called under any circumstances!
*
* @param callback call this in any case, it is necessary to clean up the adapter correctly
*/
private onUnload;
/**
* Is called if a subscribed state changes
*
* @param id the state id
* @param state the actual state, nullish if deleted
*/
private onStateChange;
/**
* Handle messages send to this instance
* @param obj the message object
*/
private onMessage;
/**
* Connect to the CCU
*
* @param isFirst if it's the initial connection
*/
private connect;
/**
* Send ping to API, if error response, set status disconnected and try reconnect
*/
private sendPing;
/**
* Keeps connection alive by pinging or reconnecting if ping is too old
*/
private keepAlive;
/**
* Sends init to RPC server
*/
private sendInit;
/**
* Inits the RPC server
*/
private initRpcServer;
/**
* Adds the paramset objects of the given paramset to the given channel
*
* @param channel - channel object with at least "_id" property
* @param paramset - paramset object retrived by CCU
*/
private addParamsetObjects;
/**
* This method just performs an async rpc method call
*
* @param method the method name
* @param params the method specific parameters
*/
private rpcMethodCallAsyncHelper;
/**
* Async variant of method call which also performs a retry on first error of "setValue"
*
* @param method the method name
* @param params the method specific parameters
*/
private rpcMethodCallAsync;
/**
* Control the EPAPER display
*
* @param id
* @param data
*/
private controlEPaper;
/**
* Read signal from EPAPER display
*
* @param id
*/
private readSignals;
/**
* Read the settings from EPAPER display
*
* @param id
*/
private readSettings;
/**
* Get value paramsets and add them
*
* @param valueParamsets
*/
private getValueParamsets;
/**
* Add EPAPER to meta objects
*/
private addEPaperToMeta;
/**
* Create the devices delivered in the device array
*
* @param deviceArr - array of devices
*/
private createDevices;
/**
* Get all CuxD devices
*/
private getCuxDevices;
/**
* Update the connection indicator and ensure ping interval is running
*/
private updateConnection;
/**
* Derives the common properties of a Paramset SPECIAL attribute
*
* @param paramObj Paramset Object with SPECIAL property
* @param obj ioBroker state object which will be extended
*/
private addCommonSpecial;
}
7 changes: 7 additions & 0 deletions build/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/main.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 411ebbe

Please sign in to comment.