From 0edc67107e66a52e7b8906167ee33c6584579895 Mon Sep 17 00:00:00 2001 From: Donavan Becker Date: Mon, 18 Nov 2024 11:50:19 -0600 Subject: [PATCH] v4.1.8 (#1114) ## [4.1.4](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v4.1.4) (2024-11-18) ### What's Changed - Remove unneeded unknown casting [#1113](https://github.com/OpenWonderLabs/homebridge-switchbot/pull/1113), Thanks [@dnicolson](https://github.com/dnicolson) - Remove additional space in logging [#1111](https://github.com/OpenWonderLabs/homebridge-switchbot/pull/1111), Thanks [@dnicolson](https://github.com/dnicolson) - Fix service data check [#1110](https://github.com/OpenWonderLabs/homebridge-switchbot/pull/1110), Thanks [@dnicolson](https://github.com/dnicolson) - Update default refresh rate [#1109](https://github.com/OpenWonderLabs/homebridge-switchbot/pull/1109), Thanks [@dnicolson](https://github.com/dnicolson) - Housekeeping and updated dependencies. **Full Changelog**: https://github.com/OpenWonderLabs/homebridge-switchbot/compare/v4.1.3...v4.1.4 --- .github/workflows/beta-release.yml | 4 +- .github/workflows/dependabot.yml | 13 - .github/workflows/release.yml | 6 +- CHANGELOG.md | 11 + config.schema.json | 118 ++--- docs/functions/default.html | 2 +- package-lock.json | 700 +++++++++++++++-------------- package.json | 14 +- src/device/blindtilt.ts | 6 +- src/device/bot.ts | 10 +- src/device/ceilinglight.ts | 6 +- src/device/colorbulb.ts | 14 +- src/device/contact.ts | 2 +- src/device/curtain.ts | 10 +- src/device/device.ts | 10 +- src/device/fan.ts | 4 +- src/device/humidifier.ts | 4 +- src/device/iosensor.ts | 2 +- src/device/lightstrip.ts | 8 +- src/device/lock.ts | 4 +- src/device/meter.ts | 2 +- src/device/meterplus.ts | 2 +- src/device/meterpro.ts | 142 ++++-- src/device/motion.ts | 2 +- src/device/plug.ts | 4 +- src/device/robotvacuumcleaner.ts | 8 +- src/device/waterdetector.ts | 2 +- src/irdevice/airconditioner.ts | 6 +- src/irdevice/airpurifier.ts | 4 +- src/platform.ts | 1 + src/settings.ts | 12 +- 31 files changed, 632 insertions(+), 501 deletions(-) delete mode 100644 .github/workflows/dependabot.yml diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml index b9ad735a..936e3d61 100644 --- a/.github/workflows/beta-release.yml +++ b/.github/workflows/beta-release.yml @@ -1,4 +1,4 @@ -name: Node-CI Beta +name: Beta Release on: push: @@ -20,6 +20,8 @@ jobs: publish: needs: lint if: ${{ github.repository == 'OpenWonderLabs/homebridge-switchbot' }} + permissions: + id-token: write uses: OpenWonderLabs/.github/.github/workflows/npm-publish.yml@latest with: tag: 'beta' diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml deleted file mode 100644 index f2990d8b..00000000 --- a/.github/workflows/dependabot.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: AutoDependabot - -on: - pull_request: - branches: [ beta, latest ] - pull_request_target: - branches: [ beta, latest ] - -jobs: - dependabot: - uses: OpenWonderLabs/.github/.github/workflows/dependabot.yml@latest - secrets: - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index df3799a7..70515aed 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Node Release +name: Release on: release: @@ -14,9 +14,9 @@ jobs: publish: needs: build_and_test - if: ${{ github.repository == 'OpenWonderLabs/homebridge-switchbot' }} - + permissions: + id-token: write uses: OpenWonderLabs/.github/.github/workflows/npm-publish.yml@latest secrets: npm_auth_token: ${{ secrets.npm_token }} diff --git a/CHANGELOG.md b/CHANGELOG.md index d90ea57e..4d33017a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/) +## [4.1.4](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v4.1.4) (2024-11-18) + +### What's Changed +- Remove unneeded unknown casting [#1113](https://github.com/OpenWonderLabs/homebridge-switchbot/pull/1113), Thanks [@dnicolson](https://github.com/dnicolson) +- Remove additional space in logging [#1111](https://github.com/OpenWonderLabs/homebridge-switchbot/pull/1111), Thanks [@dnicolson](https://github.com/dnicolson) +- Fix service data check [#1110](https://github.com/OpenWonderLabs/homebridge-switchbot/pull/1110), Thanks [@dnicolson](https://github.com/dnicolson) +- Update default refresh rate [#1109](https://github.com/OpenWonderLabs/homebridge-switchbot/pull/1109), Thanks [@dnicolson](https://github.com/dnicolson) +- Housekeeping and updated dependencies. + +**Full Changelog**: https://github.com/OpenWonderLabs/homebridge-switchbot/compare/v4.1.3...v4.1.4 + ## [4.1.3](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v4.1.3) (2024-11-05) ### What's Changed diff --git a/config.schema.json b/config.schema.json index 78300ef1..c9b3c984 100644 --- a/config.schema.json +++ b/config.schema.json @@ -1035,7 +1035,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Humidifier'].hide_device);" } @@ -1250,7 +1250,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Hub 2'].hide_device);" } @@ -1560,7 +1560,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Bot'].hide_device);" } @@ -1775,7 +1775,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Meter'].hide_device);" } @@ -1990,7 +1990,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['MeterPlus'].hide_device);" } @@ -2205,7 +2205,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Meter Plus (JP)'].hide_device);" } @@ -2420,7 +2420,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['WoIOSensor'].hide_device);" } @@ -2615,7 +2615,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Water Detector'].hide_device);" } @@ -2818,7 +2818,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Water Detector'].hide_device);" } @@ -3028,7 +3028,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Contact Sensor'].hide_device);" } @@ -3314,7 +3314,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Curtain'].hide_device);" } @@ -3600,7 +3600,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Curtain3'].hide_device);" } @@ -3886,7 +3886,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['WoRollerShade'].hide_device);" } @@ -4172,7 +4172,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Roller Shade'].hide_device);" } @@ -4493,7 +4493,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Blind Tilt'].hide_device);" } @@ -4673,7 +4673,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Plug'].hide_device);" } @@ -4853,7 +4853,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Plug Mini (US)'].hide_device);" } @@ -5033,7 +5033,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Plug Mini (JP)'].hide_device);" } @@ -5227,7 +5227,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Smart Lock'].hide_device);" } @@ -5421,7 +5421,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Smart Lock Pro'].hide_device);" } @@ -5619,7 +5619,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Color Bulb'].hide_device);" } @@ -5799,7 +5799,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['K10+'].hide_device);" } @@ -5979,7 +5979,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['K10+ Pro'].hide_device);" } @@ -6159,7 +6159,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['WoSweeper'].hide_device);" } @@ -6339,7 +6339,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['WoSweeperMini'].hide_device);" } @@ -6519,7 +6519,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Robot Vacuum Cleaner S1'].hide_device);" } @@ -6699,7 +6699,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Robot Vacuum Cleaner S1 Plus'].hide_device);" } @@ -6879,7 +6879,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Robot Vacuum Cleaner S10'].hide_device);" } @@ -7077,7 +7077,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Ceiling Light'].hide_device);" } @@ -7275,7 +7275,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Ceiling Light Pro'].hide_device);" } @@ -7473,7 +7473,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Strip Light'].hide_device);" } @@ -7662,7 +7662,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Battery Circulator Fan'].hide_device);" } @@ -8393,7 +8393,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['TV'] && !model.options.irdeviceConfig['TV'].hide_device);" } @@ -8522,7 +8522,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['DIY TV'] && !model.options.irdeviceConfig['DIY TV'].hide_device);" } @@ -8651,7 +8651,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['Projector'] && !model.options.irdeviceConfig['Projector'].hide_device);" } @@ -8780,7 +8780,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['DIY Projector'] && !model.options.irdeviceConfig['DIY Projector'].hide_device);" } @@ -8909,7 +8909,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['Set Top Box'] && !model.options.irdeviceConfig['Set Top Box'].hide_device);" } @@ -9038,7 +9038,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['DIY Set Top Box'] && !model.options.irdeviceConfig['DIY Set Top Box'].hide_device);" } @@ -9167,7 +9167,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['IPTV'] && !model.options.irdeviceConfig['IPTV'].hide_device);" } @@ -9296,7 +9296,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['DIY IPTV'] && !model.options.irdeviceConfig['DIY IPTV'].hide_device);" } @@ -9425,7 +9425,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['DVD'] && !model.options.irdeviceConfig['DVD'].hide_device);" } @@ -9554,7 +9554,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['DIY DVD'] && !model.options.irdeviceConfig['DIY DVD'].hide_device);" } @@ -9683,7 +9683,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['Speaker'] && !model.options.irdeviceConfig['Speaker'].hide_device);" } @@ -9812,7 +9812,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['DIY Speaker'] && !model.options.irdeviceConfig['DIY Speaker'].hide_device);" } @@ -9941,7 +9941,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['Fan'] && !model.options.irdeviceConfig['Fan'].hide_device);" } @@ -10070,7 +10070,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['DIY Fan'] && !model.options.irdeviceConfig['DIY Fan'].hide_device);" } @@ -10199,7 +10199,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['Air Conditioner'] && !model.options.irdeviceConfig['Air Conditioner'].hide_device);" } @@ -10328,7 +10328,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['DIY Air Conditioner'] && !model.options.irdeviceConfig['DIY Air Conditioner'].hide_device);" } @@ -10457,7 +10457,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['Light'] && !model.options.irdeviceConfig['Light'].hide_device);" } @@ -10586,7 +10586,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['DIY Light'] && !model.options.irdeviceConfig['DIY Light'].hide_device);" } @@ -10715,7 +10715,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['Air Purifier'] && !model.options.irdeviceConfig['Air Purifier'].hide_device);" } @@ -10844,7 +10844,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['DIY Air Purifier'] && !model.options.irdeviceConfig['DIY Air Purifier'].hide_device);" } @@ -10973,7 +10973,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['Water Heater'] && !model.options.irdeviceConfig['Water Heater'].hide_device);" } @@ -11102,7 +11102,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['DIY Water Heater'] && !model.options.irdeviceConfig['DIY Water Heater'].hide_device);" } @@ -11231,7 +11231,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['Vacuum Cleaner'] && !model.options.irdeviceConfig['Vacuum Cleaner'].hide_device);" } @@ -11360,7 +11360,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['DIY Vacuum Cleaner'] && !model.options.irdeviceConfig['DIY Vacuum Cleaner'].hide_device);" } @@ -11489,7 +11489,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['Camera'] && !model.options.irdeviceConfig['Camera'].hide_device);" } @@ -11618,7 +11618,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['DIY Camera'] && !model.options.irdeviceConfig['DIY Camera'].hide_device);" } @@ -11747,7 +11747,7 @@ "refreshRate": { "title": "Device Refresh Rate", "type": "number", - "placeholder": 360, + "placeholder": 5, "condition": { "functionBody": "return (model.options && model.options.irdeviceConfig && model.options.irdeviceConfig['Others'] && !model.options.irdeviceConfig['Others'].hide_device);" } diff --git a/docs/functions/default.html b/docs/functions/default.html index 41bb509b..e758e436 100644 --- a/docs/functions/default.html +++ b/docs/functions/default.html @@ -1 +1 @@ -default | @switchbot/homebridge-switchbot
  • Parameters

    • api: API

    Returns void

+default | @switchbot/homebridge-switchbot
  • Parameters

    • api: API

    Returns void

diff --git a/package-lock.json b/package-lock.json index ec400f32..687a5eb9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@switchbot/homebridge-switchbot", - "version": "4.1.3", + "version": "4.1.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@switchbot/homebridge-switchbot", - "version": "4.1.3", + "version": "4.1.4", "funding": [ { "type": "Paypal", @@ -23,11 +23,11 @@ "async-mqtt": "^2.6.3", "fakegato-history": "^0.6.5", "homebridge-lib": "^7.1.0", - "node-switchbot": "^3.3.0", + "node-switchbot": "^3.4.0", "rxjs": "^7.8.1" }, "devDependencies": { - "@antfu/eslint-config": "^3.8.0", + "@antfu/eslint-config": "^3.9.1", "@types/aes-js": "^3.1.4", "@types/debug": "^4.1.12", "@types/fs-extra": "^11.0.4", @@ -35,17 +35,17 @@ "@types/node": "^22.9.0", "@types/semver": "^7.5.8", "@types/source-map-support": "^0.5.10", - "@vitest/coverage-v8": "^2.1.4", - "eslint": "^9.14.0", + "@vitest/coverage-v8": "^2.1.5", + "eslint": "^9.15.0", "eslint-plugin-format": "^0.1.2", "homebridge": "^1.8.5", - "homebridge-config-ui-x": "4.62.0", + "homebridge-config-ui-x": "4.63.0", "nodemon": "^3.1.7", "shx": "^0.3.4", "ts-node": "^10.9.2", "typedoc": "^0.26.11", "typescript": "^5.6.3", - "vitest": "^2.1.4" + "vitest": "^2.1.5" }, "engines": { "homebridge": "^1.8.5 || ^2.0.0 || ^2.0.0-beta.22 || ^2.0.0-alpha.37", @@ -67,39 +67,39 @@ } }, "node_modules/@antfu/eslint-config": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@antfu/eslint-config/-/eslint-config-3.8.0.tgz", - "integrity": "sha512-O5QSufPHpKTm0wk1OQ5c2mOZVzCqYV3hIDrt5zt+cOWqiG8YXLPkSOD4fFwjomATtOuUbcLUwkcgY5dErM7aIw==", + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/@antfu/eslint-config/-/eslint-config-3.9.1.tgz", + "integrity": "sha512-a/xubkbJ9i6U6jX5ZUB3GeXahhorpMWgDRwdga297ilmadcJFrepBRjGf8SnA+RlPrVRI4cqPdQeQZZKR+Mjiw==", "dev": true, "license": "MIT", "dependencies": { "@antfu/install-pkg": "^0.4.1", "@clack/prompts": "^0.7.0", - "@eslint-community/eslint-plugin-eslint-comments": "^4.4.0", - "@eslint/markdown": "^6.2.0", - "@stylistic/eslint-plugin": "^2.9.0", - "@typescript-eslint/eslint-plugin": "^8.9.0", - "@typescript-eslint/parser": "^8.9.0", - "@vitest/eslint-plugin": "^1.1.7", + "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1", + "@eslint/markdown": "^6.2.1", + "@stylistic/eslint-plugin": "^2.10.1", + "@typescript-eslint/eslint-plugin": "^8.14.0", + "@typescript-eslint/parser": "^8.14.0", + "@vitest/eslint-plugin": "^1.1.10", "eslint-config-flat-gitignore": "^0.3.0", "eslint-flat-config-utils": "^0.4.0", "eslint-merge-processors": "^0.1.0", "eslint-plugin-antfu": "^2.7.0", "eslint-plugin-command": "^0.2.6", - "eslint-plugin-import-x": "^4.3.1", - "eslint-plugin-jsdoc": "^50.4.1", - "eslint-plugin-jsonc": "^2.16.0", - "eslint-plugin-n": "^17.11.1", + "eslint-plugin-import-x": "^4.4.2", + "eslint-plugin-jsdoc": "^50.5.0", + "eslint-plugin-jsonc": "^2.18.1", + "eslint-plugin-n": "^17.13.1", "eslint-plugin-no-only-tests": "^3.3.0", - "eslint-plugin-perfectionist": "^3.9.0", + "eslint-plugin-perfectionist": "^3.9.1", "eslint-plugin-regexp": "^2.6.0", "eslint-plugin-toml": "^0.11.1", "eslint-plugin-unicorn": "^56.0.0", "eslint-plugin-unused-imports": "^4.1.4", - "eslint-plugin-vue": "^9.29.0", - "eslint-plugin-yml": "^1.14.0", + "eslint-plugin-vue": "^9.31.0", + "eslint-plugin-yml": "^1.15.0", "eslint-processor-vue-blocks": "^0.1.2", - "globals": "^15.11.0", + "globals": "^15.12.0", "jsonc-eslint-parser": "^2.4.0", "local-pkg": "^0.5.0", "parse-gitignore": "^2.0.0", @@ -173,6 +173,19 @@ } } }, + "node_modules/@antfu/eslint-config/node_modules/globals": { + "version": "15.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.12.0.tgz", + "integrity": "sha512-1+gLErljJFhbOVyaetcwJiJ4+eLe45S2E7P5UiZ9xGfeq3ATQf5DOv9G7MH3gGbKQLkzmNh2DxfZwLdw+j6oTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@antfu/install-pkg": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/@antfu/install-pkg/-/install-pkg-0.4.1.tgz", @@ -839,9 +852,9 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz", - "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.0.tgz", + "integrity": "sha512-zdHg2FPIFNKPdcHWtiNT+jEFCHYVplAXRDlQDyqy0zGx/q2parwh7brGJSiTxRk/TSMkbM//zt/f5CHgyTyaSQ==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -878,9 +891,9 @@ } }, "node_modules/@eslint/core": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.7.0.tgz", - "integrity": "sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.9.0.tgz", + "integrity": "sha512-7ATR9F0e4W85D/0w7cU0SNj7qkAexMG+bAHEZOjo9akvGuhHE2m7umzWzfnpa0XAg5Kxc1BWmtPMV67jJ+9VUg==", "dev": true, "license": "Apache-2.0", "engines": { @@ -888,9 +901,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", - "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", + "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", "dev": true, "license": "MIT", "dependencies": { @@ -949,9 +962,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.14.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.14.0.tgz", - "integrity": "sha512-pFoEtFWCPyDOl+C6Ift+wC7Ro89otjigCf5vcuWqWgqNSQbRrpjSvdeE6ofLz4dHmyxD5f7gIdGT4+p36L6Twg==", + "version": "9.15.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.15.0.tgz", + "integrity": "sha512-tMTqrY+EzbXmKJR5ToI8lxu7jaN5EdmrBFJpQk5JmSlyLsx6o4t27r883K5xsLuCYCpfKBCGswMSWXsM+jB7lg==", "dev": true, "license": "MIT", "engines": { @@ -985,9 +998,9 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.2.tgz", - "integrity": "sha512-CXtq5nR4Su+2I47WPOlWud98Y5Lv8Kyxp2ukhgFx/eW6Blm18VXJO5WuQylPugRo8nbluoi6GvvxBLqHcvqUUw==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.3.tgz", + "integrity": "sha512-2b/g5hRmpbb1o4GnTZax9N9m0FXzz9OV42ZzI4rDDMDuHUqigAiQCEWChBWCY4ztAGVRjoWT19v0yMmc5/L5kA==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -1343,9 +1356,9 @@ } }, "node_modules/@humanwhocodes/retry": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.0.tgz", - "integrity": "sha512-xnRgu9DxZbkWak/te3fcytNyp8MTbuiZIaueg2rgEvBuN55n04nwLYLU9TX/VVlusc9L2ZNXi99nUFNkHXtr5g==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz", + "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==", "dev": true, "license": "Apache-2.0", "engines": { @@ -1471,9 +1484,9 @@ "license": "MIT" }, "node_modules/@nestjs/axios": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-3.0.3.tgz", - "integrity": "sha512-h6TCn3yJwD6OKqqqfmtRS5Zo4E46Ip2n+gK1sqwzNBC+qxQ9xpCu+ODVRFur6V3alHSCSBxb3nNtt73VEdluyA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-3.1.2.tgz", + "integrity": "sha512-pFlfi4ZQsZtTNNhvgssbxjCHUd1nMpV3sXy/xOOB2uEJhw3M8j8SFR08gjFNil2we2Har7VCsXLfCkwbMHECFQ==", "dev": true, "license": "MIT", "peerDependencies": { @@ -1483,9 +1496,9 @@ } }, "node_modules/@nestjs/common": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.4.5.tgz", - "integrity": "sha512-N/yUyuYCBMb0+H6jHhntR7PURzji0usID/DByhOfooyk/aPGscI0aQKwOA6edlJlT92hHUvXYLJ5p3npj7KcjQ==", + "version": "10.4.8", + "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.4.8.tgz", + "integrity": "sha512-PVor9dxihg3F2LMnVNkQu42vUmea2+qukkWXUSumtVKDsBo7X7jnZWXtF5bvNTcYK7IYL4/MM4awNfJVJcJpFg==", "dev": true, "license": "MIT", "dependencies": { @@ -1520,9 +1533,9 @@ "license": "0BSD" }, "node_modules/@nestjs/core": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-10.4.5.tgz", - "integrity": "sha512-wk0KJ+6tuidqAdeemsQ40BCp1BgMsSuSLG577aqXLxXYoa8FQYPrdxoSzd05znYLwJYM55fisZWb3FLF9HT2qw==", + "version": "10.4.8", + "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-10.4.8.tgz", + "integrity": "sha512-Kdi9rDZdlCkGL2AK9XuJ24bZp2YFV6dWBdogGsAHSP5u95wfnSkhduxHZy6q/i1nFFiLASUHabL8Jwr+bmD22Q==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -1580,9 +1593,9 @@ } }, "node_modules/@nestjs/mapped-types": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nestjs/mapped-types/-/mapped-types-2.0.5.tgz", - "integrity": "sha512-bSJv4pd6EY99NX9CjBIyn4TVDoSit82DUZlL4I3bqNfy5Gt+gXTa86i3I/i0iIV9P4hntcGM5GyO+FhZAhxtyg==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@nestjs/mapped-types/-/mapped-types-2.0.6.tgz", + "integrity": "sha512-84ze+CPfp1OWdpRi1/lOu59hOhTz38eVzJvRKrg9ykRFwDz+XleKfMsG0gUqNZYFa6v53XYzeD+xItt8uDW7NQ==", "dev": true, "license": "MIT", "peerDependencies": { @@ -1612,9 +1625,9 @@ } }, "node_modules/@nestjs/platform-fastify": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/@nestjs/platform-fastify/-/platform-fastify-10.4.5.tgz", - "integrity": "sha512-5kcLsloaKkG6i46qbHmz6m/XoEtwroBni3uwsNENw4OJ8fptllihOqG3PWKRfljfpH4twyKdtZfKvyjMHXNj4w==", + "version": "10.4.8", + "resolved": "https://registry.npmjs.org/@nestjs/platform-fastify/-/platform-fastify-10.4.8.tgz", + "integrity": "sha512-Z3OjsmMCbYBJMv413ITUs2RDG2IXbjcMLEdAiTB6rMjQcpY+9hquCkEZFVZWFq6qyh6GeIVR1S3Qzi0oMiGG1A==", "dev": true, "license": "MIT", "dependencies": { @@ -1653,13 +1666,13 @@ "license": "0BSD" }, "node_modules/@nestjs/platform-socket.io": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/@nestjs/platform-socket.io/-/platform-socket.io-10.4.5.tgz", - "integrity": "sha512-dHkHJQArhrpkX6qBdTW2ghuja3i3cCslwy4QHY6d46u+9UyANQlsNK9wt/lZnmXfCMaci8xAJvUpyODa6YtV7g==", + "version": "10.4.8", + "resolved": "https://registry.npmjs.org/@nestjs/platform-socket.io/-/platform-socket.io-10.4.8.tgz", + "integrity": "sha512-KzCL+P037HiaW3iODueJ/vw5a8bSr6uIturgGSuRz6c8WR+SfqKC6jNXw0JTW5NVqEqX8tOunEVXoI3MFnWz/w==", "dev": true, "license": "MIT", "dependencies": { - "socket.io": "4.7.5", + "socket.io": "4.8.0", "tslib": "2.7.0" }, "funding": { @@ -1680,18 +1693,18 @@ "license": "0BSD" }, "node_modules/@nestjs/swagger": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/@nestjs/swagger/-/swagger-7.4.2.tgz", - "integrity": "sha512-Mu6TEn1M/owIvAx2B4DUQObQXqo2028R2s9rSZ/hJEgBK95+doTwS0DjmVA2wTeZTyVtXOoN7CsoM5pONBzvKQ==", + "version": "8.0.7", + "resolved": "https://registry.npmjs.org/@nestjs/swagger/-/swagger-8.0.7.tgz", + "integrity": "sha512-zaTMCEZ/CxX7QYF110nTqJsn7eCXp4VI9kv7+AdUcIlBmhhgJpggBw2Mx2p6xVjyz1EoWXGfxxWKnxEyaQwFlg==", "dev": true, "license": "MIT", "dependencies": { "@microsoft/tsdoc": "^0.15.0", - "@nestjs/mapped-types": "2.0.5", + "@nestjs/mapped-types": "2.0.6", "js-yaml": "4.1.0", "lodash": "4.17.21", "path-to-regexp": "3.3.0", - "swagger-ui-dist": "5.17.14" + "swagger-ui-dist": "5.18.2" }, "peerDependencies": { "@fastify/static": "^6.0.0 || ^7.0.0", @@ -1714,9 +1727,9 @@ } }, "node_modules/@nestjs/websockets": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/@nestjs/websockets/-/websockets-10.4.5.tgz", - "integrity": "sha512-LbL/HRLWQUBTUPY7swojOHdvokyVGINIiuP/VmRdhob4T751r+9i09z2RqRpP71psuom9mnRHYI1+vT2FABrAw==", + "version": "10.4.8", + "resolved": "https://registry.npmjs.org/@nestjs/websockets/-/websockets-10.4.8.tgz", + "integrity": "sha512-IpObWsZvjjUxmBuIF/AkcyXrFFzwNYNsw2reZXHy7C31wJsYAjwr6rHMSRGyqsxfqTA2DqjCczorewM6BAEXig==", "dev": true, "license": "MIT", "dependencies": { @@ -1878,9 +1891,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.24.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.24.3.tgz", - "integrity": "sha512-ufb2CH2KfBWPJok95frEZZ82LtDl0A6QKTa8MoM+cWwDZvVGl5/jNb79pIhRvAalUu+7LD91VYR0nwRD799HkQ==", + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.26.0.tgz", + "integrity": "sha512-gJNwtPDGEaOEgejbaseY6xMFu+CPltsc8/T+diUTTbOQLqD+bnrJq9ulH6WD69TqwqWmrfRAtUv30cCFZlbGTQ==", "cpu": [ "arm" ], @@ -1892,9 +1905,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.24.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.24.3.tgz", - "integrity": "sha512-iAHpft/eQk9vkWIV5t22V77d90CRofgR2006UiCjHcHJFVI1E0oBkQIAbz+pLtthFw3hWEmVB4ilxGyBf48i2Q==", + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.26.0.tgz", + "integrity": "sha512-YJa5Gy8mEZgz5JquFruhJODMq3lTHWLm1fOy+HIANquLzfIOzE9RA5ie3JjCdVb9r46qfAQY/l947V0zfGJ0OQ==", "cpu": [ "arm64" ], @@ -1906,9 +1919,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.24.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.24.3.tgz", - "integrity": "sha512-QPW2YmkWLlvqmOa2OwrfqLJqkHm7kJCIMq9kOz40Zo9Ipi40kf9ONG5Sz76zszrmIZZ4hgRIkez69YnTHgEz1w==", + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.26.0.tgz", + "integrity": "sha512-ErTASs8YKbqTBoPLp/kA1B1Um5YSom8QAc4rKhg7b9tyyVqDBlQxy7Bf2wW7yIlPGPg2UODDQcbkTlruPzDosw==", "cpu": [ "arm64" ], @@ -1920,9 +1933,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.24.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.24.3.tgz", - "integrity": "sha512-KO0pN5x3+uZm1ZXeIfDqwcvnQ9UEGN8JX5ufhmgH5Lz4ujjZMAnxQygZAVGemFWn+ZZC0FQopruV4lqmGMshow==", + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.26.0.tgz", + "integrity": "sha512-wbgkYDHcdWW+NqP2mnf2NOuEbOLzDblalrOWcPyY6+BRbVhliavon15UploG7PpBRQ2bZJnbmh8o3yLoBvDIHA==", "cpu": [ "x64" ], @@ -1934,9 +1947,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.24.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.24.3.tgz", - "integrity": "sha512-CsC+ZdIiZCZbBI+aRlWpYJMSWvVssPuWqrDy/zi9YfnatKKSLFCe6fjna1grHuo/nVaHG+kiglpRhyBQYRTK4A==", + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.26.0.tgz", + "integrity": "sha512-Y9vpjfp9CDkAG4q/uwuhZk96LP11fBz/bYdyg9oaHYhtGZp7NrbkQrj/66DYMMP2Yo/QPAsVHkV891KyO52fhg==", "cpu": [ "arm64" ], @@ -1948,9 +1961,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.24.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.24.3.tgz", - "integrity": "sha512-F0nqiLThcfKvRQhZEzMIXOQG4EeX61im61VYL1jo4eBxv4aZRmpin6crnBJQ/nWnCsjH5F6J3W6Stdm0mBNqBg==", + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.26.0.tgz", + "integrity": "sha512-A/jvfCZ55EYPsqeaAt/yDAG4q5tt1ZboWMHEvKAH9Zl92DWvMIbnZe/f/eOXze65aJaaKbL+YeM0Hz4kLQvdwg==", "cpu": [ "x64" ], @@ -1962,9 +1975,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.24.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.24.3.tgz", - "integrity": "sha512-KRSFHyE/RdxQ1CSeOIBVIAxStFC/hnBgVcaiCkQaVC+EYDtTe4X7z5tBkFyRoBgUGtB6Xg6t9t2kulnX6wJc6A==", + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.26.0.tgz", + "integrity": "sha512-paHF1bMXKDuizaMODm2bBTjRiHxESWiIyIdMugKeLnjuS1TCS54MF5+Y5Dx8Ui/1RBPVRE09i5OUlaLnv8OGnA==", "cpu": [ "arm" ], @@ -1976,9 +1989,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.24.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.24.3.tgz", - "integrity": "sha512-h6Q8MT+e05zP5BxEKz0vi0DhthLdrNEnspdLzkoFqGwnmOzakEHSlXfVyA4HJ322QtFy7biUAVFPvIDEDQa6rw==", + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.26.0.tgz", + "integrity": "sha512-cwxiHZU1GAs+TMxvgPfUDtVZjdBdTsQwVnNlzRXC5QzIJ6nhfB4I1ahKoe9yPmoaA/Vhf7m9dB1chGPpDRdGXg==", "cpu": [ "arm" ], @@ -1990,9 +2003,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.24.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.24.3.tgz", - "integrity": "sha512-fKElSyXhXIJ9pqiYRqisfirIo2Z5pTTve5K438URf08fsypXrEkVmShkSfM8GJ1aUyvjakT+fn2W7Czlpd/0FQ==", + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.26.0.tgz", + "integrity": "sha512-4daeEUQutGRCW/9zEo8JtdAgtJ1q2g5oHaoQaZbMSKaIWKDQwQ3Yx0/3jJNmpzrsScIPtx/V+1AfibLisb3AMQ==", "cpu": [ "arm64" ], @@ -2004,9 +2017,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.24.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.24.3.tgz", - "integrity": "sha512-YlddZSUk8G0px9/+V9PVilVDC6ydMz7WquxozToozSnfFK6wa6ne1ATUjUvjin09jp34p84milxlY5ikueoenw==", + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.26.0.tgz", + "integrity": "sha512-eGkX7zzkNxvvS05ROzJ/cO/AKqNvR/7t1jA3VZDi2vRniLKwAWxUr85fH3NsvtxU5vnUUKFHKh8flIBdlo2b3Q==", "cpu": [ "arm64" ], @@ -2018,9 +2031,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.24.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.24.3.tgz", - "integrity": "sha512-yNaWw+GAO8JjVx3s3cMeG5Esz1cKVzz8PkTJSfYzE5u7A+NvGmbVFEHP+BikTIyYWuz0+DX9kaA3pH9Sqxp69g==", + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.26.0.tgz", + "integrity": "sha512-Odp/lgHbW/mAqw/pU21goo5ruWsytP7/HCC/liOt0zcGG0llYWKrd10k9Fj0pdj3prQ63N5yQLCLiE7HTX+MYw==", "cpu": [ "ppc64" ], @@ -2032,9 +2045,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.24.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.24.3.tgz", - "integrity": "sha512-lWKNQfsbpv14ZCtM/HkjCTm4oWTKTfxPmr7iPfp3AHSqyoTz5AgLemYkWLwOBWc+XxBbrU9SCokZP0WlBZM9lA==", + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.26.0.tgz", + "integrity": "sha512-MBR2ZhCTzUgVD0OJdTzNeF4+zsVogIR1U/FsyuFerwcqjZGvg2nYe24SAHp8O5sN8ZkRVbHwlYeHqcSQ8tcYew==", "cpu": [ "riscv64" ], @@ -2046,9 +2059,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.24.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.24.3.tgz", - "integrity": "sha512-HoojGXTC2CgCcq0Woc/dn12wQUlkNyfH0I1ABK4Ni9YXyFQa86Fkt2Q0nqgLfbhkyfQ6003i3qQk9pLh/SpAYw==", + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.26.0.tgz", + "integrity": "sha512-YYcg8MkbN17fMbRMZuxwmxWqsmQufh3ZJFxFGoHjrE7bv0X+T6l3glcdzd7IKLiwhT+PZOJCblpnNlz1/C3kGQ==", "cpu": [ "s390x" ], @@ -2060,9 +2073,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.24.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.24.3.tgz", - "integrity": "sha512-mnEOh4iE4USSccBOtcrjF5nj+5/zm6NcNhbSEfR3Ot0pxBwvEn5QVUXcuOwwPkapDtGZ6pT02xLoPaNv06w7KQ==", + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.26.0.tgz", + "integrity": "sha512-ZuwpfjCwjPkAOxpjAEjabg6LRSfL7cAJb6gSQGZYjGhadlzKKywDkCUnJ+KEfrNY1jH5EEoSIKLCb572jSiglA==", "cpu": [ "x64" ], @@ -2074,9 +2087,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.24.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.24.3.tgz", - "integrity": "sha512-rMTzawBPimBQkG9NKpNHvquIUTQPzrnPxPbCY1Xt+mFkW7pshvyIS5kYgcf74goxXOQk0CP3EoOC1zcEezKXhw==", + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.26.0.tgz", + "integrity": "sha512-+HJD2lFS86qkeF8kNu0kALtifMpPCZU80HvwztIKnYwym3KnA1os6nsX4BGSTLtS2QVAGG1P3guRgsYyMA0Yhg==", "cpu": [ "x64" ], @@ -2088,9 +2101,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.24.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.24.3.tgz", - "integrity": "sha512-2lg1CE305xNvnH3SyiKwPVsTVLCg4TmNCF1z7PSHX2uZY2VbUpdkgAllVoISD7JO7zu+YynpWNSKAtOrX3AiuA==", + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.26.0.tgz", + "integrity": "sha512-WUQzVFWPSw2uJzX4j6YEbMAiLbs0BUysgysh8s817doAYhR5ybqTI1wtKARQKo6cGop3pHnrUJPFCsXdoFaimQ==", "cpu": [ "arm64" ], @@ -2102,9 +2115,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.24.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.24.3.tgz", - "integrity": "sha512-9SjYp1sPyxJsPWuhOCX6F4jUMXGbVVd5obVpoVEi8ClZqo52ViZewA6eFz85y8ezuOA+uJMP5A5zo6Oz4S5rVQ==", + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.26.0.tgz", + "integrity": "sha512-D4CxkazFKBfN1akAIY6ieyOqzoOoBV1OICxgUblWxff/pSjCA2khXlASUx7mK6W1oP4McqhgcCsu6QaLj3WMWg==", "cpu": [ "ia32" ], @@ -2116,9 +2129,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.24.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.24.3.tgz", - "integrity": "sha512-HGZgRFFYrMrP3TJlq58nR1xy8zHKId25vhmm5S9jETEfDf6xybPxsavFTJaufe2zgOGYJBskGlj49CwtEuFhWQ==", + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.26.0.tgz", + "integrity": "sha512-2x8MO1rm4PGEP0xWbubJW5RtbNLk3puzAMaLQd3B3JHVw4KcHlmXcO+Wewx9zCoo7EUFiMlu/aZbCJ7VjMzAag==", "cpu": [ "x64" ], @@ -2129,6 +2142,14 @@ "win32" ] }, + "node_modules/@scarf/scarf": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@scarf/scarf/-/scarf-1.4.0.tgz", + "integrity": "sha512-xxeapPiUXdZAE3che6f3xogoJPeZgig6omHEy1rIY5WVsB3H2BHNnZH+gHG6x91SCWyQCzWGsuL2Hh3ClO5/qQ==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0" + }, "node_modules/@serialport/binding-mock": { "version": "10.2.2", "resolved": "https://registry.npmjs.org/@serialport/binding-mock/-/binding-mock-10.2.2.tgz", @@ -2737,17 +2758,17 @@ "optional": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.12.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.12.2.tgz", - "integrity": "sha512-gQxbxM8mcxBwaEmWdtLCIGLfixBMHhQjBqR8sVWNTPpcj45WlYL2IObS/DNMLH1DBP0n8qz+aiiLTGfopPEebw==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.14.0.tgz", + "integrity": "sha512-tqp8H7UWFaZj0yNO6bycd5YjMwxa6wIHOLZvWPkidwbgLCsBMetQoGj7DPuAlWa2yGO3H48xmPwjhsSPPCGU5w==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.12.2", - "@typescript-eslint/type-utils": "8.12.2", - "@typescript-eslint/utils": "8.12.2", - "@typescript-eslint/visitor-keys": "8.12.2", + "@typescript-eslint/scope-manager": "8.14.0", + "@typescript-eslint/type-utils": "8.14.0", + "@typescript-eslint/utils": "8.14.0", + "@typescript-eslint/visitor-keys": "8.14.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -2771,16 +2792,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.12.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.12.2.tgz", - "integrity": "sha512-MrvlXNfGPLH3Z+r7Tk+Z5moZAc0dzdVjTgUgwsdGweH7lydysQsnSww3nAmsq8blFuRD5VRlAr9YdEFw3e6PBw==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.14.0.tgz", + "integrity": "sha512-2p82Yn9juUJq0XynBXtFCyrBDb6/dJombnz6vbo6mgQEtWHfvHbQuEa9kAOVIt1c9YFwi7H6WxtPj1kg+80+RA==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "8.12.2", - "@typescript-eslint/types": "8.12.2", - "@typescript-eslint/typescript-estree": "8.12.2", - "@typescript-eslint/visitor-keys": "8.12.2", + "@typescript-eslint/scope-manager": "8.14.0", + "@typescript-eslint/types": "8.14.0", + "@typescript-eslint/typescript-estree": "8.14.0", + "@typescript-eslint/visitor-keys": "8.14.0", "debug": "^4.3.4" }, "engines": { @@ -2800,14 +2821,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.12.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.12.2.tgz", - "integrity": "sha512-gPLpLtrj9aMHOvxJkSbDBmbRuYdtiEbnvO25bCMza3DhMjTQw0u7Y1M+YR5JPbMsXXnSPuCf5hfq0nEkQDL/JQ==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.14.0.tgz", + "integrity": "sha512-aBbBrnW9ARIDn92Zbo7rguLnqQ/pOrUguVpbUwzOhkFg2npFDwTgPGqFqE0H5feXcOoJOfX3SxlJaKEVtq54dw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.12.2", - "@typescript-eslint/visitor-keys": "8.12.2" + "@typescript-eslint/types": "8.14.0", + "@typescript-eslint/visitor-keys": "8.14.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2818,14 +2839,14 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.12.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.12.2.tgz", - "integrity": "sha512-bwuU4TAogPI+1q/IJSKuD4shBLc/d2vGcRT588q+jzayQyjVK2X6v/fbR4InY2U2sgf8MEvVCqEWUzYzgBNcGQ==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.14.0.tgz", + "integrity": "sha512-Xcz9qOtZuGusVOH5Uk07NGs39wrKkf3AxlkK79RBK6aJC1l03CobXjJbwBPSidetAOV+5rEVuiT1VSBUOAsanQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.12.2", - "@typescript-eslint/utils": "8.12.2", + "@typescript-eslint/typescript-estree": "8.14.0", + "@typescript-eslint/utils": "8.14.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -2843,9 +2864,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.12.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.12.2.tgz", - "integrity": "sha512-VwDwMF1SZ7wPBUZwmMdnDJ6sIFk4K4s+ALKLP6aIQsISkPv8jhiw65sAK6SuWODN/ix+m+HgbYDkH+zLjrzvOA==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.14.0.tgz", + "integrity": "sha512-yjeB9fnO/opvLJFAsPNYlKPnEM8+z4og09Pk504dkqonT02AyL5Z9SSqlE0XqezS93v6CXn49VHvB2G7XSsl0g==", "dev": true, "license": "MIT", "engines": { @@ -2857,14 +2878,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.12.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.12.2.tgz", - "integrity": "sha512-mME5MDwGe30Pq9zKPvyduyU86PH7aixwqYR2grTglAdB+AN8xXQ1vFGpYaUSJ5o5P/5znsSBeNcs5g5/2aQwow==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.14.0.tgz", + "integrity": "sha512-OPXPLYKGZi9XS/49rdaCbR5j/S14HazviBlUQFvSKz3npr3NikF+mrgK7CFVur6XEt95DZp/cmke9d5i3vtVnQ==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "8.12.2", - "@typescript-eslint/visitor-keys": "8.12.2", + "@typescript-eslint/types": "8.14.0", + "@typescript-eslint/visitor-keys": "8.14.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -2886,16 +2907,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.12.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.12.2.tgz", - "integrity": "sha512-UTTuDIX3fkfAz6iSVa5rTuSfWIYZ6ATtEocQ/umkRSyC9O919lbZ8dcH7mysshrCdrAM03skJOEYaBugxN+M6A==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.14.0.tgz", + "integrity": "sha512-OGqj6uB8THhrHj0Fk27DcHPojW7zKwKkPmHXHvQ58pLYp4hy8CSUdTKykKeh+5vFqTTVmjz0zCOOPKRovdsgHA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.12.2", - "@typescript-eslint/types": "8.12.2", - "@typescript-eslint/typescript-estree": "8.12.2" + "@typescript-eslint/scope-manager": "8.14.0", + "@typescript-eslint/types": "8.14.0", + "@typescript-eslint/typescript-estree": "8.14.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2909,13 +2930,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.12.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.12.2.tgz", - "integrity": "sha512-PChz8UaKQAVNHghsHcPyx1OMHoFRUEA7rJSK/mDhdq85bk+PLsUHUBqTQTFt18VJZbmxBovM65fezlheQRsSDA==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.14.0.tgz", + "integrity": "sha512-vG0XZo8AdTH9OE6VFRwAZldNc7qtJ/6NLGWak+BtENuEUXGZgFpihILPiBvKXvJ2nFu27XNGC6rKiwuaoMbYzQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.12.2", + "@typescript-eslint/types": "8.14.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -2947,9 +2968,9 @@ "license": "ISC" }, "node_modules/@vitest/coverage-v8": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-2.1.4.tgz", - "integrity": "sha512-FPKQuJfR6VTfcNMcGpqInmtJuVXFSCd9HQltYncfR01AzXhLucMEtQ5SinPdZxsT5x/5BK7I5qFJ5/ApGCmyTQ==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-2.1.5.tgz", + "integrity": "sha512-/RoopB7XGW7UEkUndRXF87A9CwkoZAJW01pj8/3pgmDVsjMH2IKy6H1A38po9tmUlwhSyYs0az82rbKd9Yaynw==", "dev": true, "license": "MIT", "dependencies": { @@ -2962,7 +2983,7 @@ "istanbul-reports": "^3.1.7", "magic-string": "^0.30.12", "magicast": "^0.3.5", - "std-env": "^3.7.0", + "std-env": "^3.8.0", "test-exclude": "^7.0.1", "tinyrainbow": "^1.2.0" }, @@ -2970,8 +2991,8 @@ "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "@vitest/browser": "2.1.4", - "vitest": "2.1.4" + "@vitest/browser": "2.1.5", + "vitest": "2.1.5" }, "peerDependenciesMeta": { "@vitest/browser": { @@ -2980,9 +3001,9 @@ } }, "node_modules/@vitest/eslint-plugin": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/@vitest/eslint-plugin/-/eslint-plugin-1.1.7.tgz", - "integrity": "sha512-pTWGW3y6lH2ukCuuffpan6kFxG6nIuoesbhMiQxskyQMRcCN5t9SXsKrNHvEw3p8wcCsgJoRqFZVkOTn6TjclA==", + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/@vitest/eslint-plugin/-/eslint-plugin-1.1.10.tgz", + "integrity": "sha512-uScH5Kz5v32vvtQYB2iodpoPg2mGASK+VKpjlc2IUgE0+16uZKqVKi2vQxjxJ6sMCQLBs4xhBFZlmZBszsmfKQ==", "dev": true, "license": "MIT", "peerDependencies": { @@ -3001,14 +3022,14 @@ } }, "node_modules/@vitest/expect": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.4.tgz", - "integrity": "sha512-DOETT0Oh1avie/D/o2sgMHGrzYUFFo3zqESB2Hn70z6QB1HrS2IQ9z5DfyTqU8sg4Bpu13zZe9V4+UTNQlUeQA==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.5.tgz", + "integrity": "sha512-nZSBTW1XIdpZvEJyoP/Sy8fUg0b8od7ZpGDkTUcfJ7wz/VoZAFzFfLyxVxGFhUjJzhYqSbIpfMtl/+k/dpWa3Q==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "2.1.4", - "@vitest/utils": "2.1.4", + "@vitest/spy": "2.1.5", + "@vitest/utils": "2.1.5", "chai": "^5.1.2", "tinyrainbow": "^1.2.0" }, @@ -3017,13 +3038,13 @@ } }, "node_modules/@vitest/mocker": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.4.tgz", - "integrity": "sha512-Ky/O1Lc0QBbutJdW0rqLeFNbuLEyS+mIPiNdlVlp2/yhJ0SbyYqObS5IHdhferJud8MbbwMnexg4jordE5cCoQ==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.5.tgz", + "integrity": "sha512-XYW6l3UuBmitWqSUXTNXcVBUCRytDogBsWuNXQijc00dtnU/9OqpXWp4OJroVrad/gLIomAq9aW8yWDBtMthhQ==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "2.1.4", + "@vitest/spy": "2.1.5", "estree-walker": "^3.0.3", "magic-string": "^0.30.12" }, @@ -3054,9 +3075,9 @@ } }, "node_modules/@vitest/pretty-format": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.4.tgz", - "integrity": "sha512-L95zIAkEuTDbUX1IsjRl+vyBSLh3PwLLgKpghl37aCK9Jvw0iP+wKwIFhfjdUtA2myLgjrG6VU6JCFLv8q/3Ww==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.5.tgz", + "integrity": "sha512-4ZOwtk2bqG5Y6xRGHcveZVr+6txkH7M2e+nPFd6guSoN638v/1XQ0K06eOpi0ptVU/2tW/pIU4IoPotY/GZ9fw==", "dev": true, "license": "MIT", "dependencies": { @@ -3067,13 +3088,13 @@ } }, "node_modules/@vitest/runner": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.4.tgz", - "integrity": "sha512-sKRautINI9XICAMl2bjxQM8VfCMTB0EbsBc/EDFA57V6UQevEKY/TOPOF5nzcvCALltiLfXWbq4MaAwWx/YxIA==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.5.tgz", + "integrity": "sha512-pKHKy3uaUdh7X6p1pxOkgkVAFW7r2I818vHDthYLvUyjRfkKOU6P45PztOch4DZarWQne+VOaIMwA/erSSpB9g==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/utils": "2.1.4", + "@vitest/utils": "2.1.5", "pathe": "^1.1.2" }, "funding": { @@ -3081,13 +3102,13 @@ } }, "node_modules/@vitest/snapshot": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.4.tgz", - "integrity": "sha512-3Kab14fn/5QZRog5BPj6Rs8dc4B+mim27XaKWFWHWA87R56AKjHTGcBFKpvZKDzC4u5Wd0w/qKsUIio3KzWW4Q==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.5.tgz", + "integrity": "sha512-zmYw47mhfdfnYbuhkQvkkzYroXUumrwWDGlMjpdUr4jBd3HZiV2w7CQHj+z7AAS4VOtWxI4Zt4bWt4/sKcoIjg==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "2.1.4", + "@vitest/pretty-format": "2.1.5", "magic-string": "^0.30.12", "pathe": "^1.1.2" }, @@ -3096,9 +3117,9 @@ } }, "node_modules/@vitest/spy": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.4.tgz", - "integrity": "sha512-4JOxa+UAizJgpZfaCPKK2smq9d8mmjZVPMt2kOsg/R8QkoRzydHH1qHxIYNvr1zlEaFj4SXiaaJWxq/LPLKaLg==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.5.tgz", + "integrity": "sha512-aWZF3P0r3w6DiYTVskOYuhBc7EMc3jvn1TkBg8ttylFFRqNN2XGD7V5a4aQdk6QiUzZQ4klNBSpCLJgWNdIiNw==", "dev": true, "license": "MIT", "dependencies": { @@ -3109,13 +3130,13 @@ } }, "node_modules/@vitest/utils": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.4.tgz", - "integrity": "sha512-MXDnZn0Awl2S86PSNIim5PWXgIAx8CIkzu35mBdSApUip6RFOGXBCf3YFyeEu8n1IHk4bWD46DeYFu9mQlFIRg==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.5.tgz", + "integrity": "sha512-yfj6Yrp0Vesw2cwJbP+cl04OC+IHFsuQsrsJBL9pyGeQXE56v1UAOQco+SR55Vf1nQzfV0QJg1Qum7AaWUwwYg==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "2.1.4", + "@vitest/pretty-format": "2.1.5", "loupe": "^3.1.2", "tinyrainbow": "^1.2.0" }, @@ -4314,9 +4335,9 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "devOptional": true, "license": "MIT", "dependencies": { @@ -4722,9 +4743,9 @@ } }, "node_modules/engine.io": { - "version": "6.5.5", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.5.5.tgz", - "integrity": "sha512-C5Pn8Wk+1vKBoHghJODM63yk8MvrO9EWZUfkAt5HAqIgPE4/8FF0PEGHXtEd40l223+cE5ABWuPzm38PHFXfMA==", + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.6.2.tgz", + "integrity": "sha512-gmNvsYi9C8iErnZdVcJnvCpSKbWTt1E8+JZo8b+daLninywUWi5NQ5STSHZ9rFjFO7imNcvb8Pc5pe/wMR5xEw==", "dev": true, "license": "MIT", "dependencies": { @@ -4733,7 +4754,7 @@ "@types/node": ">=10.0.0", "accepts": "~1.3.4", "base64id": "2.0.0", - "cookie": "~0.4.1", + "cookie": "~0.7.2", "cors": "~2.8.5", "debug": "~4.3.1", "engine.io-parser": "~5.2.1", @@ -4753,16 +4774,6 @@ "node": ">=10.0.0" } }, - "node_modules/engine.io/node_modules/cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, "node_modules/engine.io/node_modules/ws": { "version": "8.17.1", "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", @@ -4940,27 +4951,27 @@ } }, "node_modules/eslint": { - "version": "9.14.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.14.0.tgz", - "integrity": "sha512-c2FHsVBr87lnUtjP4Yhvk4yEhKrQavGafRA/Se1ouse8PfbfC/Qh9Mxa00yWsZRlqeUB9raXip0aiiUZkgnr9g==", + "version": "9.15.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.15.0.tgz", + "integrity": "sha512-7CrWySmIibCgT1Os28lUU6upBshZ+GxybLOrmRzi08kS8MBuO8QA7pXEgYgY5W8vK3e74xv0lpjo9DbaGU9Rkw==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.18.0", - "@eslint/core": "^0.7.0", - "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.14.0", - "@eslint/plugin-kit": "^0.2.0", + "@eslint/config-array": "^0.19.0", + "@eslint/core": "^0.9.0", + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "9.15.0", + "@eslint/plugin-kit": "^0.2.3", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.4.0", + "@humanwhocodes/retry": "^0.4.1", "@types/estree": "^1.0.6", "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.5", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^8.2.0", @@ -4979,8 +4990,7 @@ "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" @@ -5084,6 +5094,28 @@ "ms": "^2.1.1" } }, + "node_modules/eslint-json-compat-utils": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/eslint-json-compat-utils/-/eslint-json-compat-utils-0.2.1.tgz", + "integrity": "sha512-YzEodbDyW8DX8bImKhAcCeu/L31Dd/70Bidx2Qex9OFUtgzXLqtfWL4Hr5fM/aCCB8QUZLuJur0S9k6UfgFkfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "esquery": "^1.6.0" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "eslint": "*", + "jsonc-eslint-parser": "^2.4.0" + }, + "peerDependenciesMeta": { + "@eslint/json": { + "optional": true + } + } + }, "node_modules/eslint-merge-processors": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/eslint-merge-processors/-/eslint-merge-processors-0.1.0.tgz", @@ -5181,9 +5213,9 @@ } }, "node_modules/eslint-plugin-import-x": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-4.4.0.tgz", - "integrity": "sha512-me58aWTjdkPtgmOzPe+uP0bebpN5etH4bJRnYzy85Rn9g/3QyASg6kTCqdwNzyaJRqMI2ii2o8s01P2LZpREHg==", + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-4.4.2.tgz", + "integrity": "sha512-mDRXPSLQ0UQZQw91QdG4/qZT6hgeW2MJTczAbgPseUZuPEtIjjdPOolXroRkulnOn3fzj6gNgvk+wchMJiHElg==", "dev": true, "license": "MIT", "dependencies": { @@ -5206,9 +5238,9 @@ } }, "node_modules/eslint-plugin-jsdoc": { - "version": "50.4.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-50.4.3.tgz", - "integrity": "sha512-uWtwFxGRv6B8sU63HZM5dAGDhgsatb+LONwmILZJhdRALLOkCX2HFZhdL/Kw2ls8SQMAVEfK+LmnEfxInRN8HA==", + "version": "50.5.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-50.5.0.tgz", + "integrity": "sha512-xTkshfZrUbiSHXBwZ/9d5ulZ2OcHXxSvm/NPo494H/hadLRJwOq5PMV0EUpMqsb9V+kQo+9BAgi6Z7aJtdBp2A==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -5247,14 +5279,15 @@ } }, "node_modules/eslint-plugin-jsonc": { - "version": "2.16.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsonc/-/eslint-plugin-jsonc-2.16.0.tgz", - "integrity": "sha512-Af/ZL5mgfb8FFNleH6KlO4/VdmDuTqmM+SPnWcdoWywTetv7kq+vQe99UyQb9XO3b0OWLVuTH7H0d/PXYCMdSg==", + "version": "2.18.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsonc/-/eslint-plugin-jsonc-2.18.1.tgz", + "integrity": "sha512-6qY8zDpxOwPQNcr8eZ+RxwGX6IPHws5/Qef7aBEjER8rB9+UMB6zQWVIVcbP7xzFmEMHAesNFPe/sIlU4c78dg==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "eslint-compat-utils": "^0.5.0", + "eslint-compat-utils": "^0.6.0", + "eslint-json-compat-utils": "^0.2.1", "espree": "^9.6.1", "graphemer": "^1.4.0", "jsonc-eslint-parser": "^2.0.4", @@ -5271,6 +5304,22 @@ "eslint": ">=6.0.0" } }, + "node_modules/eslint-plugin-jsonc/node_modules/eslint-compat-utils": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.6.0.tgz", + "integrity": "sha512-1vVBdI/HLS6HTHVQCJGlN+LOF0w1Rs/WB9se23mQr84cRM0iMM8PulMFFhQdQ1BvS0cGwjpis4xziI91Rk0l6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + } + }, "node_modules/eslint-plugin-jsonc/node_modules/eslint-visitor-keys": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", @@ -5316,13 +5365,13 @@ } }, "node_modules/eslint-plugin-n": { - "version": "17.12.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-17.12.0.tgz", - "integrity": "sha512-zNAtz/erDn0v78bIY3MASSQlyaarV4IOTvP5ldHsqblRFrXriikB6ghkDTkHjUad+nMRrIbOy9euod2azjRfBg==", + "version": "17.13.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-17.13.1.tgz", + "integrity": "sha512-97qzhk1z3DdSJNCqT45EslwCu5+LB9GDadSyBItgKUfGsXAmN/aa7LRQ0ZxHffUxUzvgbTPJL27/pE9ZQWHy7A==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", + "@eslint-community/eslint-utils": "^4.4.1", "enhanced-resolve": "^5.17.1", "eslint-plugin-es-x": "^7.8.0", "get-tsconfig": "^4.8.1", @@ -5483,9 +5532,9 @@ } }, "node_modules/eslint-plugin-vue": { - "version": "9.30.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.30.0.tgz", - "integrity": "sha512-CyqlRgShvljFkOeYK8wN5frh/OGTvkj1S7wlr2Q2pUvwq+X5VYiLd6ZjujpgSgLnys2W8qrBLkXQ41SUYaoPIQ==", + "version": "9.31.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.31.0.tgz", + "integrity": "sha512-aYMUCgivhz1o4tLkRHj5oq9YgYPM4/EJc0M7TAKRLCUA5OYxRLAhYEVD2nLtTwLyixEFI+/QXSvKU9ESZFgqjQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6775,9 +6824,9 @@ } }, "node_modules/homebridge-config-ui-x": { - "version": "4.62.0", - "resolved": "https://registry.npmjs.org/homebridge-config-ui-x/-/homebridge-config-ui-x-4.62.0.tgz", - "integrity": "sha512-f1k7m90EqGUnHPN8Jo3UhXlVEMN2brJJO8KkysxTU8Wk9qwO2VmE957JJ0LWflQRlgJCMn/iaDW5zt5bR3dkWg==", + "version": "4.63.0", + "resolved": "https://registry.npmjs.org/homebridge-config-ui-x/-/homebridge-config-ui-x-4.63.0.tgz", + "integrity": "sha512-l5X0/dhqDIv7UKsmatimD4wd1MbKYBE3ooxjBlRNaoD69c1qS/phzVCbu91sUvx+K8hfEz4utkAYmARwXWcdSQ==", "dev": true, "funding": [ { @@ -6796,15 +6845,15 @@ "@fastify/static": "7.0.4", "@homebridge/hap-client": "1.10.2", "@homebridge/node-pty-prebuilt-multiarch": "0.11.14", - "@nestjs/axios": "3.0.3", - "@nestjs/common": "10.4.5", - "@nestjs/core": "10.4.5", + "@nestjs/axios": "3.1.2", + "@nestjs/common": "10.4.8", + "@nestjs/core": "10.4.8", "@nestjs/jwt": "10.2.0", "@nestjs/passport": "10.0.3", - "@nestjs/platform-fastify": "10.4.5", - "@nestjs/platform-socket.io": "10.4.5", - "@nestjs/swagger": "7.4.2", - "@nestjs/websockets": "10.4.5", + "@nestjs/platform-fastify": "10.4.8", + "@nestjs/platform-socket.io": "10.4.8", + "@nestjs/swagger": "8.0.7", + "@nestjs/websockets": "10.4.8", "axios": "1.7.7", "bash-color": "0.0.4", "buffer-shims": "1.0.0", @@ -9433,14 +9482,14 @@ } }, "node_modules/node-switchbot": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/node-switchbot/-/node-switchbot-3.3.0.tgz", - "integrity": "sha512-a6uf/EPEkkyYe74IVvPygo3av4JTPkvK5lScfuJRa1Cf1Dnqm78+UCDPaD3V7pToMMS7mM4AYZEWET5UgND0Rg==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/node-switchbot/-/node-switchbot-3.4.0.tgz", + "integrity": "sha512-Fl5l/MXlZMQKZkflAvoQB7vhLos/EAYmG0uEbckD5L/QX1dIwEL7j6nZjmKmdqhCyGSKqapUN7v1AOfSvMbVqA==", "license": "MIT", "dependencies": { "@stoprocent/noble": "^1.15.1", "async-mutex": "^0.5.0", - "undici": "^6.20.1" + "undici": "^6.21.0" }, "engines": { "node": "^20 || ^22" @@ -10947,9 +10996,9 @@ } }, "node_modules/rollup": { - "version": "4.24.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.24.3.tgz", - "integrity": "sha512-HBW896xR5HGmoksbi3JBDtmVzWiPAYqp7wip50hjQ67JbDz61nyoMPdqu1DvVW9asYb2M65Z20ZHsyJCMqMyDg==", + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.26.0.tgz", + "integrity": "sha512-ilcl12hnWonG8f+NxU6BlgysVA0gvY2l8N0R84S1HcINbW20bvwuCngJkkInV6LXhwRpucsW5k1ovDwEdBVrNg==", "dev": true, "license": "MIT", "dependencies": { @@ -10963,24 +11012,24 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.24.3", - "@rollup/rollup-android-arm64": "4.24.3", - "@rollup/rollup-darwin-arm64": "4.24.3", - "@rollup/rollup-darwin-x64": "4.24.3", - "@rollup/rollup-freebsd-arm64": "4.24.3", - "@rollup/rollup-freebsd-x64": "4.24.3", - "@rollup/rollup-linux-arm-gnueabihf": "4.24.3", - "@rollup/rollup-linux-arm-musleabihf": "4.24.3", - "@rollup/rollup-linux-arm64-gnu": "4.24.3", - "@rollup/rollup-linux-arm64-musl": "4.24.3", - "@rollup/rollup-linux-powerpc64le-gnu": "4.24.3", - "@rollup/rollup-linux-riscv64-gnu": "4.24.3", - "@rollup/rollup-linux-s390x-gnu": "4.24.3", - "@rollup/rollup-linux-x64-gnu": "4.24.3", - "@rollup/rollup-linux-x64-musl": "4.24.3", - "@rollup/rollup-win32-arm64-msvc": "4.24.3", - "@rollup/rollup-win32-ia32-msvc": "4.24.3", - "@rollup/rollup-win32-x64-msvc": "4.24.3", + "@rollup/rollup-android-arm-eabi": "4.26.0", + "@rollup/rollup-android-arm64": "4.26.0", + "@rollup/rollup-darwin-arm64": "4.26.0", + "@rollup/rollup-darwin-x64": "4.26.0", + "@rollup/rollup-freebsd-arm64": "4.26.0", + "@rollup/rollup-freebsd-x64": "4.26.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.26.0", + "@rollup/rollup-linux-arm-musleabihf": "4.26.0", + "@rollup/rollup-linux-arm64-gnu": "4.26.0", + "@rollup/rollup-linux-arm64-musl": "4.26.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.26.0", + "@rollup/rollup-linux-riscv64-gnu": "4.26.0", + "@rollup/rollup-linux-s390x-gnu": "4.26.0", + "@rollup/rollup-linux-x64-gnu": "4.26.0", + "@rollup/rollup-linux-x64-musl": "4.26.0", + "@rollup/rollup-win32-arm64-msvc": "4.26.0", + "@rollup/rollup-win32-ia32-msvc": "4.26.0", + "@rollup/rollup-win32-x64-msvc": "4.26.0", "fsevents": "~2.3.2" } }, @@ -11440,9 +11489,9 @@ "license": "ISC" }, "node_modules/socket.io": { - "version": "4.7.5", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.7.5.tgz", - "integrity": "sha512-DmeAkF6cwM9jSfmp6Dr/5/mfMwb5Z5qRrSXLpo3Fq5SqyU8CMF15jIN4ZhfSwu35ksM1qmHZDQ/DK5XTccSTvA==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.8.0.tgz", + "integrity": "sha512-8U6BEgGjQOfGz3HHTYaC/L1GaxDCJ/KM0XTkJly0EhZ5U/du9uNEZy4ZgYzEzIqlx2CMm25CrCqr1ck899eLNA==", "dev": true, "license": "MIT", "dependencies": { @@ -11450,7 +11499,7 @@ "base64id": "~2.0.0", "cors": "~2.8.5", "debug": "~4.3.2", - "engine.io": "~6.5.2", + "engine.io": "~6.6.0", "socket.io-adapter": "~2.5.2", "socket.io-parser": "~4.2.4" }, @@ -11658,9 +11707,9 @@ } }, "node_modules/std-env": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", - "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.8.0.tgz", + "integrity": "sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==", "dev": true, "license": "MIT" }, @@ -11884,11 +11933,14 @@ } }, "node_modules/swagger-ui-dist": { - "version": "5.17.14", - "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.17.14.tgz", - "integrity": "sha512-CVbSfaLpstV65OnSjbXfVd6Sta3q3F7Cj/yYuvHMp1P90LztOLs6PfUnKEVAeiIVQt9u2SaPwv0LiH/OyMjHRw==", + "version": "5.18.2", + "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.18.2.tgz", + "integrity": "sha512-J+y4mCw/zXh1FOj5wGJvnAajq6XgHOyywsa9yITmwxIlJbMqITq3gYRZHaeqLVH/eV/HOPphE6NjF+nbSNC5Zw==", "dev": true, - "license": "Apache-2.0" + "license": "Apache-2.0", + "dependencies": { + "@scarf/scarf": "=1.4.0" + } }, "node_modules/synckit": { "version": "0.9.2", @@ -12083,13 +12135,6 @@ "node": ">=18" } }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true, - "license": "MIT" - }, "node_modules/thirty-two": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/thirty-two/-/thirty-two-1.0.2.tgz", @@ -12137,9 +12182,9 @@ "license": "MIT" }, "node_modules/tinypool": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.1.tgz", - "integrity": "sha512-URZYihUbRPcGv95En+sz6MfghfIc2OJ1sv/RmhWZLouPY0/8Vo80viwPvg3dlaS9fuq7fQMEfgRRK7BBZThBEA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.2.tgz", + "integrity": "sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==", "dev": true, "license": "MIT", "engines": { @@ -12452,9 +12497,9 @@ "license": "MIT" }, "node_modules/undici": { - "version": "6.20.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.20.1.tgz", - "integrity": "sha512-AjQF1QsmqfJys+LXfGTNum+qw4S88CojRInG/6t31W/1fk6G59s92bnAvGz5Cmur+kQv2SURXEvvudLmbrE8QA==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.0.tgz", + "integrity": "sha512-BUgJXc752Kou3oOIuU1i+yZZypyZRqNPW0vqoMPl8VaoalSfeR0D8/t4iAS3yirs79SSMTxTag+ZC86uswv+Cw==", "license": "MIT", "engines": { "node": ">=18.17" @@ -12736,9 +12781,9 @@ } }, "node_modules/vite": { - "version": "5.4.10", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.10.tgz", - "integrity": "sha512-1hvaPshuPUtxeQ0hsVH3Mud0ZanOLwVTneA1EgbAM5LhaZEqyPWGRQ7BtaMvUrTDeEaC8pxtj6a6jku3x4z6SQ==", + "version": "5.4.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", + "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", "dev": true, "license": "MIT", "dependencies": { @@ -12796,14 +12841,15 @@ } }, "node_modules/vite-node": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.4.tgz", - "integrity": "sha512-kqa9v+oi4HwkG6g8ufRnb5AeplcRw8jUF6/7/Qz1qRQOXHImG8YnLbB+LLszENwFnoBl9xIf9nVdCFzNd7GQEg==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.5.tgz", + "integrity": "sha512-rd0QIgx74q4S1Rd56XIiL2cYEdyWn13cunYBIuqh9mpmQr7gGS0IxXoP8R6OaZtNQQLyXSWbd4rXKYUbhFpK5w==", "dev": true, "license": "MIT", "dependencies": { "cac": "^6.7.14", "debug": "^4.3.7", + "es-module-lexer": "^1.5.4", "pathe": "^1.1.2", "vite": "^5.0.0" }, @@ -12818,31 +12864,31 @@ } }, "node_modules/vitest": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.4.tgz", - "integrity": "sha512-eDjxbVAJw1UJJCHr5xr/xM86Zx+YxIEXGAR+bmnEID7z9qWfoxpHw0zdobz+TQAFOLT+nEXz3+gx6nUJ7RgmlQ==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.5.tgz", + "integrity": "sha512-P4ljsdpuzRTPI/kbND2sDZ4VmieerR2c9szEZpjc+98Z9ebvnXmM5+0tHEKqYZumXqlvnmfWsjeFOjXVriDG7A==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/expect": "2.1.4", - "@vitest/mocker": "2.1.4", - "@vitest/pretty-format": "^2.1.4", - "@vitest/runner": "2.1.4", - "@vitest/snapshot": "2.1.4", - "@vitest/spy": "2.1.4", - "@vitest/utils": "2.1.4", + "@vitest/expect": "2.1.5", + "@vitest/mocker": "2.1.5", + "@vitest/pretty-format": "^2.1.5", + "@vitest/runner": "2.1.5", + "@vitest/snapshot": "2.1.5", + "@vitest/spy": "2.1.5", + "@vitest/utils": "2.1.5", "chai": "^5.1.2", "debug": "^4.3.7", "expect-type": "^1.1.0", "magic-string": "^0.30.12", "pathe": "^1.1.2", - "std-env": "^3.7.0", + "std-env": "^3.8.0", "tinybench": "^2.9.0", "tinyexec": "^0.3.1", "tinypool": "^1.0.1", "tinyrainbow": "^1.2.0", "vite": "^5.0.0", - "vite-node": "2.1.4", + "vite-node": "2.1.5", "why-is-node-running": "^2.3.0" }, "bin": { @@ -12857,8 +12903,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "2.1.4", - "@vitest/ui": "2.1.4", + "@vitest/browser": "2.1.5", + "@vitest/ui": "2.1.5", "happy-dom": "*", "jsdom": "*" }, diff --git a/package.json b/package.json index bf37cba2..10d0ffb3 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@switchbot/homebridge-switchbot", "displayName": "SwitchBot", "type": "module", - "version": "4.1.3", + "version": "4.1.4", "description": "The SwitchBot plugin allows you to access your SwitchBot device(s) from HomeKit.", "author": "SwitchBot (https://github.com/SwitchBot)", "contributors": [ @@ -80,11 +80,11 @@ "async-mqtt": "^2.6.3", "fakegato-history": "^0.6.5", "homebridge-lib": "^7.1.0", - "node-switchbot": "^3.3.0", + "node-switchbot": "^3.4.0", "rxjs": "^7.8.1" }, "devDependencies": { - "@antfu/eslint-config": "^3.8.0", + "@antfu/eslint-config": "^3.9.1", "@types/aes-js": "^3.1.4", "@types/debug": "^4.1.12", "@types/fs-extra": "^11.0.4", @@ -92,17 +92,17 @@ "@types/node": "^22.9.0", "@types/semver": "^7.5.8", "@types/source-map-support": "^0.5.10", - "@vitest/coverage-v8": "^2.1.4", - "eslint": "^9.14.0", + "@vitest/coverage-v8": "^2.1.5", + "eslint": "^9.15.0", "eslint-plugin-format": "^0.1.2", "homebridge": "^1.8.5", - "homebridge-config-ui-x": "4.62.0", + "homebridge-config-ui-x": "4.63.0", "nodemon": "^3.1.7", "shx": "^0.3.4", "ts-node": "^10.9.2", "typedoc": "^0.26.11", "typescript": "^5.6.3", - "vitest": "^2.1.4" + "vitest": "^2.1.5" }, "directories": { "doc": "docs" diff --git a/src/device/blindtilt.ts b/src/device/blindtilt.ts index 8f19621f..ddea3c2d 100644 --- a/src/device/blindtilt.ts +++ b/src/device/blindtilt.ts @@ -351,7 +351,7 @@ export class BlindTilt extends deviceBase { this.debugLog(`LightLevel: ${this.serviceData.lightLevel}, CurrentAmbientLightLevel: ${this.LightSensor!.CurrentAmbientLightLevel}`) } // Battery Info - if (this.serviceData.battery) { + if ('battery' in this.serviceData) { // BatteryLevel this.Battery.BatteryLevel = this.serviceData.battery this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`) @@ -577,7 +577,7 @@ export class BlindTilt extends deviceBase { switchBotBLE .discover({ model: this.device.bleModel, quick: true, id: this.device.bleMac }) .then(async (device_list: SwitchbotDevice[]) => { - const deviceList = device_list as unknown as WoBlindTilt[] + const deviceList = device_list as WoBlindTilt[] return await this.retryBLE({ max: this.maxRetryBLE(), fn: async () => { @@ -586,7 +586,7 @@ export class BlindTilt extends deviceBase { }) }) .then(async () => { - this.successLog(`TargetPostion: ${this.WindowCovering.TargetPosition} sent over SwitchBot BLE, sent successfully`) + this.successLog(`TargetPostion: ${this.WindowCovering.TargetPosition} sent over SwitchBot BLE, sent successfully`) await this.updateHomeKitCharacteristics() }) .catch(async (e: any) => { diff --git a/src/device/bot.ts b/src/device/bot.ts index 7617d22e..e4f4ae1f 100644 --- a/src/device/bot.ts +++ b/src/device/bot.ts @@ -282,7 +282,7 @@ export class Bot extends deviceBase { this.debugLog(`${mode} Mode, On: ${this.On}`) this.accessory.context.On = this.On // Battery Info - if (this.serviceData.battery) { + if ('battery' in this.serviceData) { // BatteryLevel this.Battery.BatteryLevel = this.serviceData.battery this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`) @@ -501,12 +501,12 @@ export class Bot extends deviceBase { switchBotBLE .discover({ model: this.device.bleModel, quick: true, id: this.device.bleMac }) .then(async (device_list: SwitchbotDevice[]) => { - const deviceList = device_list as unknown as WoHand[] + const deviceList = device_list as WoHand[] this.infoLog(`On: ${this.On}`) return await deviceList[0].press() }) .then(async () => { - this.successLog(`On: ${this.On} sent over SwitchBot BLE, sent successfully`) + this.successLog(`On: ${this.On} sent over SwitchBot BLE, sent successfully`) await this.updateHomeKitCharacteristics() setTimeout(async () => { this.On = false @@ -523,7 +523,7 @@ export class Bot extends deviceBase { switchBotBLE .discover({ model: this.device.bleModel, quick: true, id: this.device.bleMac }) .then(async (device_list: SwitchbotDevice[]) => { - const deviceList = device_list as unknown as WoHand[] + const deviceList = device_list as WoHand[] this.infoLog(`On: ${this.On}`) this.warnLog(`device_list: ${JSON.stringify(device_list)}`) return await this.retryBLE({ @@ -542,7 +542,7 @@ export class Bot extends deviceBase { }) }) .then(async () => { - this.successLog(`On: ${this.On} sent over SwitchBot BLE, sent successfully`) + this.successLog(`On: ${this.On} sent over SwitchBot BLE, sent successfully`) await this.updateHomeKitCharacteristics() }) .catch(async (e: any) => { diff --git a/src/device/ceilinglight.ts b/src/device/ceilinglight.ts index a3426d88..e941323a 100644 --- a/src/device/ceilinglight.ts +++ b/src/device/ceilinglight.ts @@ -289,7 +289,7 @@ export class CeilingLight extends deviceBase { } else { (async () => { // Start to monitor advertisement packets - const serviceData = await this.monitorAdvertisementPackets(switchBotBLE) as unknown as ceilingLightServiceData + const serviceData = await this.monitorAdvertisementPackets(switchBotBLE) as ceilingLightServiceData // Update HomeKit if ((serviceData.model === SwitchBotBLEModel.CeilingLight || SwitchBotBLEModel.CeilingLightPro) && (serviceData.modelName === SwitchBotBLEModelName.CeilingLight || SwitchBotBLEModelName.CeilingLightPro)) { this.serviceData = serviceData @@ -426,7 +426,7 @@ export class CeilingLight extends deviceBase { switchBotBLE .discover({ model: this.device.bleModel, id: this.device.bleMac }) .then(async (device_list: SwitchbotDevice[]) => { - const deviceList = device_list[0] as unknown as WoCeilingLight + const deviceList = device_list[0] as WoCeilingLight this.infoLog(`On: ${this.LightBulb.On}`) return await this.retryBLE({ max: this.maxRetryBLE(), @@ -440,7 +440,7 @@ export class CeilingLight extends deviceBase { }) }) .then(async () => { - this.successLog(`On: ${this.LightBulb.On} sent over SwitchBot BLE, sent successfully`) + this.successLog(`On: ${this.LightBulb.On} sent over SwitchBot BLE, sent successfully`) this.LightBulb.On = false }) .catch(async (e: any) => { diff --git a/src/device/colorbulb.ts b/src/device/colorbulb.ts index 9b64dc1c..8a21f865 100644 --- a/src/device/colorbulb.ts +++ b/src/device/colorbulb.ts @@ -474,7 +474,7 @@ export class ColorBulb extends deviceBase { }) }) .then(async () => { - this.successLog(`On: ${this.LightBulb.On} sent over SwitchBot BLE, sent successfully`) + this.successLog(`On: ${this.LightBulb.On} sent over SwitchBot BLE, sent successfully`) await this.updateHomeKitCharacteristics() }) .catch(async (e: any) => { @@ -506,12 +506,12 @@ export class ColorBulb extends deviceBase { switchBotBLE .discover({ model: this.device.bleModel, id: this.device.bleMac }) .then(async (device_list: SwitchbotDevice[]) => { - const deviceList = device_list as unknown as WoBulb[] + const deviceList = device_list as WoBulb[] this.infoLog(`Target Brightness: ${this.LightBulb.Brightness}`) return await deviceList[0].setBrightness(Number(this.LightBulb.Brightness)) }) .then(async () => { - this.successLog(`Brightness: ${this.LightBulb.Brightness} sent over SwitchBot BLE, sent successfully`) + this.successLog(`Brightness: ${this.LightBulb.Brightness} sent over SwitchBot BLE, sent successfully`) await this.updateHomeKitCharacteristics() }) .catch(async (e: any) => { @@ -545,12 +545,12 @@ export class ColorBulb extends deviceBase { switchBotBLE .discover({ model: this.device.bleModel, id: this.device.bleMac }) .then(async (device_list: SwitchbotDevice[]) => { - const deviceList = device_list as unknown as WoBulb[] + const deviceList = device_list as WoBulb[] this.infoLog(`ColorTemperature: ${this.LightBulb.ColorTemperature}`) return await deviceList[0].setColorTemperature(kelvin) }) .then(async () => { - this.successLog(`ColorTemperature: ${this.LightBulb.ColorTemperature} sent over SwitchBot BLE, sent successfully`) + this.successLog(`ColorTemperature: ${this.LightBulb.ColorTemperature} sent over SwitchBot BLE, sent successfully`) await this.updateHomeKitCharacteristics() }) .catch(async (e: any) => { @@ -585,12 +585,12 @@ export class ColorBulb extends deviceBase { switchBotBLE .discover({ model: this.device.bleModel, id: this.device.bleMac }) .then(async (device_list: SwitchbotDevice[]) => { - const deviceList = device_list as unknown as WoBulb[] + const deviceList = device_list as WoBulb[] this.infoLog(`RGB: ${(this.LightBulb.Brightness, red, green, blue)}`) return await deviceList[0].setRGB(Number(this.LightBulb.Brightness), red, green, blue) }) .then(async () => { - this.successLog(`RGB: ${(this.LightBulb.Brightness, red, green, blue)} sent over SwitchBot BLE, sent successfully`) + this.successLog(`RGB: ${(this.LightBulb.Brightness, red, green, blue)} sent over SwitchBot BLE, sent successfully`) await this.updateHomeKitCharacteristics() }) .catch(async (e: any) => { diff --git a/src/device/contact.ts b/src/device/contact.ts index 86b8ce4d..cc450bdf 100644 --- a/src/device/contact.ts +++ b/src/device/contact.ts @@ -205,7 +205,7 @@ export class Contact extends deviceBase { this.debugLog(`LightLevel: ${this.serviceData.lightLevel}, CurrentAmbientLightLevel: ${this.LightSensor.CurrentAmbientLightLevel}`) } // Battery Info - if (this.serviceData.battery) { + if ('battery' in this.serviceData) { // BatteryLevel this.Battery.BatteryLevel = this.serviceData.battery this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`) diff --git a/src/device/curtain.ts b/src/device/curtain.ts index e136b61e..f53b554f 100644 --- a/src/device/curtain.ts +++ b/src/device/curtain.ts @@ -379,12 +379,12 @@ export class Curtain extends deviceBase { this.debugLog('BLEparseStatus') this.debugLog(`(position, battery) = BLE:(${this.serviceData.position}, ${this.serviceData.battery}), current:(${this.WindowCovering.CurrentPosition}, ${this.Battery.BatteryLevel})`) // CurrentPosition - if (this.serviceData.position) { + if ('position' in this.serviceData) { this.WindowCovering.CurrentPosition = 100 - this.serviceData.position await this.getCurrentPostion() } // CurrentAmbientLightLevel - if (!(this.device as curtainConfig).hide_lightsensor && this.LightSensor?.Service && this.serviceData.lightLevel) { + if (!(this.device as curtainConfig).hide_lightsensor && this.LightSensor?.Service && 'lightLevel' in this.serviceData) { const set_minLux = (this.device as curtainConfig).set_minLux ?? 1 const set_maxLux = (this.device as curtainConfig).set_maxLux ?? 6001 const lightLevel = this.serviceData.lightLevel @@ -392,7 +392,7 @@ export class Curtain extends deviceBase { this.debugLog(`LightLevel: ${this.serviceData.lightLevel}, CurrentAmbientLightLevel: ${this.LightSensor.CurrentAmbientLightLevel}`) } // Battery Info - if (this.serviceData.battery) { + if ('battery' in this.serviceData) { // BatteryLevel this.Battery.BatteryLevel = this.serviceData.battery this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`) @@ -608,7 +608,7 @@ export class Curtain extends deviceBase { switchBotBLE .discover({ model: this.device.bleModel, quick: true, id: this.device.bleMac }) .then(async (device_list: SwitchbotDevice[]) => { - const deviceList = device_list as unknown as WoCurtain[] + const deviceList = device_list as WoCurtain[] return await this.retryBLE({ max: this.maxRetryBLE(), fn: async () => { @@ -617,7 +617,7 @@ export class Curtain extends deviceBase { }) }) .then(async () => { - this.successLog(`TargetPostion: ${this.WindowCovering.TargetPosition} sent over SwitchBot BLE, sent successfully`) + this.successLog(`TargetPostion: ${this.WindowCovering.TargetPosition} sent over SwitchBot BLE, sent successfully`) await this.updateHomeKitCharacteristics() }) .catch(async (e: any) => { diff --git a/src/device/device.ts b/src/device/device.ts index 10374c78..3400159b 100644 --- a/src/device/device.ts +++ b/src/device/device.ts @@ -92,7 +92,7 @@ export abstract class deviceBase { async getDeviceRateSettings(device: device & devicesConfig): Promise { // refreshRate - this.deviceRefreshRate = device.refreshRate ?? this.platform.platformRefreshRate ?? 360 + this.deviceRefreshRate = device.refreshRate ?? this.platform.platformRefreshRate ?? 5 const refreshRate = device.refreshRate ? 'Device Config' : this.platform.platformRefreshRate ? 'Platform Config' : 'Default' // updateRate this.deviceUpdateRate = device.updateRate ?? this.platform.platformUpdateRate ?? 5 @@ -458,11 +458,11 @@ export abstract class deviceBase { bleModelName: SwitchBotBLEModelName.MeterPro, bleModelFriendlyName: SwitchBotBLEModelFriendlyName.MeterPro, }, - 'Meter Pro CO2': { + 'MeterPro(CO2)': { model: SwitchBotModel.MeterProCO2, - bleModel: SwitchBotBLEModel.MeterPro, - bleModelName: SwitchBotBLEModelName.MeterPro, - bleModelFriendlyName: SwitchBotBLEModelFriendlyName.MeterPro, + bleModel: SwitchBotBLEModel.MeterProCO2, + bleModelName: SwitchBotBLEModelName.MeterProCO2, + bleModelFriendlyName: SwitchBotBLEModelFriendlyName.MeterProCO2, }, 'WoIOSensor': { model: SwitchBotModel.OutdoorMeter, diff --git a/src/device/fan.ts b/src/device/fan.ts index 07476a49..987ad9a3 100644 --- a/src/device/fan.ts +++ b/src/device/fan.ts @@ -460,7 +460,7 @@ export class Fan extends deviceBase { switchBotBLE .discover({ model: this.device.bleModel, id: this.device.bleMac }) .then(async (device_list: SwitchbotDevice[]) => { - const deviceList = device_list as unknown as SwitchbotDevice[] + const deviceList = device_list as SwitchbotDevice[] return await this.retryBLE({ max: this.maxRetryBLE(), fn: async () => { @@ -473,7 +473,7 @@ export class Fan extends deviceBase { }) }) .then(async () => { - this.successLog(`Active: ${this.Fan.Active} sent over SwitchBot BLE, sent successfully`) + this.successLog(`Active: ${this.Fan.Active} sent over SwitchBot BLE, sent successfully`) await this.updateHomeKitCharacteristics() }) .catch(async (e: any) => { diff --git a/src/device/humidifier.ts b/src/device/humidifier.ts index a4fd4c75..338fc53f 100644 --- a/src/device/humidifier.ts +++ b/src/device/humidifier.ts @@ -438,11 +438,11 @@ export class Humidifier extends deviceBase { switchBotBLE .discover({ model: this.device.bleModel, quick: true, id: this.device.bleMac }) .then(async (device_list: SwitchbotDevice[]) => { - const deviceList = device_list as unknown as WoHumi[] + const deviceList = device_list as WoHumi[] return await deviceList[0].percentage(this.HumidifierDehumidifier.RelativeHumidityHumidifierThreshold) }) .then(async () => { - this.successLog(`RelativeHumidityHumidifierThreshold: ${this.HumidifierDehumidifier.RelativeHumidityHumidifierThreshold} sent over BLE, sent successfully`) + this.successLog(`RelativeHumidityHumidifierThreshold: ${this.HumidifierDehumidifier.RelativeHumidityHumidifierThreshold} sent over BLE, sent successfully`) await this.updateHomeKitCharacteristics() }) .catch(async (e: any) => { diff --git a/src/device/iosensor.ts b/src/device/iosensor.ts index 0a7b68ef..87c6e301 100644 --- a/src/device/iosensor.ts +++ b/src/device/iosensor.ts @@ -179,7 +179,7 @@ export class IOSensor extends deviceBase { this.debugLog('BLEparseStatus') this.debugLog(`(battery, temperature, humidity) = BLE:(${this.serviceData.battery}, ${this.serviceData.celsius}, ${this.serviceData.humidity}), current:(${this.Battery.BatteryLevel}, ${this.TemperatureSensor?.CurrentTemperature}, ${this.HumiditySensor?.CurrentRelativeHumidity})`) // Battery Info - if (this.serviceData.battery) { + if ('battery' in this.serviceData) { // BatteryLevel this.Battery.BatteryLevel = this.serviceData.battery this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`) diff --git a/src/device/lightstrip.ts b/src/device/lightstrip.ts index 9bf0fa35..9247241d 100644 --- a/src/device/lightstrip.ts +++ b/src/device/lightstrip.ts @@ -465,7 +465,7 @@ export class StripLight extends deviceBase { switchBotBLE .discover({ model: this.device.bleModel, id: this.device.bleMac }) .then(async (device_list: SwitchbotDevice[]) => { - const deviceList = device_list as unknown as WoStrip[] + const deviceList = device_list as WoStrip[] this.infoLog(`On: ${this.LightBulb.On}`) return await this.retryBLE({ max: this.maxRetryBLE(), @@ -479,7 +479,7 @@ export class StripLight extends deviceBase { }) }) .then(async () => { - this.successLog(`On: ${this.LightBulb.On} sent over SwitchBot BLE, sent successfully`) + this.successLog(`On: ${this.LightBulb.On} sent over SwitchBot BLE, sent successfully`) await this.updateHomeKitCharacteristics() }) .catch(async (e: any) => { @@ -515,7 +515,7 @@ export class StripLight extends deviceBase { return await device_list[0].setBrightness(this.LightBulb.Brightness) }) .then(async () => { - this.successLog(`Brightness: ${this.LightBulb.Brightness} sent over SwitchBot BLE, sent successfully`) + this.successLog(`Brightness: ${this.LightBulb.Brightness} sent over SwitchBot BLE, sent successfully`) await this.updateHomeKitCharacteristics() }) .catch(async (e: any) => { @@ -554,7 +554,7 @@ export class StripLight extends deviceBase { return await device_list[0].setRGB(this.LightBulb.Brightness, red, green, blue) }) .then(async () => { - this.successLog(`RGB: ${(this.LightBulb.Brightness, red, green, blue)} sent over SwitchBot BLE, sent successfully`) + this.successLog(`RGB: ${(this.LightBulb.Brightness, red, green, blue)} sent over SwitchBot BLE, sent successfully`) await this.updateHomeKitCharacteristics() }) .catch(async (e: any) => { diff --git a/src/device/lock.ts b/src/device/lock.ts index dc67a47f..238f06e7 100644 --- a/src/device/lock.ts +++ b/src/device/lock.ts @@ -225,7 +225,7 @@ export class Lock extends deviceBase { this.debugLog(`ContactSensorState: ${this.ContactSensor.ContactSensorState}`) } // Battery Info - if (this.serviceData.battery) { + if ('battery' in this.serviceData) { // BatteryLevel this.Battery.BatteryLevel = this.serviceData.battery this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`) @@ -459,7 +459,7 @@ export class Lock extends deviceBase { }) }) .then(async () => { - this.successLog(`LockTargetState: ${this.LockMechanism.LockTargetState} sent over SwitchBot BLE, sent successfully`) + this.successLog(`LockTargetState: ${this.LockMechanism.LockTargetState} sent over SwitchBot BLE, sent successfully`) await this.updateHomeKitCharacteristics() }) .catch(async (e: any) => { diff --git a/src/device/meter.ts b/src/device/meter.ts index ee1f3913..a7305012 100644 --- a/src/device/meter.ts +++ b/src/device/meter.ts @@ -185,7 +185,7 @@ export class Meter extends deviceBase { this.debugLog(`CurrentTemperature: ${this.TemperatureSensor.CurrentTemperature}°c`) } // Battery Info - if (this.serviceData.battery) { + if ('battery' in this.serviceData) { // BatteryLevel this.Battery.BatteryLevel = this.serviceData.battery this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`) diff --git a/src/device/meterplus.ts b/src/device/meterplus.ts index 17b608db..c99f601a 100644 --- a/src/device/meterplus.ts +++ b/src/device/meterplus.ts @@ -189,7 +189,7 @@ export class MeterPlus extends deviceBase { this.debugLog(`CurrentTemperature: ${this.TemperatureSensor.CurrentTemperature}°c`) } // Battery Info - if (this.serviceData.battery) { + if ('battery' in this.serviceData) { // BatteryLevel this.Battery.BatteryLevel = this.serviceData.battery this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`) diff --git a/src/device/meterpro.ts b/src/device/meterpro.ts index 8b56fbc5..b1ef239b 100644 --- a/src/device/meterpro.ts +++ b/src/device/meterpro.ts @@ -3,10 +3,10 @@ * MeterPro.ts: @switchbot/homebridge-switchbot. */ import type { CharacteristicValue, PlatformAccessory, Service } from 'homebridge' -import type { device, meterProServiceData, meterProStatus, meterProWebhookContext } from 'node-switchbot' +import type { device, meterProCO2ServiceData, meterProCO2Status, meterProCO2WebhookContext, meterProServiceData, meterProStatus, meterProWebhookContext } from 'node-switchbot' import type { SwitchBotPlatform } from '../platform.js' -import type { devicesConfig, meterConfig } from '../settings.js' +import type { devicesConfig, meterProConfig } from '../settings.js' import { Units } from 'homebridge' /* @@ -45,14 +45,21 @@ export class MeterPro extends deviceBase { CurrentTemperature: CharacteristicValue } + private CarbonDioxideSensor?: { + Name: CharacteristicValue + Service: Service + CarbonDioxideDetected: CharacteristicValue + CarbonDioxideLevel: CharacteristicValue + } + // OpenAPI - deviceStatus!: meterProStatus + deviceStatus!: meterProStatus | meterProCO2Status // Webhook - webhookContext!: meterProWebhookContext + webhookContext!: meterProWebhookContext | meterProCO2WebhookContext // BLE - serviceData!: meterProServiceData + serviceData!: meterProServiceData | meterProCO2ServiceData // Updates meterUpdateInProgress!: boolean @@ -91,7 +98,7 @@ export class MeterPro extends deviceBase { }) // Initialize Temperature Sensor Service - if ((device as meterConfig).hide_temperature) { + if ((device as meterProConfig).hide_temperature) { if (this.TemperatureSensor) { this.debugLog('Removing Temperature Sensor Service') this.TemperatureSensor.Service = this.accessory.getService(this.hap.Service.TemperatureSensor) as Service @@ -118,7 +125,7 @@ export class MeterPro extends deviceBase { }) } // Initialize Humidity Sensor Service - if ((device as meterConfig).hide_humidity) { + if ((device as meterProConfig).hide_humidity) { if (this.HumiditySensor) { this.debugLog('Removing Humidity Sensor Service') this.HumiditySensor.Service = this.accessory.getService(this.hap.Service.HumiditySensor) as Service @@ -141,6 +148,40 @@ export class MeterPro extends deviceBase { }) } + // Initialize Carbon Dioxide Sensor Service + if ((device as meterProConfig).hide_co2) { + if (this.CarbonDioxideSensor) { + this.debugLog('Removing Carbon Dioxide Sensor Service') + this.CarbonDioxideSensor.Service = this.accessory.getService(this.hap.Service.CarbonDioxideSensor) as Service + accessory.removeService(this.CarbonDioxideSensor.Service) + } + } else if (this.device.deviceType === 'MeterPro(CO2)') { + accessory.context.CarbonDioxideSensor = accessory.context.CarbonDioxideSensor ?? {} + this.CarbonDioxideSensor = { + Name: `${accessory.displayName} Carbon Dioxide Sensor`, + Service: accessory.getService(this.hap.Service.CarbonDioxideSensor) ?? this.accessory.addService(this.hap.Service.CarbonDioxideSensor) as Service, + CarbonDioxideDetected: accessory.context.CarbonDioxideDetected ?? this.hap.Characteristic.CarbonDioxideDetected.CO2_LEVELS_NORMAL, + CarbonDioxideLevel: accessory.context.CarbonDioxideLevel ?? 0, + } + accessory.context.CarbonDioxideSensor = this.CarbonDioxideSensor as object + + // Initialize Carbon Dioxide Sensor Characteristics + this.CarbonDioxideSensor.Service.setCharacteristic(this.hap.Characteristic.Name, this.CarbonDioxideSensor.Name).getCharacteristic(this.hap.Characteristic.CarbonDioxideDetected).onGet(() => { + return this.CarbonDioxideSensor!.CarbonDioxideDetected! + }) + this.CarbonDioxideSensor.Service.getCharacteristic(this.hap.Characteristic.CarbonDioxideLevel).setProps({ + minStep: 1, + }).onGet(() => { + return this.CarbonDioxideSensor!.CarbonDioxideLevel! + }) + } else { + if (this.CarbonDioxideSensor) { + this.debugLog('Removing Carbon Dioxide Sensor Service') + this.CarbonDioxideSensor.Service = this.accessory.getService(this.hap.Service.CarbonDioxideSensor) as Service + accessory.removeService(this.CarbonDioxideSensor.Service) + } + } + // Retrieve initial values and updateHomekit try { this.debugLog('Retrieve initial values and update Homekit') @@ -175,21 +216,31 @@ export class MeterPro extends deviceBase { async BLEparseStatus(): Promise { this.debugLog('BLEparseStatus') - this.debugLog(`(temperature, humidity) = BLE:(${this.serviceData.celsius}, ${this.serviceData.humidity}), current:(${this.TemperatureSensor?.CurrentTemperature}, ${this.HumiditySensor?.CurrentRelativeHumidity})`) + this.debugLog(`(temperature, humidity${this.device.deviceType === 'MeterPro(CO2)' ? ', co2' : ''}) = BLE:(${this.serviceData.celsius}, ${this.serviceData.humidity}${this.device.deviceType === 'MeterPro(CO2)' ? `, ${(this.serviceData as meterProCO2ServiceData).co2}` : ''}) current:(${this.TemperatureSensor?.CurrentTemperature}, ${this.HumiditySensor?.CurrentRelativeHumidity}${this.device.deviceType === 'MeterPro(CO2)' ? `, ${this.CarbonDioxideSensor?.CarbonDioxideLevel}` : ''})`) // CurrentRelativeHumidity - if (!(this.device as meterConfig).hide_humidity && this.HumiditySensor?.Service) { + if (!(this.device as meterProConfig).hide_humidity && this.HumiditySensor?.Service) { this.HumiditySensor.CurrentRelativeHumidity = validHumidity(this.serviceData.humidity, 0, 100) this.debugLog(`CurrentRelativeHumidity: ${this.HumiditySensor.CurrentRelativeHumidity}%`) } // Current Temperature - if (!(this.device as meterConfig).hide_temperature && this.TemperatureSensor?.Service) { + if (!(this.device as meterProConfig).hide_temperature && this.TemperatureSensor?.Service) { const CELSIUS = this.serviceData.celsius < 0 ? 0 : this.serviceData.celsius > 100 ? 100 : this.serviceData.celsius this.TemperatureSensor.CurrentTemperature = CELSIUS this.debugLog(`CurrentTemperature: ${this.TemperatureSensor.CurrentTemperature}°c`) } + // Carbon Dioxide Sensor + if (!(this.device as meterProConfig).hide_co2 && this.CarbonDioxideSensor?.Service && this.device.deviceType === 'MeterPro(CO2)') { + this.CarbonDioxideSensor.CarbonDioxideLevel = (this.serviceData as meterProCO2ServiceData).co2 + this.debugLog(`CarbonDioxideLevel: ${this.CarbonDioxideSensor.CarbonDioxideLevel}ppm`) + this.CarbonDioxideSensor.CarbonDioxideDetected = this.CarbonDioxideSensor.CarbonDioxideLevel > 0 + ? this.hap.Characteristic.CarbonDioxideDetected.CO2_LEVELS_ABNORMAL + : this.hap.Characteristic.CarbonDioxideDetected.CO2_LEVELS_NORMAL + this.debugLog(`CarbonDioxideDetected: ${this.CarbonDioxideSensor.CarbonDioxideDetected}`) + this.warnLog('Carbon Dioxide Sensor is not supported yet.') + } // Battery Info - if (this.serviceData.battery) { + if ('battery' in this.serviceData) { // BatteryLevel this.Battery.BatteryLevel = this.serviceData.battery this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`) @@ -203,29 +254,43 @@ export class MeterPro extends deviceBase { async openAPIparseStatus(): Promise { this.debugLog('openAPIparseStatus') - this.debugLog(`(temperature, humidity) = OpenAPI:(${this.deviceStatus.temperature}, ${this.deviceStatus.humidity}), current:(${this.TemperatureSensor?.CurrentTemperature}, ${this.HumiditySensor?.CurrentRelativeHumidity})`) + this.debugLog(`(temperature, humidity${this.device.deviceType === 'MeterPro(CO2)' ? ', co2' : ''}) = OpenAPI:(${this.deviceStatus.temperature}, ${this.deviceStatus.humidity}${this.device.deviceType === 'MeterPro(CO2)' ? `, ${(this.deviceStatus as meterProCO2Status).co2}` : ''}) current:(${this.TemperatureSensor?.CurrentTemperature}, ${this.HumiditySensor?.CurrentRelativeHumidity}${this.device.deviceType === 'MeterPro(CO2)' ? `, ${this.CarbonDioxideSensor?.CarbonDioxideLevel}` : ''})`) // CurrentRelativeHumidity - if (!(this.device as meterConfig).hide_humidity && this.HumiditySensor?.Service) { + if (!(this.device as meterProConfig).hide_humidity && this.HumiditySensor?.Service) { this.HumiditySensor.CurrentRelativeHumidity = this.deviceStatus.humidity this.debugLog(`CurrentRelativeHumidity: ${this.HumiditySensor.CurrentRelativeHumidity}%`) } // CurrentTemperature - if (!(this.device as meterConfig).hide_temperature && this.TemperatureSensor?.Service) { + if (!(this.device as meterProConfig).hide_temperature && this.TemperatureSensor?.Service) { this.TemperatureSensor.CurrentTemperature = this.deviceStatus.temperature this.debugLog(`CurrentTemperature: ${this.TemperatureSensor.CurrentTemperature}°c`) } + // Carbon Dioxide Sensor + if (!(this.device as meterProConfig).hide_co2 && this.CarbonDioxideSensor?.Service && this.device.deviceType === 'MeterPro(CO2)') { + this.CarbonDioxideSensor.CarbonDioxideLevel = (this.deviceStatus as meterProCO2Status).co2 + this.debugLog(`CarbonDioxideLevel: ${this.CarbonDioxideSensor.CarbonDioxideLevel}ppm`) + this.CarbonDioxideSensor.CarbonDioxideDetected = this.CarbonDioxideSensor.CarbonDioxideLevel > 0 + ? this.hap.Characteristic.CarbonDioxideDetected.CO2_LEVELS_ABNORMAL + : this.hap.Characteristic.CarbonDioxideDetected.CO2_LEVELS_NORMAL + this.debugLog(`CarbonDioxideDetected: ${this.CarbonDioxideSensor.CarbonDioxideDetected}`) + this.warnLog('Carbon Dioxide Sensor is not supported yet.') + } + + // Battery Info + if ('battery' in this.serviceData) { // BatteryLevel - this.Battery.BatteryLevel = this.deviceStatus.battery - this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`) + this.Battery.BatteryLevel = this.deviceStatus.battery + this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`) - // StatusLowBattery - this.Battery.StatusLowBattery = this.Battery.BatteryLevel < 10 - ? this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_LOW - : this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL - this.debugLog(`StatusLowBattery: ${this.Battery.StatusLowBattery}`) + // StatusLowBattery + this.Battery.StatusLowBattery = this.Battery.BatteryLevel < 10 + ? this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_LOW + : this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL + this.debugLog(`StatusLowBattery: ${this.Battery.StatusLowBattery}`) + } // FirmwareVersion if (this.deviceStatus.version) { @@ -245,23 +310,34 @@ export class MeterPro extends deviceBase { async parseStatusWebhook(): Promise { this.debugLog('parseStatusWebhook') - this.debugLog(`(scale, temperature, humidity) = Webhook:(${this.webhookContext.scale}, ${convertUnits(this.webhookContext.temperature, this.webhookContext.scale, (this.device as meterConfig).convertUnitTo)}, ${this.webhookContext.humidity}) current:(${this.TemperatureSensor?.CurrentTemperature}, ${this.HumiditySensor?.CurrentRelativeHumidity})`) + this.debugLog(`(scale, temperature, humidity${this.device.deviceType === 'MeterPro(CO2)' ? ', co2' : ''}) = Webhook:(${this.webhookContext.scale}, ${convertUnits(this.webhookContext.temperature, this.webhookContext.scale, (this.device as meterProConfig).convertUnitTo)}, ${this.webhookContext.humidity}${this.device.deviceType === 'MeterPro(CO2)' ? `, ${(this.webhookContext as meterProCO2WebhookContext).co2}` : ''}) current:(${this.TemperatureSensor?.CurrentTemperature}, ${this.HumiditySensor?.CurrentRelativeHumidity}${this.device.deviceType === 'MeterPro(CO2)' ? `, ${this.CarbonDioxideSensor?.CarbonDioxideLevel}` : ''})`) // Check if the scale is not CELSIUS - if (this.webhookContext.scale !== 'CELSIUS' && (this.device as meterConfig).convertUnitTo === undefined) { + if (this.webhookContext.scale !== 'CELSIUS' && (this.device as meterProConfig).convertUnitTo === undefined) { this.warnLog(`received a non-CELSIUS Webhook scale: ${this.webhookContext.scale}, Use the *convertUnitsTo* config under Hub settings, if displaying incorrectly in HomeKit.`) } // CurrentRelativeHumidity - if (!(this.device as meterConfig).hide_humidity && this.HumiditySensor?.Service) { + if (!(this.device as meterProConfig).hide_humidity && this.HumiditySensor?.Service) { this.HumiditySensor.CurrentRelativeHumidity = this.webhookContext.humidity this.debugLog(`CurrentRelativeHumidity: ${this.HumiditySensor.CurrentRelativeHumidity}`) } // CurrentTemperature - if (!(this.device as meterConfig).hide_temperature && this.TemperatureSensor?.Service) { - this.TemperatureSensor.CurrentTemperature = convertUnits(this.webhookContext.temperature, this.webhookContext.scale, (this.device as meterConfig).convertUnitTo) + if (!(this.device as meterProConfig).hide_temperature && this.TemperatureSensor?.Service) { + this.TemperatureSensor.CurrentTemperature = convertUnits(this.webhookContext.temperature, this.webhookContext.scale, (this.device as meterProConfig).convertUnitTo) this.debugLog(`CurrentTemperature: ${this.TemperatureSensor.CurrentTemperature}`) } + + // Carbon Dioxide Sensor + if (!(this.device as meterProConfig).hide_co2 && this.CarbonDioxideSensor?.Service && this.device.deviceType === 'MeterPro(CO2)') { + this.CarbonDioxideSensor.CarbonDioxideLevel = (this.webhookContext as meterProCO2WebhookContext).co2 + this.debugLog(`CarbonDioxideLevel: ${this.CarbonDioxideSensor.CarbonDioxideLevel}ppm`) + this.CarbonDioxideSensor.CarbonDioxideDetected = this.CarbonDioxideSensor.CarbonDioxideLevel > 0 + ? this.hap.Characteristic.CarbonDioxideDetected.CO2_LEVELS_ABNORMAL + : this.hap.Characteristic.CarbonDioxideDetected.CO2_LEVELS_NORMAL + this.debugLog(`CarbonDioxideDetected: ${this.CarbonDioxideSensor.CarbonDioxideDetected}`) + this.warnLog('Carbon Dioxide Sensor is not supported yet.') + } } /** @@ -289,7 +365,7 @@ export class MeterPro extends deviceBase { // Start to monitor advertisement packets (async () => { // Start to monitor advertisement packets - const serviceData = await this.monitorAdvertisementPackets(switchBotBLE) as meterProServiceData + const serviceData = await this.monitorAdvertisementPackets(switchBotBLE) as meterProServiceData | meterProCO2ServiceData // Update HomeKit if (serviceData.model === SwitchBotBLEModel.MeterPro && serviceData.modelName === SwitchBotBLEModelName.MeterPro) { this.serviceData = serviceData @@ -373,11 +449,11 @@ export class MeterPro extends deviceBase { */ async updateHomeKitCharacteristics(): Promise { // CurrentRelativeHumidity - if (!(this.device as meterConfig).hide_humidity && this.HumiditySensor?.Service) { + if (!(this.device as meterProConfig).hide_humidity && this.HumiditySensor?.Service) { await this.updateCharacteristic(this.HumiditySensor.Service, this.hap.Characteristic.CurrentRelativeHumidity, this.HumiditySensor.CurrentRelativeHumidity, 'CurrentRelativeHumidity') } // CurrentTemperature - if (!(this.device as meterConfig).hide_temperature && this.TemperatureSensor?.Service) { + if (!(this.device as meterProConfig).hide_temperature && this.TemperatureSensor?.Service) { await this.updateCharacteristic(this.TemperatureSensor.Service, this.hap.Characteristic.CurrentTemperature, this.TemperatureSensor.CurrentTemperature, 'CurrentTemperature') } // BatteryLevel @@ -396,10 +472,10 @@ export class MeterPro extends deviceBase { async offlineOff(): Promise { if (this.device.offline) { - if (!(this.device as meterConfig).hide_humidity && this.HumiditySensor?.Service) { + if (!(this.device as meterProConfig).hide_humidity && this.HumiditySensor?.Service) { this.HumiditySensor.Service.updateCharacteristic(this.hap.Characteristic.CurrentRelativeHumidity, 50) } - if (!(this.device as meterConfig).hide_temperature && this.TemperatureSensor?.Service) { + if (!(this.device as meterProConfig).hide_temperature && this.TemperatureSensor?.Service) { this.TemperatureSensor.Service.updateCharacteristic(this.hap.Characteristic.CurrentTemperature, 30) } this.Battery.Service.updateCharacteristic(this.hap.Characteristic.BatteryLevel, 100) @@ -408,10 +484,10 @@ export class MeterPro extends deviceBase { } async apiError(e: any): Promise { - if (!(this.device as meterConfig).hide_humidity && this.HumiditySensor?.Service) { + if (!(this.device as meterProConfig).hide_humidity && this.HumiditySensor?.Service) { this.HumiditySensor.Service.updateCharacteristic(this.hap.Characteristic.CurrentRelativeHumidity, e) } - if (!(this.device as meterConfig).hide_temperature && this.TemperatureSensor?.Service) { + if (!(this.device as meterProConfig).hide_temperature && this.TemperatureSensor?.Service) { this.TemperatureSensor.Service.updateCharacteristic(this.hap.Characteristic.CurrentTemperature, e) } this.Battery.Service.updateCharacteristic(this.hap.Characteristic.BatteryLevel, e) diff --git a/src/device/motion.ts b/src/device/motion.ts index 35967230..890f1124 100644 --- a/src/device/motion.ts +++ b/src/device/motion.ts @@ -172,7 +172,7 @@ export class Motion extends deviceBase { this.debugLog(`LightLevel: ${this.serviceData.lightLevel}, CurrentAmbientLightLevel: ${this.LightSensor.CurrentAmbientLightLevel}`) } // Battery Info - if (this.serviceData.battery) { + if ('battery' in this.serviceData) { // BatteryLevel this.Battery.BatteryLevel = this.serviceData.battery this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`) diff --git a/src/device/plug.ts b/src/device/plug.ts index a55f8bfd..8a7c8cd5 100644 --- a/src/device/plug.ts +++ b/src/device/plug.ts @@ -307,7 +307,7 @@ export class Plug extends deviceBase { switchBotBLE .discover({ model: this.device.bleModel, id: this.device.bleMac }) .then(async (device_list: SwitchbotDevice[]) => { - const deviceList = device_list as unknown as WoPlugMiniUS[] + const deviceList = device_list as WoPlugMiniUS[] this.infoLog(`On: ${this.Outlet.On}`) return await this.retryBLE({ max: this.maxRetryBLE(), @@ -321,7 +321,7 @@ export class Plug extends deviceBase { }) }) .then(async () => { - this.successLog(`On: ${this.Outlet.On} sent over SwitchBot BLE, sent successfully`) + this.successLog(`On: ${this.Outlet.On} sent over SwitchBot BLE, sent successfully`) await this.updateHomeKitCharacteristics() }) .catch(async (e: any) => { diff --git a/src/device/robotvacuumcleaner.ts b/src/device/robotvacuumcleaner.ts index e7fd3fa2..b6182749 100644 --- a/src/device/robotvacuumcleaner.ts +++ b/src/device/robotvacuumcleaner.ts @@ -171,7 +171,7 @@ export class RobotVacuumCleaner extends deviceBase { this.debugLog(`On: ${this.LightBulb.On}`) // Battery Info - if (this.serviceData.battery) { + if ('battery' in this.serviceData) { // BatteryLevel this.Battery.BatteryLevel = this.serviceData.battery this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`) @@ -273,7 +273,7 @@ export class RobotVacuumCleaner extends deviceBase { // Start to monitor advertisement packets (async () => { // Start to monitor advertisement packets - const serviceData = await this.monitorAdvertisementPackets(switchBotBLE) as unknown as robotVacuumCleanerServiceData + const serviceData = await this.monitorAdvertisementPackets(switchBotBLE) as robotVacuumCleanerServiceData // Update HomeKit if (serviceData.model === SwitchBotBLEModel.Unknown && serviceData.modelName === SwitchBotBLEModelName.Unknown) { this.serviceData = serviceData @@ -392,7 +392,7 @@ export class RobotVacuumCleaner extends deviceBase { switchBotBLE .discover({ model: this.device.bleModel, id: this.device.bleMac }) .then(async (device_list: SwitchbotDevice[]) => { - const deviceList = device_list as unknown as SwitchbotDevice[] + const deviceList = device_list as SwitchbotDevice[] this.infoLog(`On: ${this.LightBulb.On}`) return await this.retryBLE({ max: this.maxRetryBLE(), @@ -406,7 +406,7 @@ export class RobotVacuumCleaner extends deviceBase { }) }) .then(async () => { - this.successLog(`On: ${this.LightBulb.On} sent over SwitchBot BLE, sent successfully`) + this.successLog(`On: ${this.LightBulb.On} sent over SwitchBot BLE, sent successfully`) await this.updateHomeKitCharacteristics() }) .catch(async (e: any) => { diff --git a/src/device/waterdetector.ts b/src/device/waterdetector.ts index 9983c194..a393f559 100644 --- a/src/device/waterdetector.ts +++ b/src/device/waterdetector.ts @@ -159,7 +159,7 @@ export class WaterDetector extends deviceBase { this.debugLog(`LeakDetected: ${this.LeakSensor.LeakDetected}`) } // Battery Info - if (this.serviceData.battery) { + if ('battery' in this.serviceData) { // BatteryLevel this.Battery.BatteryLevel = this.serviceData.battery this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`) diff --git a/src/irdevice/airconditioner.ts b/src/irdevice/airconditioner.ts index 6f15efc2..fa56b05f 100644 --- a/src/irdevice/airconditioner.ts +++ b/src/irdevice/airconditioner.ts @@ -186,7 +186,7 @@ export class AirConditioner extends irdeviceBase { } async pushAirConditionerStatusChanges(): Promise { - this.debugLog(`pushAirConditionerStatusChanges Active: ${this.HeaterCooler.Active}, disablePushOff: ${this.disablePushOff}, disablePushOn: ${this.disablePushOn}`) + this.debugLog(`pushAirConditionerStatusChanges Active: ${this.HeaterCooler.Active}, disablePushOff: ${this.disablePushOff}, disablePushOn: ${this.disablePushOn}`) if (!this.Busy) { this.Busy = true this.HeaterCooler.CurrentHeaterCoolerState = this.hap.Characteristic.CurrentHeaterCoolerState.IDLE @@ -198,7 +198,7 @@ export class AirConditioner extends irdeviceBase { } async pushAirConditionerDetailsChanges(): Promise { - this.debugLog(`pushAirConditionerDetailsChanges Active: ${this.HeaterCooler.Active}, disablePushOff: ${this.disablePushOff}, disablePushOn: ${this.disablePushOn}`) + this.debugLog(`pushAirConditionerDetailsChanges Active: ${this.HeaterCooler.Active}, disablePushOff: ${this.disablePushOff}, disablePushOn: ${this.disablePushOn}`) // await this.deviceContext(); if (this.CurrentMode === undefined) { this.CurrentMode = 1 @@ -399,7 +399,7 @@ export class AirConditioner extends irdeviceBase { async TargetHeaterCoolerStateGet(): Promise { const targetState = this.HeaterCooler.TargetHeaterCoolerState || this.accessory.context.TargetHeaterCoolerState this.HeaterCooler.TargetHeaterCoolerState = this.ValidValues.includes(targetState) ? targetState : this.ValidValues[0] - this.debugLog(`Get (${this.getTargetHeaterCoolerStateName()}) TargetHeaterCoolerState: ${this.HeaterCooler.TargetHeaterCoolerState}, ValidValues: ${this.ValidValues}, hide_automode: ${this.hide_automode}`) + this.debugLog(`Get (${this.getTargetHeaterCoolerStateName()}) TargetHeaterCoolerState: ${this.HeaterCooler.TargetHeaterCoolerState}, ValidValues: ${this.ValidValues}, hide_automode: ${this.hide_automode}`) return this.HeaterCooler.TargetHeaterCoolerState } diff --git a/src/irdevice/airpurifier.ts b/src/irdevice/airpurifier.ts index e14127fb..e453de71 100644 --- a/src/irdevice/airpurifier.ts +++ b/src/irdevice/airpurifier.ts @@ -173,7 +173,7 @@ export class AirPurifier extends irdeviceBase { } async pushAirPurifierStatusChanges(): Promise { - this.debugLog(`pushAirPurifierStatusChanges Active: ${this.AirPurifier.Active}, disablePushOff: ${this.disablePushOff}, disablePushOn: ${this.disablePushOn}`) + this.debugLog(`pushAirPurifierStatusChanges Active: ${this.AirPurifier.Active}, disablePushOff: ${this.disablePushOff}, disablePushOn: ${this.disablePushOn}`) if (!this.Busy) { this.Busy = true this.AirPurifier.CurrentHeaterCoolerState = this.hap.Characteristic.CurrentHeaterCoolerState.IDLE @@ -185,7 +185,7 @@ export class AirPurifier extends irdeviceBase { } async pushAirPurifierDetailsChanges(): Promise { - this.debugLog(`pushAirPurifierDetailsChanges Active: ${this.AirPurifier.Active}, disablePushOff: ${this.disablePushOff}, disablePushOn: ${this.disablePushOn}`) + this.debugLog(`pushAirPurifierDetailsChanges Active: ${this.AirPurifier.Active}, disablePushOff: ${this.disablePushOff}, disablePushOn: ${this.disablePushOn}`) this.CurrentAPTemp = this.TemperatureSensor!.CurrentTemperature ?? 24 this.CurrentAPMode = this.CurrentMode ?? 1 this.CurrentAPFanSpeed = this.CurrentFanSpeed ?? 1 diff --git a/src/platform.ts b/src/platform.ts index 72aa3994..47144702 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -589,6 +589,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin { 'MeterPlus': this.createMeterPlus.bind(this), 'Meter Plus (JP)': this.createMeterPlus.bind(this), 'Meter Pro': this.createMeterPro.bind(this), + 'MeterPro(CO2)': this.createMeterPro.bind(this), 'WoIOSensor': this.createIOSensor.bind(this), 'Water Detector': this.createWaterDetector.bind(this), 'Motion Sensor': this.createMotion.bind(this), diff --git a/src/settings.ts b/src/settings.ts index a106f126..b9f3e80f 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -52,7 +52,7 @@ export interface options { logging?: string }; -export type devicesConfig = botConfig | meterConfig | indoorOutdoorSensorConfig | humidifierConfig | curtainConfig | blindTiltConfig | contactConfig | motionConfig | waterDetectorConfig | plugConfig | colorBulbConfig | stripLightConfig | ceilingLightConfig | lockConfig | hubConfig +export type devicesConfig = botConfig | meterConfig | meterProConfig | indoorOutdoorSensorConfig | humidifierConfig | curtainConfig | blindTiltConfig | contactConfig | motionConfig | waterDetectorConfig | plugConfig | colorBulbConfig | stripLightConfig | ceilingLightConfig | lockConfig | hubConfig export interface BaseDeviceConfig extends device { bleMac?: string @@ -96,12 +96,20 @@ export interface botConfig extends BaseDeviceConfig { }; export interface meterConfig extends BaseDeviceConfig { - configDeviceType: 'Meter' | 'MeterPlus' | 'Meter Pro' | 'Meter Pro CO2' + configDeviceType: 'Meter' | 'MeterPlus' hide_temperature?: boolean convertUnitTo?: string hide_humidity?: boolean }; +export interface meterProConfig extends BaseDeviceConfig { + configDeviceType: 'Meter Pro' | 'MeterPro(CO2)' + hide_temperature?: boolean + convertUnitTo?: string + hide_humidity?: boolean + hide_co2?: boolean +}; + export interface indoorOutdoorSensorConfig extends BaseDeviceConfig { configDeviceType: 'WoIOSensor' hide_temperature?: boolean