Skip to content

Commit

Permalink
Safe fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Feb 22, 2025
1 parent 78dd2df commit c711160
Show file tree
Hide file tree
Showing 189 changed files with 10,745 additions and 10,769 deletions.
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"recommendations": ["biomejs.biome", "vitest.explorer"]
}
}
52 changes: 26 additions & 26 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
"formatter": {
"indentStyle": "space",
"indentWidth": 4,
"lineWidth": 150,
"bracketSpacing": false
},
"linter": {
"rules": {
"style": {
"noNonNullAssertion": "off",
"noParameterAssign": "off"
},
"complexity": {
"noForEach": "off"
},
"performance": {
"noDelete": "off",
"noAccumulatingSpread": "off"
},
"suspicious": {
"noImplicitAnyLet": "off",
"noExplicitAny": "off"
}
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
"formatter": {
"indentStyle": "space",
"indentWidth": 4,
"lineWidth": 150,
"bracketSpacing": false
},
"linter": {
"rules": {
"style": {
"noNonNullAssertion": "off",
"noParameterAssign": "off"
},
"complexity": {
"noForEach": "off"
},
"performance": {
"noDelete": "off",
"noAccumulatingSpread": "off"
},
"suspicious": {
"noImplicitAnyLet": "off",
"noExplicitAny": "off"
}
}
}
}
}
10 changes: 5 additions & 5 deletions examples/join-and-log.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
const {Controller} = require('zigbee-herdsman');
const {Controller} = require("zigbee-herdsman");

const SERIAL = '/dev/ttyACM0';
const DB = './devices.db';
const SERIAL = "/dev/ttyACM0";
const DB = "./devices.db";

const coordinator = new Controller({
serialPort: {path: SERIAL},
databasePath: DB,
});

coordinator.on('message', async (msg) => {
coordinator.on("message", async (msg) => {
console.log(msg);
});

coordinator
.start()
.then(() => {
console.log('started with device', SERIAL);
console.log("started with device", SERIAL);
return coordinator.permitJoin(true, null, 600);
})
.catch((err) => {
Expand Down
8 changes: 1 addition & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,7 @@
"vitest": "^3.0.5"
},
"homepage": "https://github.com/Koenkk/zigbee-herdsman",
"keywords": [
"zigbee",
"zstack",
"emberznet",
"deconz",
"zigate"
],
"keywords": ["zigbee", "zstack", "emberznet", "deconz", "zigate"],
"license": "MIT",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
34 changes: 17 additions & 17 deletions src/adapter/adapter.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import events from 'node:events';
import events from "node:events";

import * as Models from '../models';
import {BroadcastAddress} from '../zspec/enums';
import * as Zcl from '../zspec/zcl';
import * as Zdo from '../zspec/zdo';
import * as ZdoTypes from '../zspec/zdo/definition/tstypes';
import {discoverAdapter} from './adapterDiscovery';
import * as AdapterEvents from './events';
import * as TsType from './tstype';
import type * as Models from "../models";
import type {BroadcastAddress} from "../zspec/enums";
import * as Zcl from "../zspec/zcl";
import type * as Zdo from "../zspec/zdo";
import type * as ZdoTypes from "../zspec/zdo/definition/tstypes";
import {discoverAdapter} from "./adapterDiscovery";
import type * as AdapterEvents from "./events";
import type * as TsType from "./tstype";

interface AdapterEventMap {
deviceJoined: [payload: AdapterEvents.DeviceJoinedPayload];
Expand Down Expand Up @@ -58,12 +58,12 @@ export abstract class Adapter extends events.EventEmitter<AdapterEventMap> {
adapterOptions: TsType.AdapterOptions,
): Promise<Adapter> {
const adapterLookup = {
deconz: ['./deconz/adapter/deconzAdapter', 'DeconzAdapter'],
ember: ['./ember/adapter/emberAdapter', 'EmberAdapter'],
ezsp: ['./ezsp/adapter/ezspAdapter', 'EZSPAdapter'],
zstack: ['./z-stack/adapter/zStackAdapter', 'ZStackAdapter'],
zboss: ['./zboss/adapter/zbossAdapter', 'ZBOSSAdapter'],
zigate: ['./zigate/adapter/zigateAdapter', 'ZiGateAdapter'],
deconz: ["./deconz/adapter/deconzAdapter", "DeconzAdapter"],
ember: ["./ember/adapter/emberAdapter", "EmberAdapter"],
ezsp: ["./ezsp/adapter/ezspAdapter", "EZSPAdapter"],
zstack: ["./z-stack/adapter/zStackAdapter", "ZStackAdapter"],
zboss: ["./zboss/adapter/zbossAdapter", "ZBOSSAdapter"],
zigate: ["./zigate/adapter/zigateAdapter", "ZiGateAdapter"],
};
const [adapter, path] = await discoverAdapter(serialPortOptions.adapter, serialPortOptions.path);
const detectedAdapter = adapterLookup[adapter];
Expand All @@ -77,7 +77,7 @@ export abstract class Adapter extends events.EventEmitter<AdapterEventMap> {

return new AdapterCtor(networkOptions, serialPortOptions, backupPath, adapterOptions);
} else {
throw new Error(`Adapter '${adapter}' does not exists, possible options: ${Object.keys(adapterLookup).join(', ')}`);
throw new Error(`Adapter '${adapter}' does not exists, possible options: ${Object.keys(adapterLookup).join(", ")}`);
}
}

Expand All @@ -89,7 +89,7 @@ export abstract class Adapter extends events.EventEmitter<AdapterEventMap> {

public abstract getCoordinatorVersion(): Promise<TsType.CoordinatorVersion>;

public abstract reset(type: 'soft' | 'hard'): Promise<void>;
public abstract reset(type: "soft" | "hard"): Promise<void>;

public abstract supportsBackup(): Promise<boolean>;

Expand Down
Loading

0 comments on commit c711160

Please sign in to comment.