node-switchbot 4.0.0-beta.14 → 4.0.0-beta.16
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/dist/ble.d.ts +1 -1
- package/dist/ble.d.ts.map +1 -1
- package/dist/ble.js +32 -26
- package/dist/ble.js.map +1 -1
- package/dist/devices/wo-ai-hub.d.ts +5 -2
- package/dist/devices/wo-ai-hub.d.ts.map +1 -1
- package/dist/devices/wo-ai-hub.js +35 -1
- package/dist/devices/wo-ai-hub.js.map +1 -1
- package/dist/devices/wo-air-purifier-pm25.d.ts +25 -2
- package/dist/devices/wo-air-purifier-pm25.d.ts.map +1 -1
- package/dist/devices/wo-air-purifier-pm25.js +153 -1
- package/dist/devices/wo-air-purifier-pm25.js.map +1 -1
- package/dist/devices/wo-candle-warmer-lamp.d.ts +20 -1
- package/dist/devices/wo-candle-warmer-lamp.d.ts.map +1 -1
- package/dist/devices/wo-candle-warmer-lamp.js +91 -1
- package/dist/devices/wo-candle-warmer-lamp.js.map +1 -1
- package/dist/devices/wo-pan-tilt-cam-plus-3k.d.ts +15 -0
- package/dist/devices/wo-pan-tilt-cam-plus-3k.d.ts.map +1 -1
- package/dist/devices/wo-pan-tilt-cam-plus-3k.js +93 -1
- package/dist/devices/wo-pan-tilt-cam-plus-3k.js.map +1 -1
- package/dist/devices/wo-remote-with-screen.d.ts +3 -0
- package/dist/devices/wo-remote-with-screen.d.ts.map +1 -1
- package/dist/devices/wo-remote-with-screen.js +32 -1
- package/dist/devices/wo-remote-with-screen.js.map +1 -1
- package/dist/devices/wo-rgbic-neon-wire-rope-light.d.ts +25 -2
- package/dist/devices/wo-rgbic-neon-wire-rope-light.d.ts.map +1 -1
- package/dist/devices/wo-rgbic-neon-wire-rope-light.js +123 -1
- package/dist/devices/wo-rgbic-neon-wire-rope-light.js.map +1 -1
- package/dist/devices/wo-water-detector.d.ts +5 -2
- package/dist/devices/wo-water-detector.d.ts.map +1 -1
- package/dist/devices/wo-water-detector.js +30 -1
- package/dist/devices/wo-water-detector.js.map +1 -1
- package/dist/switchbot.d.ts.map +1 -1
- package/dist/switchbot.js +54 -17
- package/dist/switchbot.js.map +1 -1
- package/docs/assets/hierarchy.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 +10 -10
- package/docs/classes/BLENotAvailableError.html +2 -2
- package/docs/classes/BLEScanner.html +9 -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 +34 -34
- package/docs/classes/DiscoveryError.html +2 -2
- package/docs/classes/OpenAPIClient.html +24 -24
- package/docs/classes/SequenceDevice.html +35 -35
- package/docs/classes/SwitchBot.html +11 -11
- package/docs/classes/SwitchBotDevice.html +34 -34
- package/docs/classes/SwitchBotError.html +2 -2
- package/docs/classes/ValidationError.html +2 -2
- package/docs/classes/WoAIHub.html +34 -34
- package/docs/classes/WoAirPurifier.html +40 -40
- package/docs/classes/WoAirPurifierPM25.html +43 -42
- package/docs/classes/WoAirPurifierTable.html +40 -40
- package/docs/classes/WoArtFrame.html +43 -43
- package/docs/classes/WoBlindTilt.html +41 -41
- package/docs/classes/WoBulb.html +43 -43
- package/docs/classes/WoCandleWarmerLamp.html +40 -34
- package/docs/classes/WoCeilingLight.html +43 -43
- package/docs/classes/WoCirculatorFan.html +40 -40
- package/docs/classes/WoClimatePanel.html +40 -40
- package/docs/classes/WoContact.html +34 -34
- package/docs/classes/WoCurtain.html +40 -40
- package/docs/classes/WoFloorLamp.html +43 -43
- package/docs/classes/WoGarageDoorOpener.html +39 -39
- package/docs/classes/WoHand.html +43 -43
- package/docs/classes/WoHub2.html +34 -34
- package/docs/classes/WoHub3.html +34 -34
- package/docs/classes/WoHubMiniMatter.html +34 -34
- package/docs/classes/WoHumi.html +41 -41
- package/docs/classes/WoHumi2.html +41 -41
- package/docs/classes/WoIOSensorTH.html +34 -34
- package/docs/classes/WoKeypad.html +34 -34
- package/docs/classes/WoKeypadVision.html +34 -34
- package/docs/classes/WoKeypadVisionPro.html +34 -34
- package/docs/classes/WoLeak.html +34 -34
- package/docs/classes/WoPanTiltCamPlus3K.html +40 -34
- package/docs/classes/WoPlugMiniJP.html +37 -37
- package/docs/classes/WoPlugMiniUS.html +37 -37
- package/docs/classes/WoPresence.html +34 -34
- package/docs/classes/WoRGBICBulb.html +45 -45
- package/docs/classes/WoRGBICNeonWireRopeLight.html +44 -34
- package/docs/classes/WoRGBICWWFloorLamp.html +45 -45
- package/docs/classes/WoRGBICWWStripLight.html +45 -45
- package/docs/classes/WoRelaySwitch1.html +39 -39
- package/docs/classes/WoRelaySwitch1PM.html +39 -39
- package/docs/classes/WoRelaySwitch2PM.html +41 -41
- package/docs/classes/WoRemote.html +34 -34
- package/docs/classes/WoRemoteWithScreen.html +34 -34
- package/docs/classes/WoRollerShade.html +40 -40
- package/docs/classes/WoSensorTH.html +34 -34
- package/docs/classes/WoSensorTHPlus.html +34 -34
- package/docs/classes/WoSensorTHPro.html +34 -34
- package/docs/classes/WoSensorTHProCO2.html +34 -34
- package/docs/classes/WoSmartLock.html +37 -37
- package/docs/classes/WoSmartLockLite.html +37 -37
- package/docs/classes/WoSmartLockPro.html +39 -39
- package/docs/classes/WoSmartLockProWiFi.html +39 -39
- package/docs/classes/WoSmartLockVision.html +37 -37
- package/docs/classes/WoSmartLockVisionPro.html +39 -39
- package/docs/classes/WoSmartThermostatRadiator.html +40 -40
- package/docs/classes/WoStrip.html +43 -43
- package/docs/classes/WoStripLight3.html +43 -43
- package/docs/classes/WoVacuum.html +42 -42
- package/docs/classes/WoVacuumK10Plus.html +42 -42
- package/docs/classes/WoVacuumK10Pro.html +42 -42
- package/docs/classes/WoVacuumK10ProCombo.html +42 -42
- package/docs/classes/WoVacuumK11Plus.html +42 -42
- package/docs/classes/WoVacuumK20.html +42 -42
- package/docs/classes/WoVacuumS10.html +42 -42
- package/docs/classes/WoVacuumS20.html +42 -42
- package/docs/classes/WoWaterDetector.html +34 -34
- 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/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 +14 -14
- package/docs/interfaces/AirPurifierStatus.html +7 -7
- package/docs/interfaces/BLEAdvertisement.html +5 -5
- package/docs/interfaces/BLEScanOptions.html +5 -5
- package/docs/interfaces/BLEServiceData.html +14 -14
- package/docs/interfaces/BlindTiltCommands.html +2 -2
- package/docs/interfaces/BlindTiltServiceData.html +14 -14
- package/docs/interfaces/BlindTiltStatus.html +6 -6
- package/docs/interfaces/BotCommands.html +2 -2
- package/docs/interfaces/BotServiceData.html +14 -14
- package/docs/interfaces/BotStatus.html +6 -6
- package/docs/interfaces/BulbCommands.html +2 -2
- package/docs/interfaces/BulbServiceData.html +14 -14
- package/docs/interfaces/BulbStatus.html +6 -6
- package/docs/interfaces/CeilingLightCommands.html +2 -2
- package/docs/interfaces/CeilingLightServiceData.html +14 -14
- package/docs/interfaces/CeilingLightStatus.html +6 -6
- package/docs/interfaces/CommandResult.html +6 -6
- package/docs/interfaces/ContactServiceData.html +14 -14
- package/docs/interfaces/ContactStatus.html +6 -6
- package/docs/interfaces/CurtainCommands.html +2 -2
- package/docs/interfaces/CurtainExtendedInfo.html +2 -2
- package/docs/interfaces/CurtainServiceData.html +14 -14
- package/docs/interfaces/CurtainStatus.html +6 -6
- package/docs/interfaces/DeviceInfo.html +18 -18
- 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 +14 -14
- package/docs/interfaces/HubStatus.html +6 -6
- package/docs/interfaces/HumidifierCommands.html +2 -2
- package/docs/interfaces/HumidifierServiceData.html +15 -15
- package/docs/interfaces/HumidifierStatus.html +6 -6
- package/docs/interfaces/KeypadStatus.html +6 -6
- package/docs/interfaces/LeakServiceData.html +14 -14
- package/docs/interfaces/LeakStatus.html +6 -6
- package/docs/interfaces/LockCommands.html +2 -2
- package/docs/interfaces/LockServiceData.html +15 -15
- package/docs/interfaces/LockStatus.html +6 -6
- package/docs/interfaces/MeterServiceData.html +14 -14
- package/docs/interfaces/MeterStatus.html +6 -6
- package/docs/interfaces/MotionServiceData.html +14 -14
- package/docs/interfaces/MotionStatus.html +6 -6
- package/docs/interfaces/PlugCommands.html +2 -2
- package/docs/interfaces/PlugServiceData.html +14 -14
- package/docs/interfaces/PlugStatus.html +6 -6
- package/docs/interfaces/PresenceServiceData.html +14 -14
- package/docs/interfaces/PresenceStatus.html +6 -6
- package/docs/interfaces/RelaySwitchCommands.html +2 -2
- package/docs/interfaces/RelaySwitchServiceData.html +14 -14
- 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 +2 -2
- package/docs/interfaces/StripServiceData.html +14 -14
- package/docs/interfaces/StripStatus.html +6 -6
- package/docs/interfaces/SwitchBotConfig.html +15 -15
- package/docs/interfaces/VacuumCommands.html +2 -2
- package/docs/interfaces/VacuumStatus.html +6 -6
- 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/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 +1 -1
- package/todo/completed.md +15 -1
- package/todo/todo.md +9 -193
- package/todo/completed-task-5.4.md +0 -7
package/docs/variables/urls.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>urls | node-switchbot</title><meta name="description" content="Documentation for node-switchbot"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">node-switchbot</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">urls</a></li></ul><h1>Variable urls<code class="tsd-tag">Const</code></h1></div><div class="tsd-signature"><span class="tsd-kind-variable">urls</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">base</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">devices</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">scenes</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">webhook</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol"> = ...</span></div><div class="tsd-type-declaration"><h4>Type Declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter"><h5 id="base"><span class="tsd-kind-property">base</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5></li><li class="tsd-parameter"><h5 id="devices"><span class="tsd-kind-property">devices</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5></li><li class="tsd-parameter"><h5 id="scenes"><span class="tsd-kind-property">scenes</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5></li><li class="tsd-parameter"><h5 id="webhook"><span class="tsd-kind-property">webhook</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5></li></ul></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>urls | node-switchbot</title><meta name="description" content="Documentation for node-switchbot"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">node-switchbot</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">urls</a></li></ul><h1>Variable urls<code class="tsd-tag">Const</code></h1></div><div class="tsd-signature"><span class="tsd-kind-variable">urls</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">base</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">devices</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">scenes</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">webhook</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol"> = ...</span></div><div class="tsd-type-declaration"><h4>Type Declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter"><h5 id="base"><span class="tsd-kind-property">base</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5></li><li class="tsd-parameter"><h5 id="devices"><span class="tsd-kind-property">devices</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5></li><li class="tsd-parameter"><h5 id="scenes"><span class="tsd-kind-property">scenes</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5></li><li class="tsd-parameter"><h5 id="webhook"><span class="tsd-kind-property">webhook</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5></li></ul></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/node-switchbot/blob/e34d5801a52675f754fc21a3e3f60dba13faa808/src/settings.ts#L20">settings.ts:20</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">node-switchbot</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-switchbot",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.0-beta.
|
|
4
|
+
"version": "4.0.0-beta.16",
|
|
5
5
|
"description": "The node-switchbot is a Node.js module which allows you to control your Switchbot Devices through Bluetooth (BLE) with automatic OpenAPI fallback.",
|
|
6
6
|
"author": "OpenWonderLabs (https://github.com/OpenWonderLabs)",
|
|
7
7
|
"license": "MIT",
|
package/todo/completed.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
### Task 5.4: Add time/energy tracking ✅
|
|
2
|
+
**Completed: March 7, 2026**
|
|
3
|
+
**Implementation Details:**
|
|
4
|
+
- Implemented `getCurrentTimeAndStartTime()` in WoRelaySwitch1 to send BLE command `0x57 0x0F 0x51 0x01 0x05 0x01 0x00 0x00 0x00` and parse the response for current time, start time, and energy.
|
|
5
|
+
- Updated `RelaySwitchCommands` type in `src/types/device.ts` to include the new method.
|
|
6
|
+
- Validated by full build (`npm run build`), lint (`npm run lint`), and test (`npm run test`) cycle: all passed with no errors.
|
|
7
|
+
- See PR/commit: Task 5.4 implementation, March 7, 2026.
|
|
1
8
|
### Task 8.2: Add status with AQI/PM2.5 for air purifiers ✅
|
|
2
9
|
**Completed: March 7, 2026**
|
|
3
10
|
**Implementation Details:**
|
|
@@ -515,13 +522,20 @@ This completes Task 1.5 for advertisement data merging.
|
|
|
515
522
|
- Tests verify EU variant maps to WoPlugMiniUS class and inherits plug control methods
|
|
516
523
|
- Note: WoPlugMiniEU shares implementation with WoPlugMiniUS (regional variant)
|
|
517
524
|
|
|
518
|
-
- [x] Roller Shade (Task 17.2)
|
|
519
525
|
- Added WoRollerShade class extending WoCurtain for motorized window covering control
|
|
520
526
|
- Wired class through exports and SwitchBot runtime DEVICE_CLASSES registry
|
|
521
527
|
- Added device-type mappings: "Roller Shade", "SwitchBot Roller Shade"
|
|
522
528
|
- Added regression coverage in test/roller-shade.test.ts (3 tests)
|
|
523
529
|
- Tests verify device-type mapping and inherited curtain control methods (open, close, pause, setPosition)
|
|
524
530
|
|
|
531
|
+
### Task 5.4: Add time/energy tracking ✅
|
|
532
|
+
**Completed: March 7, 2026**
|
|
533
|
+
**Implementation Details:**
|
|
534
|
+
- Implemented `getCurrentTimeAndStartTime()` in WoRelaySwitch1 to send BLE command `0x57 0x0F 0x51 0x01 0x05 0x01 0x00 0x00 0x00` and parse the response for current time, start time, and energy.
|
|
535
|
+
- Updated `RelaySwitchCommands` type in `src/types/device.ts` to include the new method.
|
|
536
|
+
- Validated by full build (`npm run build`), lint (`npm run lint`), and test (`npm run test`) cycle: all passed with no errors.
|
|
537
|
+
- See PR/commit: Task 5.4 implementation, March 7, 2026.
|
|
538
|
+
|
|
525
539
|
---
|
|
526
540
|
|
|
527
541
|
## Notes
|
package/todo/todo.md
CHANGED
|
@@ -1,195 +1,11 @@
|
|
|
1
|
-
# Completed
|
|
2
|
-
|
|
3
|
-
|
|
4
1
|
# TODO (Prioritized)
|
|
5
2
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
# TODO: pySwitchBot Feature Parity Roadmap
|
|
17
|
-
|
|
18
|
-
Implementation tasks to achieve feature parity with pySwitchBot.
|
|
19
|
-
|
|
20
|
-
Last Updated: March 7, 2026
|
|
21
|
-
Source: [PYSWITCHBOT_COMPARISON.md](./PYSWITCHBOT_COMPARISON.md)
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## 📅 Phase 2: Command Enhancement (Q2 2026)
|
|
26
|
-
|
|
27
|
-
### 🤖 Bot (WoHand) Commands
|
|
28
|
-
|
|
29
|
-
### 🔒 Lock Commands
|
|
30
|
-
|
|
31
|
-
### Task 18.8: Implement key verification ✅
|
|
32
|
-
**Completed: March 7, 2026**
|
|
33
|
-
- Ensures users get immediate feedback on key validity before encrypted operations.
|
|
34
|
-
- See PR/commit: Task 18.8 implementation, March 7, 2026.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
- ✅ Phase 2 completed. See `todo/completed.md` for completed task details.
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
✅ **Phase 3 completed!** All vacuum cleaners, lock variants, power/climate devices, lighting variants, and other devices implemented. See `todo/completed.md` for detailed task completion records.
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
## 📅 Phase 4: Advanced Features (Q4 2026)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
- ✅ Task 6.4 completed. See `todo/completed.md` for implementation details.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
### 💧 Humidifier Commands
|
|
52
|
-
|
|
53
|
-
- ✅ Task 7.1 completed. See `todo/completed.md` for implementation details.
|
|
54
|
-
|
|
55
|
-
<!-- Task 7.2 moved to completed.md -->
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
### 🌬️ Air Purifier Commands
|
|
59
|
-
|
|
60
|
-
<!-- Task 8.1 moved to completed.md -->
|
|
61
|
-
|
|
62
|
-
<!-- Task 8.2 moved to completed.md -->
|
|
63
|
-
|
|
64
|
-
### 🔐 Encryption Enhancements
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
<!-- Task 18.7 moved to completed.md -->
|
|
73
|
-
|
|
74
|
-
- [x] **Task 18.8**: Implement key verification
|
|
75
|
-
- `verifyEncryptionKey()` - Test key validity
|
|
76
|
-
- Try commands with key before assuming valid
|
|
77
|
-
- Better error messages for invalid keys
|
|
78
|
-
|
|
79
|
-
### 📊 Status & Response Parsing
|
|
80
|
-
|
|
81
|
-
- [x] **Task 10.1**: Implement passive status from advertisements ✅
|
|
82
|
-
- Parse device state from BLE advertisements
|
|
83
|
-
- No connection needed for basic status
|
|
84
|
-
- Cache last known state
|
|
85
|
-
|
|
86
|
-
- [x] **Task 10.2**: Add sequence number tracking ✅
|
|
87
|
-
- Monitor `sequence_number` in advertisements
|
|
88
|
-
- Auto-trigger status update when sequence changes
|
|
89
|
-
- Implement for: locks, relay switches, vacuums, air purifiers
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
### 🔗 Connection & Error Improvements
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
- [x] **Task 19.4**: Enhance retry logic
|
|
100
|
-
- DBus error backoff (0.25s)
|
|
101
|
-
- `BLEAK_RETRY_EXCEPTIONS` handling
|
|
102
|
-
- Better context in retry errors
|
|
103
|
-
|
|
104
|
-
- [x] **Task 19.5**: Add response length validation ✅
|
|
105
|
-
- Check minimum expected length
|
|
106
|
-
- Throw errors for truncated responses
|
|
107
|
-
- Include actual vs expected length in error
|
|
108
|
-
|
|
109
|
-
- [x] **Task 20.3**: Implement command batching ✅
|
|
110
|
-
- Queue multiple commands
|
|
111
|
-
- Send in sequence on single connection
|
|
112
|
-
- Share connection overhead
|
|
113
|
-
|
|
114
|
-
- `_expected_disconnect` flag
|
|
115
|
-
- Differentiate expected vs unexpected disconnects
|
|
116
|
-
- Better error handling for unexpected disconnects
|
|
117
|
-
|
|
118
|
-
- Per-command notification futures
|
|
119
|
-
- Timeout handling (5s default)
|
|
120
|
-
- Log unsolicited notifications
|
|
121
|
-
|
|
122
|
-
- Cache read/write characteristics
|
|
123
|
-
- Clear cache on characteristic missing error
|
|
124
|
-
- Avoid repeated characteristic discovery
|
|
125
|
-
### 🎯 Advanced Patterns
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
## 📈 Medium Priority Enhancements
|
|
134
|
-
|
|
135
|
-
## 🏆 High Priority
|
|
136
|
-
|
|
137
|
-
- [ ] **Task 1.4**: Enhance advertisement data structure
|
|
138
|
-
- Add `rawAdvData` field
|
|
139
|
-
- Add `isEncrypted` flag
|
|
140
|
-
- Add `modelFriendlyName` field
|
|
141
|
-
|
|
142
|
-
- [ ] **Task 1.5**: Add advertisement data merging
|
|
143
|
-
- Preserve old values when new data is None
|
|
144
|
-
- Recursive dict merging for nested structures
|
|
145
|
-
- Implement `_merge_data()` helper
|
|
146
|
-
|
|
147
|
-
## ⭐ Medium Priority
|
|
148
|
-
|
|
149
|
-
- [ ] **Task 5.4**: Add time/energy tracking
|
|
150
|
-
- `getCurrentTimeAndStartTime()` - For energy calculations
|
|
151
|
-
- Command: `0x57 0x0F 0x51 0x01 0x05 0x01 0x00 0x00 0x00`
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
### Status Parsing
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
---
|
|
158
|
-
|
|
159
|
-
## 🎯 Success Metrics
|
|
160
|
-
|
|
161
|
-
- **Feature Parity**: 90%+ of pySwitchBot commands implemented
|
|
162
|
-
- **Device Coverage**: 95%+ of SwitchBot device types supported
|
|
163
|
-
- **Status Accuracy**: Advertisement-based status for all devices
|
|
164
|
-
- **Connection Efficiency**: 50% reduction in connection overhead via batching
|
|
165
|
-
- **Error Clarity**: Specific error types for all failure modes
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
## 📝 Notes
|
|
170
|
-
|
|
171
|
-
### Task Completion Process
|
|
172
|
-
1. Move completed task from this file to `completed.md`
|
|
173
|
-
2. Add completion date and any notes
|
|
174
|
-
3. Update "Last Updated" timestamp
|
|
175
|
-
4. Reference any relevant PRs or commits
|
|
176
|
-
|
|
177
|
-
### Priority Levels
|
|
178
|
-
- **High Priority**: Core functionality, user-facing features
|
|
179
|
-
- **Medium Priority**: Enhancements, optimizations
|
|
180
|
-
- **Low Priority**: Nice-to-have features
|
|
181
|
-
|
|
182
|
-
### Reference
|
|
183
|
-
- Full comparison details: [PYSWITCHBOT_COMPARISON.md](../PYSWITCHBOT_COMPARISON.md)
|
|
184
|
-
- pySwitchBot Repository: https://github.com/Danielhiversen/pySwitchbot
|
|
185
|
-
- SwitchBot BLE API: https://github.com/OpenWonderLabs/SwitchBotAPI-BLE
|
|
186
|
-
|
|
187
|
-
---
|
|
188
|
-
|
|
189
|
-
## 📋 Todo List
|
|
190
|
-
|
|
191
|
-
- [x] Enhance retry logic: DBus backoff, BLEAK exceptions, error context
|
|
192
|
-
- [x] Add/expand tests for retry logic (DBus, BLEAK, error context)
|
|
193
|
-
- [x] Add response length validation (min length, error for truncated, actual vs expected)
|
|
194
|
-
- [x] Implement command batching (queue, sequence, share connection)
|
|
195
|
-
- [x] Implement expected disconnect tracking (track disconnects that are expected as part of command flow)
|
|
3
|
+
- 1. [ ] **Device Support & Extensibility**: Expand device support, add extension mechanism, and document device extension patterns.
|
|
4
|
+
- 2. [ ] **Unified BLE-first/API-fallback Logic**: Centralize fallback logic, allow user configuration, and document clearly.
|
|
5
|
+
- 3. [ ] **Error Handling & Reporting**: Standardize error types/messages, use custom error classes, and document error codes.
|
|
6
|
+
- 4. [ ] **Test Coverage & Quality**: Add tests for all device types, fallback logic, and error scenarios using mocks.
|
|
7
|
+
- 5. [ ] **Documentation & Examples**: Expand device support matrix, advanced usage, and TypeDoc comments; add more real-world examples.
|
|
8
|
+
- 6. [ ] **API Consistency & Usability**: Unify method signatures, naming, and async usage; deprecate ambiguous APIs.
|
|
9
|
+
- 7. [ ] **Configuration & Environment Detection**: Improve auto-detection and user overrides for BLE/API, adapters, and timeouts.
|
|
10
|
+
- 8. [ ] **Type Safety & Linting**: Enforce strict TypeScript and linting in CI.
|
|
11
|
+
- 9. [ ] **Advanced Features**: Add event-driven updates, batch/group operations, and a plugin system for custom logic.
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
### Task 5.4: Add time/energy tracking ✅
|
|
2
|
-
**Completed: March 7, 2026**
|
|
3
|
-
**Implementation Details:**
|
|
4
|
-
- Implemented `getCurrentTimeAndStartTime()` in WoRelaySwitch1 to send BLE command `0x57 0x0F 0x51 0x01 0x05 0x01 0x00 0x00 0x00` and parse the response for current time, start time, and energy.
|
|
5
|
-
- Updated `RelaySwitchCommands` type in `src/types/device.ts` to include the new method.
|
|
6
|
-
- Validated by full build (`npm run build`), lint (`npm run lint`), and test (`npm run test`) cycle: all passed with no errors.
|
|
7
|
-
- See PR/commit: Task 5.4 implementation, March 7, 2026.
|