Fix linting issues

This commit is contained in:
Lars Strojny 2022-11-07 23:02:24 +01:00
parent e338c982d2
commit ba3786bf6d
3 changed files with 6 additions and 24 deletions

View file

@ -7,7 +7,12 @@ module.exports = {
'prettier/prettier': 'warn', 'prettier/prettier': 'warn',
'@typescript-eslint/explicit-module-boundary-types': 'error', '@typescript-eslint/explicit-module-boundary-types': 'error',
'prefer-arrow-callback': 'error', 'prefer-arrow-callback': 'error',
'sort-imports': 'warn', 'sort-imports': [
'error',
{
ignoreDeclarationSort: true,
},
],
}, },
overrides: [ overrides: [
{ {

View file

@ -1,6 +1,5 @@
import type { HapDiscover } from './api' import type { HapDiscover } from './api'
import { HAPNodeJSClient } from 'hap-node-client' import { HAPNodeJSClient } from 'hap-node-client'
import { Device, DeviceBoundary } from '../../boundaries' import { Device, DeviceBoundary } from '../../boundaries'
import { Array, Unknown } from 'runtypes' import { Array, Unknown } from 'runtypes'
import { Logger } from 'homebridge' import { Logger } from 'homebridge'

View file

@ -18,28 +18,6 @@ export class Metric {
*/ */
const METRICS_FILTER = ['Identifier'] 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 : '<none>'].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[] { export function aggregate(devices: Device[], timestamp: Date): Metric[] {
const metrics: Metric[] = [] const metrics: Metric[] = []