From 549c3ea211cfd3a0da5b2cf05f4734557c897172 Mon Sep 17 00:00:00 2001 From: Donavan Becker Date: Tue, 6 Feb 2024 21:44:47 -0600 Subject: [PATCH] v3.2.0 (#926) ## [3.2.0](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v3.2.0) (2024-02-06) ### What's Changed - Upgrade to latest node-switchbot with is now a Typescript ES-Module. - Housekeeping and updated dependencies. **Full Changelog**: https://github.com/OpenWonderLabs/homebridge-switchbot/compare/v3.1.3...v3.2.0 --- CHANGELOG.md | 8 ++++++++ package-lock.json | 14 +++++++------- package.json | 4 ++-- src/custom.d.ts | 2 ++ src/platform.ts | 2 +- 5 files changed, 20 insertions(+), 10 deletions(-) create mode 100644 src/custom.d.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index bca5a23d..7c91bb66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/) +## [3.2.0](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v3.2.0) (2024-02-06) + +### What's Changed +- Upgrade to latest node-switchbot with is now a Typescript ES-Module. +- Housekeeping and updated dependencies. + +**Full Changelog**: https://github.com/OpenWonderLabs/homebridge-switchbot/compare/v3.1.3...v3.2.0 + ## [3.1.3](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v3.1.3) (2024-02-06) ### What's Changed diff --git a/package-lock.json b/package-lock.json index d55136e9..7e5e37bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@switchbot/homebridge-switchbot", - "version": "3.1.3", + "version": "3.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@switchbot/homebridge-switchbot", - "version": "3.1.3", + "version": "3.2.0", "funding": [ { "type": "Paypal", @@ -44,7 +44,7 @@ "node": "^18 || ^20" }, "optionalDependencies": { - "node-switchbot": "^1.10.0" + "node-switchbot": "^2.0.1" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -6936,12 +6936,12 @@ } }, "node_modules/node-switchbot": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/node-switchbot/-/node-switchbot-1.10.0.tgz", - "integrity": "sha512-na7yfPQWdDCxRdrLBUAgu6AHRiSOmihwGK8DbhsFGlNSVWsWcd0bpbYUV1jRGYKWMMYWkhYHoh1t2wJYRirnNg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/node-switchbot/-/node-switchbot-2.0.1.tgz", + "integrity": "sha512-k5YsV/ifPwbs/3X1WH7W/fXVwG8uR5VwLskSjviN75T+HJxGUq3KI025OYDnFWxq9jQIrm5U6Fzvo5Q/MCzCqQ==", "optional": true, "dependencies": { - "@abandonware/noble": "^1.9.2-23" + "@abandonware/noble": "^1.9.2-24" }, "optionalDependencies": { "@abandonware/bluetooth-hci-socket": "^0.5.3-10" diff --git a/package.json b/package.json index 6916e3d5..5dbb712e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "displayName": "SwitchBot", "name": "@switchbot/homebridge-switchbot", - "version": "3.1.3", + "version": "3.2.0", "description": "The SwitchBot plugin allows you to access your SwitchBot device(s) from HomeKit.", "author": { "name": "SwitchBot", @@ -84,7 +84,7 @@ "undici": "^6.6.2" }, "optionalDependencies": { - "node-switchbot": "^1.10.0" + "node-switchbot": "^2.0.1" }, "devDependencies": { "@types/node": "^20.11.16", diff --git a/src/custom.d.ts b/src/custom.d.ts new file mode 100644 index 00000000..257530e2 --- /dev/null +++ b/src/custom.d.ts @@ -0,0 +1,2 @@ +declare module 'homebridge-lib' +declare module 'fakegato-history' diff --git a/src/platform.ts b/src/platform.ts index dd04094b..1f8709db 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -39,7 +39,6 @@ import asyncmqtt from 'async-mqtt'; import crypto, { randomUUID } from 'crypto'; import { readFileSync, writeFileSync } from 'fs'; import hbLib from 'homebridge-lib'; -/*import { SwitchBot } from '/Users/Shared/GitHub/OpenWonderLabs/node-switchbot/dist/switchbot.js';*/ @@ -2528,6 +2527,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin { try { noble = (await import('@abandonware/noble')).default; SwitchBot = (await import('node-switchbot')).default; + //SwitchBot = (await import('/Users/Shared/GitHub/OpenWonderLabs/node-switchbot/dist/switchbot.js')).default; queueScheduler.schedule(() => (switchbot = new SwitchBot({ 'noble': noble }))); } catch (e: any) { switchbot = false;