node-switchbot 4.0.0-beta.1 โ 4.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/copilot-instructions.md +19 -5
- package/BLE.md +117 -4
- package/CHANGELOG.md +45 -0
- package/README.md +7 -1
- package/dist/api.d.ts +3 -3
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +9 -6
- package/dist/api.js.map +1 -1
- package/dist/ble.d.ts +38 -4
- package/dist/ble.d.ts.map +1 -1
- package/dist/ble.js +409 -53
- package/dist/ble.js.map +1 -1
- package/dist/devices/base.d.ts +83 -5
- package/dist/devices/base.d.ts.map +1 -1
- package/dist/devices/base.js +371 -34
- package/dist/devices/base.js.map +1 -1
- package/dist/devices/device-override-state-during-connection.d.ts +27 -0
- package/dist/devices/device-override-state-during-connection.d.ts.map +1 -0
- package/dist/devices/device-override-state-during-connection.js +45 -0
- package/dist/devices/device-override-state-during-connection.js.map +1 -0
- package/dist/devices/index.d.ts +29 -0
- package/dist/devices/index.d.ts.map +1 -1
- package/dist/devices/index.js +29 -0
- package/dist/devices/index.js.map +1 -1
- package/dist/devices/sequence-device.d.ts +36 -0
- package/dist/devices/sequence-device.d.ts.map +1 -0
- package/dist/devices/sequence-device.js +75 -0
- package/dist/devices/sequence-device.js.map +1 -0
- package/dist/devices/wo-air-purifier.d.ts +2 -2
- package/dist/devices/wo-air-purifier.d.ts.map +1 -1
- package/dist/devices/wo-air-purifier.js +2 -2
- package/dist/devices/wo-air-purifier.js.map +1 -1
- package/dist/devices/wo-art-frame.d.ts +8 -0
- package/dist/devices/wo-art-frame.d.ts.map +1 -0
- package/dist/devices/wo-art-frame.js +12 -0
- package/dist/devices/wo-art-frame.js.map +1 -0
- package/dist/devices/wo-bulb.d.ts +10 -0
- package/dist/devices/wo-bulb.d.ts.map +1 -1
- package/dist/devices/wo-bulb.js +69 -0
- package/dist/devices/wo-bulb.js.map +1 -1
- package/dist/devices/wo-circulator-fan.d.ts +8 -0
- package/dist/devices/wo-circulator-fan.d.ts.map +1 -0
- package/dist/devices/wo-circulator-fan.js +12 -0
- package/dist/devices/wo-circulator-fan.js.map +1 -0
- package/dist/devices/wo-climate-panel.d.ts +8 -0
- package/dist/devices/wo-climate-panel.d.ts.map +1 -0
- package/dist/devices/wo-climate-panel.js +12 -0
- package/dist/devices/wo-climate-panel.js.map +1 -0
- package/dist/devices/wo-curtain.d.ts +3 -3
- package/dist/devices/wo-curtain.d.ts.map +1 -1
- package/dist/devices/wo-curtain.js +12 -9
- package/dist/devices/wo-curtain.js.map +1 -1
- package/dist/devices/wo-floor-lamp.d.ts +8 -0
- package/dist/devices/wo-floor-lamp.d.ts.map +1 -0
- package/dist/devices/wo-floor-lamp.js +12 -0
- package/dist/devices/wo-floor-lamp.js.map +1 -0
- package/dist/devices/wo-garage-door-opener.d.ts +8 -0
- package/dist/devices/wo-garage-door-opener.d.ts.map +1 -0
- package/dist/devices/wo-garage-door-opener.js +12 -0
- package/dist/devices/wo-garage-door-opener.js.map +1 -0
- package/dist/devices/wo-hand.d.ts +53 -2
- package/dist/devices/wo-hand.d.ts.map +1 -1
- package/dist/devices/wo-hand.js +121 -3
- package/dist/devices/wo-hand.js.map +1 -1
- package/dist/devices/wo-hubmini-matter.d.ts +8 -0
- package/dist/devices/wo-hubmini-matter.d.ts.map +1 -0
- package/dist/devices/wo-hubmini-matter.js +12 -0
- package/dist/devices/wo-hubmini-matter.js.map +1 -0
- package/dist/devices/wo-humi2.d.ts +12 -0
- package/dist/devices/wo-humi2.d.ts.map +1 -1
- package/dist/devices/wo-humi2.js +18 -0
- package/dist/devices/wo-humi2.js.map +1 -1
- package/dist/devices/wo-keypad-vision-pro.d.ts +18 -0
- package/dist/devices/wo-keypad-vision-pro.d.ts.map +1 -0
- package/dist/devices/wo-keypad-vision-pro.js +15 -0
- package/dist/devices/wo-keypad-vision-pro.js.map +1 -0
- package/dist/devices/wo-keypad-vision.d.ts +8 -0
- package/dist/devices/wo-keypad-vision.d.ts.map +1 -0
- package/dist/devices/wo-keypad-vision.js +12 -0
- package/dist/devices/wo-keypad-vision.js.map +1 -0
- package/dist/devices/wo-lock-lite.d.ts +7 -0
- package/dist/devices/wo-lock-lite.d.ts.map +1 -0
- package/dist/devices/wo-lock-lite.js +11 -0
- package/dist/devices/wo-lock-lite.js.map +1 -0
- package/dist/devices/wo-lock-pro-wifi.d.ts +7 -0
- package/dist/devices/wo-lock-pro-wifi.d.ts.map +1 -0
- package/dist/devices/wo-lock-pro-wifi.js +11 -0
- package/dist/devices/wo-lock-pro-wifi.js.map +1 -0
- package/dist/devices/wo-lock-pro.d.ts +11 -2
- package/dist/devices/wo-lock-pro.d.ts.map +1 -1
- package/dist/devices/wo-lock-pro.js +65 -3
- package/dist/devices/wo-lock-pro.js.map +1 -1
- package/dist/devices/wo-lock-vision-pro.d.ts +7 -0
- package/dist/devices/wo-lock-vision-pro.d.ts.map +1 -0
- package/dist/devices/wo-lock-vision-pro.js +11 -0
- package/dist/devices/wo-lock-vision-pro.js.map +1 -0
- package/dist/devices/wo-lock-vision.d.ts +7 -0
- package/dist/devices/wo-lock-vision.d.ts.map +1 -0
- package/dist/devices/wo-lock-vision.js +11 -0
- package/dist/devices/wo-lock-vision.js.map +1 -0
- package/dist/devices/wo-lock.d.ts +7 -2
- package/dist/devices/wo-lock.d.ts.map +1 -1
- package/dist/devices/wo-lock.js +58 -3
- package/dist/devices/wo-lock.js.map +1 -1
- package/dist/devices/wo-plug-mini-us.d.ts +2 -2
- package/dist/devices/wo-plug-mini-us.d.ts.map +1 -1
- package/dist/devices/wo-plug-mini-us.js +2 -2
- package/dist/devices/wo-plug-mini-us.js.map +1 -1
- package/dist/devices/wo-relay-switch-1.d.ts +4 -2
- package/dist/devices/wo-relay-switch-1.d.ts.map +1 -1
- package/dist/devices/wo-relay-switch-1.js +36 -4
- package/dist/devices/wo-relay-switch-1.js.map +1 -1
- package/dist/devices/wo-relay-switch-2pm.d.ts +21 -0
- package/dist/devices/wo-relay-switch-2pm.d.ts.map +1 -0
- package/dist/devices/wo-relay-switch-2pm.js +39 -0
- package/dist/devices/wo-relay-switch-2pm.js.map +1 -0
- package/dist/devices/wo-rgbic-bulb.d.ts +29 -0
- package/dist/devices/wo-rgbic-bulb.d.ts.map +1 -0
- package/dist/devices/wo-rgbic-bulb.js +84 -0
- package/dist/devices/wo-rgbic-bulb.js.map +1 -0
- package/dist/devices/wo-rgbicww-floor-lamp.d.ts +8 -0
- package/dist/devices/wo-rgbicww-floor-lamp.d.ts.map +1 -0
- package/dist/devices/wo-rgbicww-floor-lamp.js +12 -0
- package/dist/devices/wo-rgbicww-floor-lamp.js.map +1 -0
- package/dist/devices/wo-rgbicww-strip-light.d.ts +8 -0
- package/dist/devices/wo-rgbicww-strip-light.d.ts.map +1 -0
- package/dist/devices/wo-rgbicww-strip-light.js +12 -0
- package/dist/devices/wo-rgbicww-strip-light.js.map +1 -0
- package/dist/devices/wo-roller-shade.d.ts +8 -0
- package/dist/devices/wo-roller-shade.d.ts.map +1 -0
- package/dist/devices/wo-roller-shade.js +12 -0
- package/dist/devices/wo-roller-shade.js.map +1 -0
- package/dist/devices/wo-smart-thermostat-radiator.d.ts +8 -0
- package/dist/devices/wo-smart-thermostat-radiator.d.ts.map +1 -0
- package/dist/devices/wo-smart-thermostat-radiator.js +12 -0
- package/dist/devices/wo-smart-thermostat-radiator.js.map +1 -0
- package/dist/devices/wo-strip-light-3.d.ts +8 -0
- package/dist/devices/wo-strip-light-3.d.ts.map +1 -0
- package/dist/devices/wo-strip-light-3.js +12 -0
- package/dist/devices/wo-strip-light-3.js.map +1 -0
- package/dist/devices/wo-vacuum-k10-plus.d.ts +7 -0
- package/dist/devices/wo-vacuum-k10-plus.d.ts.map +1 -0
- package/dist/devices/wo-vacuum-k10-plus.js +11 -0
- package/dist/devices/wo-vacuum-k10-plus.js.map +1 -0
- package/dist/devices/wo-vacuum-k10-pro-combo.d.ts +7 -0
- package/dist/devices/wo-vacuum-k10-pro-combo.d.ts.map +1 -0
- package/dist/devices/wo-vacuum-k10-pro-combo.js +11 -0
- package/dist/devices/wo-vacuum-k10-pro-combo.js.map +1 -0
- package/dist/devices/wo-vacuum-k10-pro.d.ts +7 -0
- package/dist/devices/wo-vacuum-k10-pro.d.ts.map +1 -0
- package/dist/devices/wo-vacuum-k10-pro.js +11 -0
- package/dist/devices/wo-vacuum-k10-pro.js.map +1 -0
- package/dist/devices/wo-vacuum-k11-plus.d.ts +7 -0
- package/dist/devices/wo-vacuum-k11-plus.d.ts.map +1 -0
- package/dist/devices/wo-vacuum-k11-plus.js +11 -0
- package/dist/devices/wo-vacuum-k11-plus.js.map +1 -0
- package/dist/devices/wo-vacuum-k20.d.ts +7 -0
- package/dist/devices/wo-vacuum-k20.d.ts.map +1 -0
- package/dist/devices/wo-vacuum-k20.js +11 -0
- package/dist/devices/wo-vacuum-k20.js.map +1 -0
- package/dist/devices/wo-vacuum-s10.d.ts +7 -0
- package/dist/devices/wo-vacuum-s10.d.ts.map +1 -0
- package/dist/devices/wo-vacuum-s10.js +11 -0
- package/dist/devices/wo-vacuum-s10.js.map +1 -0
- package/dist/devices/wo-vacuum-s20.d.ts +7 -0
- package/dist/devices/wo-vacuum-s20.d.ts.map +1 -0
- package/dist/devices/wo-vacuum-s20.js +11 -0
- package/dist/devices/wo-vacuum-s20.js.map +1 -0
- package/dist/devices/wo-vacuum.d.ts +44 -0
- package/dist/devices/wo-vacuum.d.ts.map +1 -0
- package/dist/devices/wo-vacuum.js +117 -0
- package/dist/devices/wo-vacuum.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/settings.d.ts +27 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +76 -6
- package/dist/settings.js.map +1 -1
- package/dist/switchbot.d.ts.map +1 -1
- package/dist/switchbot.js +86 -9
- package/dist/switchbot.js.map +1 -1
- package/dist/types/ble.d.ts +20 -1
- package/dist/types/ble.d.ts.map +1 -1
- package/dist/types/ble.js.map +1 -1
- package/dist/types/device.d.ts +49 -3
- package/dist/types/device.d.ts.map +1 -1
- package/dist/types/index.d.ts +22 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/utils/bot-ble.d.ts +36 -0
- package/dist/utils/bot-ble.d.ts.map +1 -0
- package/dist/utils/bot-ble.js +109 -0
- package/dist/utils/bot-ble.js.map +1 -0
- package/dist/utils/circuit-breaker.d.ts +98 -0
- package/dist/utils/circuit-breaker.d.ts.map +1 -0
- package/dist/utils/circuit-breaker.js +187 -0
- package/dist/utils/circuit-breaker.js.map +1 -0
- package/dist/utils/connection-tracker.d.ts +66 -0
- package/dist/utils/connection-tracker.d.ts.map +1 -0
- package/dist/utils/connection-tracker.js +184 -0
- package/dist/utils/connection-tracker.js.map +1 -0
- package/dist/utils/fallback-handler.d.ts +68 -0
- package/dist/utils/fallback-handler.d.ts.map +1 -0
- package/dist/utils/fallback-handler.js +131 -0
- package/dist/utils/fallback-handler.js.map +1 -0
- package/dist/utils/index.d.ts +10 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +41 -4
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/retry.d.ts +55 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/utils/retry.js +95 -0
- package/dist/utils/retry.js.map +1 -0
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/APIError.html +2 -2
- package/docs/classes/APINotAvailableError.html +2 -2
- package/docs/classes/BLEConnection.html +16 -10
- package/docs/classes/BLENotAvailableError.html +2 -2
- package/docs/classes/BLEScanner.html +11 -9
- package/docs/classes/CommandFailedError.html +2 -2
- package/docs/classes/ConnectionTimeoutError.html +2 -2
- package/docs/classes/DeviceManager.html +13 -13
- package/docs/classes/DeviceNotFoundError.html +2 -2
- package/docs/classes/DeviceOverrideStateDuringConnection.html +56 -0
- package/docs/classes/DiscoveryError.html +2 -2
- package/docs/classes/OpenAPIClient.html +24 -24
- package/docs/classes/SequenceDevice.html +58 -0
- package/docs/classes/SwitchBot.html +11 -11
- package/docs/classes/SwitchBotDevice.html +43 -15
- package/docs/classes/SwitchBotError.html +2 -2
- package/docs/classes/ValidationError.html +2 -2
- package/docs/classes/WoAirPurifier.html +48 -18
- package/docs/classes/WoAirPurifierTable.html +48 -18
- package/docs/classes/WoArtFrame.html +71 -0
- package/docs/classes/WoBlindTilt.html +48 -20
- package/docs/classes/WoBulb.html +52 -19
- package/docs/classes/WoCeilingLight.html +52 -19
- package/docs/classes/WoCirculatorFan.html +66 -0
- package/docs/classes/WoClimatePanel.html +66 -0
- package/docs/classes/WoContact.html +42 -14
- package/docs/classes/WoCurtain.html +46 -18
- package/docs/classes/WoFloorLamp.html +71 -0
- package/docs/classes/WoGarageDoorOpener.html +64 -0
- package/docs/classes/WoHand.html +63 -19
- package/docs/classes/WoHub2.html +42 -14
- package/docs/classes/WoHub3.html +42 -14
- package/docs/classes/WoHubMiniMatter.html +56 -0
- package/docs/classes/WoHumi.html +46 -18
- package/docs/classes/WoHumi2.html +52 -18
- package/docs/classes/WoIOSensorTH.html +42 -14
- package/docs/classes/WoKeypad.html +42 -14
- package/docs/classes/WoKeypadVision.html +56 -0
- package/docs/classes/WoKeypadVisionPro.html +56 -0
- package/docs/classes/WoLeak.html +42 -14
- package/docs/classes/WoPlugMiniJP.html +45 -17
- package/docs/classes/WoPlugMiniUS.html +45 -17
- package/docs/classes/WoPresence.html +42 -14
- package/docs/classes/WoRGBICBulb.html +82 -0
- package/docs/classes/WoRGBICWWFloorLamp.html +82 -0
- package/docs/classes/WoRGBICWWStripLight.html +82 -0
- package/docs/classes/WoRelaySwitch1.html +47 -17
- package/docs/classes/WoRelaySwitch1PM.html +47 -17
- package/docs/classes/WoRelaySwitch2PM.html +68 -0
- package/docs/classes/WoRemote.html +42 -14
- package/docs/classes/WoRollerShade.html +64 -0
- package/docs/classes/WoSensorTH.html +42 -14
- package/docs/classes/WoSensorTHPlus.html +42 -14
- package/docs/classes/WoSensorTHPro.html +42 -14
- package/docs/classes/WoSensorTHProCO2.html +42 -14
- package/docs/classes/WoSmartLock.html +49 -16
- package/docs/classes/WoSmartLockLite.html +64 -0
- package/docs/classes/WoSmartLockPro.html +52 -17
- package/docs/classes/WoSmartLockProWiFi.html +68 -0
- package/docs/classes/WoSmartLockVision.html +64 -0
- package/docs/classes/WoSmartLockVisionPro.html +68 -0
- package/docs/classes/WoSmartThermostatRadiator.html +66 -0
- package/docs/classes/WoStrip.html +52 -19
- package/docs/classes/WoStripLight3.html +71 -0
- package/docs/classes/WoVacuum.html +71 -0
- package/docs/classes/WoVacuumK10Plus.html +71 -0
- package/docs/classes/WoVacuumK10Pro.html +71 -0
- package/docs/classes/WoVacuumK10ProCombo.html +71 -0
- package/docs/classes/WoVacuumK11Plus.html +71 -0
- package/docs/classes/WoVacuumK20.html +71 -0
- package/docs/classes/WoVacuumS10.html +71 -0
- package/docs/classes/WoVacuumS20.html +71 -0
- package/docs/enums/LogLevel.html +2 -2
- package/docs/enums/SwitchBotBLEModel.html +2 -2
- package/docs/enums/SwitchBotBLEModelName.html +2 -2
- package/docs/functions/updateBaseURL.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +2 -2
- package/docs/interfaces/APICommandRequest.html +2 -2
- package/docs/interfaces/APICommandResponse.html +2 -2
- package/docs/interfaces/APIDevice.html +2 -2
- package/docs/interfaces/APIDeviceStatus.html +2 -2
- package/docs/interfaces/APIErrorResponse.html +2 -2
- package/docs/interfaces/APIResponse.html +2 -2
- package/docs/interfaces/AirPurifierCommands.html +2 -2
- package/docs/interfaces/AirPurifierServiceData.html +20 -5
- package/docs/interfaces/AirPurifierStatus.html +7 -7
- package/docs/interfaces/BLEAdvertisement.html +3 -2
- package/docs/interfaces/BLEScanOptions.html +5 -5
- package/docs/interfaces/BLEServiceData.html +22 -5
- package/docs/interfaces/BlindTiltCommands.html +2 -2
- package/docs/interfaces/BlindTiltServiceData.html +21 -5
- package/docs/interfaces/BlindTiltStatus.html +6 -6
- package/docs/interfaces/BotCommands.html +6 -2
- package/docs/interfaces/BotServiceData.html +20 -5
- package/docs/interfaces/BotStatus.html +6 -6
- package/docs/interfaces/BulbCommands.html +4 -2
- package/docs/interfaces/BulbServiceData.html +21 -5
- package/docs/interfaces/BulbStatus.html +6 -6
- package/docs/interfaces/CeilingLightCommands.html +4 -2
- package/docs/interfaces/CeilingLightServiceData.html +21 -5
- package/docs/interfaces/CeilingLightStatus.html +6 -6
- package/docs/interfaces/CommandResult.html +6 -6
- package/docs/interfaces/ContactServiceData.html +22 -5
- package/docs/interfaces/ContactStatus.html +6 -6
- package/docs/interfaces/CurtainCommands.html +2 -2
- package/docs/interfaces/CurtainServiceData.html +22 -5
- package/docs/interfaces/CurtainStatus.html +6 -6
- package/docs/interfaces/DeviceInfo.html +23 -13
- package/docs/interfaces/DeviceListResponse.html +2 -2
- package/docs/interfaces/DeviceStatus.html +6 -6
- package/docs/interfaces/DiscoveryOptions.html +7 -7
- package/docs/interfaces/HubServiceData.html +22 -5
- package/docs/interfaces/HubStatus.html +6 -6
- package/docs/interfaces/HumidifierCommands.html +2 -2
- package/docs/interfaces/HumidifierServiceData.html +23 -6
- package/docs/interfaces/HumidifierStatus.html +6 -6
- package/docs/interfaces/KeypadStatus.html +6 -6
- package/docs/interfaces/LeakServiceData.html +22 -5
- package/docs/interfaces/LeakStatus.html +6 -6
- package/docs/interfaces/LockCommands.html +6 -2
- package/docs/interfaces/LockServiceData.html +20 -6
- package/docs/interfaces/LockStatus.html +6 -6
- package/docs/interfaces/MeterServiceData.html +22 -5
- package/docs/interfaces/MeterStatus.html +6 -6
- package/docs/interfaces/MotionServiceData.html +22 -5
- package/docs/interfaces/MotionStatus.html +6 -6
- package/docs/interfaces/PlugCommands.html +2 -2
- package/docs/interfaces/PlugServiceData.html +21 -5
- package/docs/interfaces/PlugStatus.html +6 -6
- package/docs/interfaces/PresenceServiceData.html +22 -5
- package/docs/interfaces/PresenceStatus.html +6 -6
- package/docs/interfaces/RelaySwitchCommands.html +2 -2
- package/docs/interfaces/RelaySwitchServiceData.html +21 -5
- package/docs/interfaces/RelaySwitchStatus.html +6 -6
- package/docs/interfaces/RemoteStatus.html +6 -6
- package/docs/interfaces/SceneListResponse.html +2 -2
- package/docs/interfaces/StripCommands.html +4 -2
- package/docs/interfaces/StripServiceData.html +21 -5
- package/docs/interfaces/StripStatus.html +6 -6
- package/docs/interfaces/SwitchBotConfig.html +21 -9
- package/docs/interfaces/VacuumCommands.html +8 -0
- package/docs/interfaces/VacuumStatus.html +16 -0
- package/docs/interfaces/WebhookConfig.html +2 -2
- package/docs/interfaces/WebhookDetails.html +2 -2
- package/docs/interfaces/WebhookQueryResponse.html +2 -2
- package/docs/interfaces/WebhookSetupResponse.html +2 -2
- package/docs/media/BLE.md +117 -4
- package/docs/modules.html +1 -1
- package/docs/types/ConnectionType.html +1 -1
- package/docs/types/PhysicalDeviceType.html +1 -1
- package/docs/types/VirtualDeviceType.html +1 -1
- package/docs/variables/urls.html +1 -1
- package/package.json +11 -7
- package/tmp-switchbot-scan.mjs +79 -0
- package/todo/PYSWITCHBOT_COMPARISON.md +484 -0
- package/todo/README.md +68 -0
- package/todo/completed.md +309 -0
- package/todo/todo.md +302 -0
- package/tsconfig.build.json +17 -0
- package/PRODUCTION_READY.md +0 -135
package/PRODUCTION_READY.md
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
# Production Readiness Status - v4.0.0
|
|
2
|
-
|
|
3
|
-
## โ
Completed Production Enhancements
|
|
4
|
-
|
|
5
|
-
### ๐ฆ Code Quality
|
|
6
|
-
|
|
7
|
-
- โ
**Build**: TypeScript compilation passes with zero errors
|
|
8
|
-
- โ
**Tests**: 40/40 tests passing (5 test suites)
|
|
9
|
-
- โ
**Lint**: ESLint passes with @antfu/eslint-config rules
|
|
10
|
-
- โ
**Type Safety**: Full TypeScript coverage with strict mode
|
|
11
|
-
- โ
**ES Modules**: Native ES2022 module implementation
|
|
12
|
-
|
|
13
|
-
### ๐ฏ Error Handling
|
|
14
|
-
|
|
15
|
-
- โ
**Custom Error Classes**: 9 specific error types for better debugging
|
|
16
|
-
- `SwitchBotError` (base)
|
|
17
|
-
- `BLENotAvailableError`
|
|
18
|
-
- `APINotAvailableError`
|
|
19
|
-
- `DeviceNotFoundError`
|
|
20
|
-
- `CommandFailedError`
|
|
21
|
-
- `ConnectionTimeoutError`
|
|
22
|
-
- `DiscoveryError`
|
|
23
|
-
- `APIError`
|
|
24
|
-
- `ValidationError`
|
|
25
|
-
- โ
**Error Codes**: Each error has a unique code for programmatic handling
|
|
26
|
-
- โ
**Error Context**: Errors include relevant context (device IDs, connection types, etc.)
|
|
27
|
-
|
|
28
|
-
### ๐ Documentation
|
|
29
|
-
|
|
30
|
-
- โ
**README**: Updated with v4 quick start and migration guide
|
|
31
|
-
- โ
**CHANGELOG**: Comprehensive v4.0.0 release notes
|
|
32
|
-
- โ
**Examples**: 6 complete usage examples
|
|
33
|
-
- `basic-usage.js` - Hybrid BLE + API mode
|
|
34
|
-
- `ble-only.js` - Linux BLE-only mode
|
|
35
|
-
- `api-only.js` - Cross-platform API mode
|
|
36
|
-
- `device-control.js` - All device types
|
|
37
|
-
- `event-handling.js` - Event listeners
|
|
38
|
-
- `typescript-usage.ts` - Type-safe usage
|
|
39
|
-
- โ
**Examples README**: Comprehensive examples documentation
|
|
40
|
-
- โ
**API Docs**: TypeDoc-generated documentation (run `npm run docs`)
|
|
41
|
-
|
|
42
|
-
### ๐งช Testing
|
|
43
|
-
|
|
44
|
-
- โ
**Unit Tests**: 5 test suites covering core functionality
|
|
45
|
-
- Export validation (v4-only, no v3 legacy)
|
|
46
|
-
- Device manager operations
|
|
47
|
-
- Error class behaviors
|
|
48
|
-
- Utility functions
|
|
49
|
-
- Device base functionality
|
|
50
|
-
- โ
**Test Coverage**: Key paths validated
|
|
51
|
-
- โ
**Vitest Config**: Proper test exclusions for .dev-archive
|
|
52
|
-
|
|
53
|
-
### ๐ง Development Tools
|
|
54
|
-
|
|
55
|
-
- โ
**ESLint**: Auto-formatting with lint:fix
|
|
56
|
-
- โ
**TypeScript**: Strict compilation settings
|
|
57
|
-
- โ
**Vitest**: Modern testing framework
|
|
58
|
-
- โ
**TypeDoc**: API documentation generation
|
|
59
|
-
- โ
**NPM Scripts**: Complete build/test/lint workflow
|
|
60
|
-
|
|
61
|
-
### ๐ฆ Package Configuration
|
|
62
|
-
|
|
63
|
-
- โ
**package.json**: Updated to v4.0.0 with correct metadata
|
|
64
|
-
- โ
**.npmignore**: Excludes test/, examples/, .dev-archive/ from npm package
|
|
65
|
-
- โ
**Engine Requirements**: Node.js ^20 || ^22 || ^24
|
|
66
|
-
- โ
**Type Exports**: Full TypeScript definitions exported
|
|
67
|
-
|
|
68
|
-
### ๐๏ธ Architecture
|
|
69
|
-
|
|
70
|
-
- โ
**Hybrid BLE/API**: Unified approach with automatic fallback
|
|
71
|
-
- โ
**Device Manager**: Centralized device access pattern
|
|
72
|
-
- โ
**Event-Driven**: EventEmitter for discovery and commands
|
|
73
|
-
- โ
**30 Device Types**: Full support for all SwitchBot devices
|
|
74
|
-
- โ
**Platform Support**:
|
|
75
|
-
- Linux: Full BLE + API
|
|
76
|
-
- Windows/macOS: API-only (graceful BLE degradation)
|
|
77
|
-
|
|
78
|
-
### ๐ Security
|
|
79
|
-
|
|
80
|
-
- โ
**Credential Handling**: Secure HMAC-SHA256 for API auth
|
|
81
|
-
- โ
**Optional Credentials**: Works in BLE-only mode without API credentials
|
|
82
|
-
- โ
**No Hardcoded Secrets**: Examples use environment variables
|
|
83
|
-
|
|
84
|
-
## ๐ Test Results
|
|
85
|
-
|
|
86
|
-
```
|
|
87
|
-
Test Files 5 passed (5)
|
|
88
|
-
Tests 40 passed (40)
|
|
89
|
-
Duration 431ms
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### Test Coverage Breakdown
|
|
93
|
-
|
|
94
|
-
- โ
`v4-exports.test.ts` (3 tests) - Export validation
|
|
95
|
-
- โ
`device-manager.test.ts` (6 tests) - Device management
|
|
96
|
-
- โ
`errors.test.ts` (15 tests) - Error handling
|
|
97
|
-
- โ
`utils.test.ts` (9 tests) - Utility functions
|
|
98
|
-
- โ
`devices.test.ts` (7 tests) - Device functionality
|
|
99
|
-
|
|
100
|
-
## ๐ข Release Readiness
|
|
101
|
-
|
|
102
|
-
### Pre-Release Checklist
|
|
103
|
-
|
|
104
|
-
- โ
All tests passing
|
|
105
|
-
- โ
Build succeeds
|
|
106
|
-
- โ
Lint passes
|
|
107
|
-
- โ
Documentation complete
|
|
108
|
-
- โ
Examples working
|
|
109
|
-
- โ
CHANGELOG updated
|
|
110
|
-
- โ
README updated
|
|
111
|
-
- โ
No TODO/FIXME comments
|
|
112
|
-
- โ
Type definitions exported
|
|
113
|
-
- โ
Error handling comprehensive
|
|
114
|
-
|
|
115
|
-
### Deployment Steps
|
|
116
|
-
|
|
117
|
-
1. โ
Version bumped to 4.0.0
|
|
118
|
-
2. โ
CHANGELOG updated
|
|
119
|
-
3. โณ Tag release: `git tag v4.0.0`
|
|
120
|
-
4. โณ Push to GitHub: `git push origin latest --tags`
|
|
121
|
-
5. โณ CI will auto-publish to npm via GitHub Actions
|
|
122
|
-
|
|
123
|
-
## ๐ Ready for Production
|
|
124
|
-
|
|
125
|
-
All production readiness criteria have been met. The v4.0.0 codebase is:
|
|
126
|
-
|
|
127
|
-
- โ
**Stable**: All tests passing, no known bugs
|
|
128
|
-
- โ
**Documented**: Comprehensive docs and examples
|
|
129
|
-
- โ
**Type-Safe**: Full TypeScript definitions
|
|
130
|
-
- โ
**Tested**: 40 tests covering core functionality
|
|
131
|
-
- โ
**Clean**: Linted and formatted code
|
|
132
|
-
- โ
**Maintainable**: Clear architecture and error handling
|
|
133
|
-
- โ
**Production-Grade**: Enterprise-ready error handling and logging
|
|
134
|
-
|
|
135
|
-
**Status**: ๐ข PRODUCTION READY
|