From 986c85c0bf0775e465252d11e20b4077494885c4 Mon Sep 17 00:00:00 2001 From: Adrian Jagielak Date: Mon, 28 Jul 2025 23:31:14 +0200 Subject: [PATCH] Lint fixes --- futurehome/config.yaml | 2 +- futurehome/eslint.config.mjs | 1 - futurehome/package-lock.json | 8 ++++---- futurehome/package.json | 2 +- futurehome/src/ha/admin.ts | 5 ++++- futurehome/src/ha/publish_device.ts | 11 +++++------ futurehome/src/services/sound_switch.ts | 2 ++ 7 files changed, 17 insertions(+), 14 deletions(-) diff --git a/futurehome/config.yaml b/futurehome/config.yaml index 86abdf7..712604f 100644 --- a/futurehome/config.yaml +++ b/futurehome/config.yaml @@ -1,6 +1,6 @@ # https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config name: Futurehome -version: '0.1.10' +version: '0.1.14' slug: futurehome description: Local Futurehome Smarthub integration url: 'https://github.com/adrianjagielak/home-assistant-futurehome' diff --git a/futurehome/eslint.config.mjs b/futurehome/eslint.config.mjs index 57fa375..202bc7c 100644 --- a/futurehome/eslint.config.mjs +++ b/futurehome/eslint.config.mjs @@ -29,6 +29,5 @@ export default defineConfig([ }, ], }, - quotes: ['error', 'single'], }, ]); diff --git a/futurehome/package-lock.json b/futurehome/package-lock.json index 403435e..106af4f 100644 --- a/futurehome/package-lock.json +++ b/futurehome/package-lock.json @@ -16,7 +16,7 @@ }, "devDependencies": { "@eslint/js": "^9.31.0", - "@types/node": "^24.0.15", + "@types/node": "^24.1.0", "@types/ws": "^8.18.1", "@typescript-eslint/eslint-plugin": "^8.38.0", "@typescript-eslint/parser": "^8.38.0", @@ -376,9 +376,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "24.0.15", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.0.15.tgz", - "integrity": "sha512-oaeTSbCef7U/z7rDeJA138xpG3NuKc64/rZ2qmUFkFJmnMsAPaluIifqyWd8hSSMxyP9oie3dLAqYPblag9KgA==", + "version": "24.1.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.1.0.tgz", + "integrity": "sha512-ut5FthK5moxFKH2T1CUOC6ctR67rQRvvHdFLCD2Ql6KXmMuCrjsSsRI9UsLCm9M18BMwClv4pn327UvB7eeO1w==", "license": "MIT", "dependencies": { "undici-types": "~7.8.0" diff --git a/futurehome/package.json b/futurehome/package.json index 54bc268..0a74ff0 100644 --- a/futurehome/package.json +++ b/futurehome/package.json @@ -16,7 +16,7 @@ }, "devDependencies": { "@eslint/js": "^9.31.0", - "@types/node": "^24.0.15", + "@types/node": "^24.1.0", "@types/ws": "^8.18.1", "@typescript-eslint/eslint-plugin": "^8.38.0", "@typescript-eslint/parser": "^8.38.0", diff --git a/futurehome/src/ha/admin.ts b/futurehome/src/ha/admin.ts index 85df416..727c062 100644 --- a/futurehome/src/ha/admin.ts +++ b/futurehome/src/ha/admin.ts @@ -183,6 +183,7 @@ export function exposeSmarthubTools(parameters: { ], ); } catch (e) { + log.error('Failed trying to start inclusion', e); ha?.publish( `${topicPrefix}/inclusion_exclusion_status/state`, 'Failed trying to start inclusion.', @@ -254,9 +255,10 @@ export function exposeSmarthubTools(parameters: { qos: 2, }); } catch (e) { + log.error('Failed trying to stop inclusion/exclusion', e); ha?.publish( `${topicPrefix}/inclusion_exclusion_status/state`, - 'Failed trying to stop inclusion.', + 'Failed trying to stop inclusion/exclusion.', { retain: true, qos: 2, @@ -312,6 +314,7 @@ export function exposeSmarthubTools(parameters: { ], ); } catch (e) { + log.error('Failed trying to start exclusion', e); ha?.publish( `${topicPrefix}/inclusion_exclusion_status/state`, 'Failed trying to start exclusion.', diff --git a/futurehome/src/ha/publish_device.ts b/futurehome/src/ha/publish_device.ts index 73c7034..ae72a89 100644 --- a/futurehome/src/ha/publish_device.ts +++ b/futurehome/src/ha/publish_device.ts @@ -1,4 +1,3 @@ -import { sendFimpMsg } from '../fimp/fimp'; import { InclusionReport } from '../fimp/inclusion_report'; import { VinculumPd7Device, @@ -36,7 +35,7 @@ import { loginToThingsplex, } from '../thingsplex/thingsplex'; import { abbreviateHaMqttKeys } from './abbreviate_ha_mqtt_keys'; -import { ha, haCommandHandlers } from './globals'; +import { ha } from './globals'; import { HaDeviceConfig } from './ha_device_config'; import { HaMqttComponent } from './mqtt_components/_component'; @@ -50,10 +49,10 @@ export type CommandHandlers = { }; function ignoreService( - topicPrefix: string, - device: VinculumPd7Device, - svc: VinculumPd7Service, - svcName: string, + _topicPrefix: string, + _device: VinculumPd7Device, + _svc: VinculumPd7Service, + _svcName: string, ): ServiceComponentsCreationResult | undefined { return undefined; } diff --git a/futurehome/src/services/sound_switch.ts b/futurehome/src/services/sound_switch.ts index 0e322e4..857db8a 100644 --- a/futurehome/src/services/sound_switch.ts +++ b/futurehome/src/services/sound_switch.ts @@ -8,6 +8,7 @@ import { CommandHandlers, ServiceComponentsCreationResult, } from '../ha/publish_device'; +import { log } from '../logger'; export function sound_switch__components( topicPrefix: string, @@ -90,6 +91,7 @@ export function sound_switch__components( }); } } catch (e) { + log.error('sound_switch: Failed setting the siren', e); // Fallback for simple ON/OFF commands if (payload === 'ON') { await sendFimpMsg({