Skip to content

Commit

Permalink
WIP: Adapter ZiGate (#241)
Browse files Browse the repository at this point in the history
* WIP: zigateAdapter

* Fix grammar

* Remove any type from RawAPSDataRequestPayload

* rollback package.json
rollback .npmignore
remove forgotten debug

Co-authored-by: Ivan Belokobylskiy <belokobylskij@gmail.com>
  • Loading branch information
G1K and devbis authored Oct 23, 2020
1 parent 09d5349 commit bed5824
Show file tree
Hide file tree
Showing 17 changed files with 2,663 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ coverage

#editor settings
.vscode
.idea

#src
src
docs
docs
5 changes: 3 additions & 2 deletions src/adapter/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ abstract class Adapter extends events.EventEmitter {
): Promise<Adapter> {
const {ZStackAdapter} = await import('./z-stack/adapter');
const {DeconzAdapter} = await import('./deconz/adapter');
type AdapterImplementation = typeof ZStackAdapter | typeof DeconzAdapter;
const {ZiGateAdapter} = await import('./zigate/adapter');
type AdapterImplementation = typeof ZStackAdapter | typeof DeconzAdapter | typeof ZiGateAdapter;

let adapters: AdapterImplementation[];
const adapterLookup = {zstack: ZStackAdapter, deconz: DeconzAdapter};
const adapterLookup = {zstack: ZStackAdapter, deconz: DeconzAdapter, zigate: ZiGateAdapter};
if (serialPortOptions.adapter) {
if (adapterLookup.hasOwnProperty(serialPortOptions.adapter)) {
adapters = [adapterLookup[serialPortOptions.adapter]];
Expand Down
4 changes: 2 additions & 2 deletions src/adapter/tstype.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface SerialPortOptions {
baudRate?: number;
rtscts?: boolean;
path?: string;
adapter?: 'zstack' | 'deconz';
adapter?: 'zstack' | 'deconz' | 'zigate';
}

interface AdapterOptions {
Expand Down Expand Up @@ -96,4 +96,4 @@ export {
SerialPortOptions, NetworkOptions, Coordinator, CoordinatorVersion, NodeDescriptor,
DeviceType, ActiveEndpoints, SimpleDescriptor, LQI, LQINeighbor, RoutingTable, Backup, NetworkParameters,
StartResult, RoutingTableEntry, AdapterOptions,
};
};
7 changes: 7 additions & 0 deletions src/adapter/zigate/adapter/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* istanbul ignore file */
/* eslint-disable */
import ZiGateAdapter from './zigateAdapter';

export {
ZiGateAdapter
};
Loading

0 comments on commit bed5824

Please sign in to comment.