diff --git a/.eslintrc.js b/.eslintrc.js index 860f848..d316c0c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -7,7 +7,12 @@ module.exports = { 'prettier/prettier': 'warn', '@typescript-eslint/explicit-module-boundary-types': 'error', 'prefer-arrow-callback': 'error', - 'sort-imports': 'warn', + 'sort-imports': [ + 'error', + { + ignoreDeclarationSort: true, + }, + ], }, overrides: [ { diff --git a/src/adapters/discovery/hap_node_js_client.ts b/src/adapters/discovery/hap_node_js_client.ts index 2ba7232..d24ed9b 100644 --- a/src/adapters/discovery/hap_node_js_client.ts +++ b/src/adapters/discovery/hap_node_js_client.ts @@ -1,6 +1,5 @@ import type { HapDiscover } from './api' import { HAPNodeJSClient } from 'hap-node-client' - import { Device, DeviceBoundary } from '../../boundaries' import { Array, Unknown } from 'runtypes' import { Logger } from 'homebridge' diff --git a/src/metrics.ts b/src/metrics.ts index 661d208..90bfad6 100644 --- a/src/metrics.ts +++ b/src/metrics.ts @@ -18,28 +18,6 @@ export class Metric { */ const METRICS_FILTER = ['Identifier'] -function debug(devices: Device[]): void { - const debugInfo = [] - - for (const device of devices) { - for (const accessory of device.accessories.accessories) { - for (const service of accessory.services) { - const info = [] - for (const characteristic of service.characteristics) { - info.push( - [characteristic.description, 'value' in characteristic ? characteristic.value : ''].join( - ': ', - ), - ) - } - debugInfo.push(['Service ' + Services[service.type as keyof typeof Services], info]) - } - } - } - - console.log(JSON.stringify(debugInfo, null, 4)) -} - export function aggregate(devices: Device[], timestamp: Date): Metric[] { const metrics: Metric[] = []