node-switchbot 4.0.0-beta.16 → 4.0.0-beta.18
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/devices/base.d.ts +52 -1
- package/dist/devices/base.d.ts.map +1 -1
- package/dist/devices/base.js +85 -1
- package/dist/devices/base.js.map +1 -1
- package/dist/devices/sequence-device.d.ts +16 -0
- package/dist/devices/sequence-device.d.ts.map +1 -1
- package/dist/devices/sequence-device.js +16 -0
- package/dist/devices/sequence-device.js.map +1 -1
- package/dist/devices/wo-ai-hub.d.ts +1 -1
- package/dist/devices/wo-ai-hub.d.ts.map +1 -1
- package/dist/devices/wo-ai-hub.js +17 -33
- package/dist/devices/wo-ai-hub.js.map +1 -1
- package/dist/devices/wo-air-purifier-pm25.d.ts +1 -1
- package/dist/devices/wo-air-purifier-pm25.d.ts.map +1 -1
- package/dist/devices/wo-air-purifier-pm25.js +35 -50
- package/dist/devices/wo-air-purifier-pm25.js.map +1 -1
- package/dist/devices/wo-air-purifier.d.ts +1 -1
- package/dist/devices/wo-air-purifier.d.ts.map +1 -1
- package/dist/devices/wo-air-purifier.js +39 -53
- package/dist/devices/wo-air-purifier.js.map +1 -1
- package/dist/devices/wo-blind-tilt.d.ts +2 -17
- package/dist/devices/wo-blind-tilt.d.ts.map +1 -1
- package/dist/devices/wo-blind-tilt.js +128 -94
- package/dist/devices/wo-blind-tilt.js.map +1 -1
- package/dist/devices/wo-bulb.d.ts +1 -1
- package/dist/devices/wo-bulb.d.ts.map +1 -1
- package/dist/devices/wo-bulb.js +35 -49
- package/dist/devices/wo-bulb.js.map +1 -1
- package/dist/devices/wo-candle-warmer-lamp.d.ts +1 -1
- package/dist/devices/wo-candle-warmer-lamp.d.ts.map +1 -1
- package/dist/devices/wo-candle-warmer-lamp.js +14 -30
- package/dist/devices/wo-candle-warmer-lamp.js.map +1 -1
- package/dist/devices/wo-contact.d.ts +1 -1
- package/dist/devices/wo-contact.d.ts.map +1 -1
- package/dist/devices/wo-contact.js +19 -35
- package/dist/devices/wo-contact.js.map +1 -1
- package/dist/devices/wo-curtain.d.ts.map +1 -1
- package/dist/devices/wo-curtain.js +40 -52
- package/dist/devices/wo-curtain.js.map +1 -1
- package/dist/devices/wo-hand.d.ts +4 -4
- package/dist/devices/wo-hand.d.ts.map +1 -1
- package/dist/devices/wo-hand.js +24 -37
- package/dist/devices/wo-hand.js.map +1 -1
- package/dist/devices/wo-hub2.d.ts +1 -1
- package/dist/devices/wo-hub2.d.ts.map +1 -1
- package/dist/devices/wo-hub2.js +17 -33
- package/dist/devices/wo-hub2.js.map +1 -1
- package/dist/devices/wo-humi.d.ts +1 -1
- package/dist/devices/wo-humi.d.ts.map +1 -1
- package/dist/devices/wo-humi.js +21 -37
- package/dist/devices/wo-humi.js.map +1 -1
- package/dist/devices/wo-keypad.d.ts +1 -1
- package/dist/devices/wo-keypad.d.ts.map +1 -1
- package/dist/devices/wo-keypad.js +14 -30
- package/dist/devices/wo-keypad.js.map +1 -1
- package/dist/devices/wo-leak.d.ts +1 -1
- package/dist/devices/wo-leak.d.ts.map +1 -1
- package/dist/devices/wo-leak.js +15 -31
- package/dist/devices/wo-leak.js.map +1 -1
- package/dist/devices/wo-lock-pro.d.ts +1 -1
- package/dist/devices/wo-lock-pro.d.ts.map +1 -1
- package/dist/devices/wo-lock-pro.js +19 -35
- package/dist/devices/wo-lock-pro.js.map +1 -1
- package/dist/devices/wo-lock.d.ts +1 -1
- package/dist/devices/wo-lock.d.ts.map +1 -1
- package/dist/devices/wo-lock.js +18 -34
- package/dist/devices/wo-lock.js.map +1 -1
- package/dist/devices/wo-pan-tilt-cam-plus-3k.d.ts +1 -1
- package/dist/devices/wo-pan-tilt-cam-plus-3k.d.ts.map +1 -1
- package/dist/devices/wo-pan-tilt-cam-plus-3k.js +16 -28
- package/dist/devices/wo-pan-tilt-cam-plus-3k.js.map +1 -1
- package/dist/devices/wo-plug-mini-us.d.ts +1 -1
- package/dist/devices/wo-plug-mini-us.d.ts.map +1 -1
- package/dist/devices/wo-plug-mini-us.js +23 -33
- package/dist/devices/wo-plug-mini-us.js.map +1 -1
- package/dist/devices/wo-presence.d.ts +1 -1
- package/dist/devices/wo-presence.d.ts.map +1 -1
- package/dist/devices/wo-presence.js +17 -33
- package/dist/devices/wo-presence.js.map +1 -1
- package/dist/devices/wo-relay-switch-1.d.ts +1 -1
- package/dist/devices/wo-relay-switch-1.d.ts.map +1 -1
- package/dist/devices/wo-relay-switch-1.js +19 -40
- package/dist/devices/wo-relay-switch-1.js.map +1 -1
- package/dist/devices/wo-remote-with-screen.d.ts +1 -1
- package/dist/devices/wo-remote-with-screen.d.ts.map +1 -1
- package/dist/devices/wo-remote-with-screen.js +14 -30
- package/dist/devices/wo-remote-with-screen.js.map +1 -1
- package/dist/devices/wo-remote.d.ts +1 -1
- package/dist/devices/wo-remote.d.ts.map +1 -1
- package/dist/devices/wo-remote.js +13 -29
- package/dist/devices/wo-remote.js.map +1 -1
- package/dist/devices/wo-rgbic-bulb.d.ts +1 -1
- package/dist/devices/wo-rgbic-bulb.js +1 -1
- package/dist/devices/wo-rgbic-neon-wire-rope-light.d.ts +1 -1
- package/dist/devices/wo-rgbic-neon-wire-rope-light.d.ts.map +1 -1
- package/dist/devices/wo-rgbic-neon-wire-rope-light.js +18 -34
- package/dist/devices/wo-rgbic-neon-wire-rope-light.js.map +1 -1
- package/dist/devices/wo-sensor-th.d.ts +1 -1
- package/dist/devices/wo-sensor-th.d.ts.map +1 -1
- package/dist/devices/wo-sensor-th.js +18 -34
- package/dist/devices/wo-sensor-th.js.map +1 -1
- package/dist/devices/wo-vacuum.d.ts +3 -3
- package/dist/devices/wo-vacuum.d.ts.map +1 -1
- package/dist/devices/wo-vacuum.js +69 -43
- package/dist/devices/wo-vacuum.js.map +1 -1
- package/dist/devices/wo-water-detector.d.ts +1 -1
- package/dist/devices/wo-water-detector.d.ts.map +1 -1
- package/dist/devices/wo-water-detector.js +12 -28
- package/dist/devices/wo-water-detector.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/switchbot.d.ts +1 -0
- package/dist/switchbot.d.ts.map +1 -1
- package/dist/switchbot.js +43 -30
- package/dist/switchbot.js.map +1 -1
- package/dist/types/index.d.ts +18 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +6 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +23 -0
- package/dist/utils/index.js.map +1 -1
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/highlight.css +7 -0
- 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 +33 -34
- package/docs/classes/DiscoveryError.html +2 -2
- package/docs/classes/OpenAPIClient.html +24 -24
- package/docs/classes/SequenceDevice.html +42 -35
- package/docs/classes/SwitchBot.html +11 -11
- package/docs/classes/SwitchBotDevice.html +68 -36
- package/docs/classes/SwitchBotError.html +2 -2
- package/docs/classes/ValidationError.html +2 -2
- package/docs/classes/WoAIHub.html +69 -36
- package/docs/classes/WoAirPurifier.html +40 -40
- package/docs/classes/WoAirPurifierPM25.html +73 -40
- package/docs/classes/WoAirPurifierTable.html +40 -40
- package/docs/classes/WoArtFrame.html +43 -43
- package/docs/classes/WoBlindTilt.html +35 -42
- package/docs/classes/WoBulb.html +43 -43
- package/docs/classes/WoCandleWarmerLamp.html +72 -39
- 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 +39 -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 +72 -39
- 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 +74 -41
- 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 +69 -36
- package/docs/classes/WoRollerShade.html +39 -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 +69 -36
- 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 +25 -16
- 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 +3 -4
- package/todo/todo.md +14 -10
- package/todo/PYSWITCHBOT_COMPARISON.md +0 -479
- package/todo/README.md +0 -68
- package/todo/completed.md +0 -549
package/todo/completed.md
DELETED
|
@@ -1,549 +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.
|
|
8
|
-
### Task 8.2: Add status with AQI/PM2.5 for air purifiers ✅
|
|
9
|
-
**Completed: March 7, 2026**
|
|
10
|
-
**Implementation Details:**
|
|
11
|
-
- WoAirPurifier getStatus() returns pm25 and airQuality fields from both API and BLE.
|
|
12
|
-
- Air quality index is parsed and mapped to 'excellent', 'good', 'fair', or 'poor'.
|
|
13
|
-
- Fan speed and mode are also included in status.
|
|
14
|
-
- Validated by build, test, and lint cycle.
|
|
15
|
-
- See PR/commit: Task 8.2 implementation, March 7, 2026.
|
|
16
|
-
|
|
17
|
-
### Task 8.1: Add preset modes for air purifiers ✅
|
|
18
|
-
**Completed: March 7, 2026**
|
|
19
|
-
**Implementation Details:**
|
|
20
|
-
- WoAirPurifier implements setPresetMode() for BLE, supporting all required preset modes: level_1, level_2, level_3, auto, sleep, pet.
|
|
21
|
-
- Command mapping matches roadmap requirements and is validated by build, test, and lint cycle.
|
|
22
|
-
- See PR/commit: Task 8.1 implementation, March 7, 2026.
|
|
23
|
-
|
|
24
|
-
### Task 7.2: Add mode control for humidifiers ✅
|
|
25
|
-
**Completed: March 7, 2026**
|
|
26
|
-
**Implementation Details:**
|
|
27
|
-
- WoHumi and WoHumi2 implement setAuto(), setManual(), and getTargetLevel().
|
|
28
|
-
- Mode control and target humidity level are available via BLE and API.
|
|
29
|
-
- Methods: setAuto(), setManual(), setMode(), setLevel(), getTargetLevel().
|
|
30
|
-
- Validated by build, test, and lint cycle.
|
|
31
|
-
- See PR/commit: Task 7.2 implementation, March 7, 2026.
|
|
32
|
-
|
|
33
|
-
### Task 18.7: Add encryption state reset on disconnect ✅
|
|
34
|
-
**Completed: March 7, 2026**
|
|
35
|
-
**Implementation Details:**
|
|
36
|
-
- BLEConnection now clears all encryption state (IV, cipher, mode) for a device on disconnect, ensuring fresh initialization on next connect.
|
|
37
|
-
- Applies to all encryption-enabled devices (relay switches, air purifiers, light strips, etc.).
|
|
38
|
-
- Validated by full build, test, and lint cycle. All encryption and cleanup tests pass.
|
|
39
|
-
- See PR/commit: Task 18.7 implementation, March 7, 2026.
|
|
40
|
-
### Task 18.6: Add encryption for light strips ✅
|
|
41
|
-
**Completed: March 7, 2026**
|
|
42
|
-
**Implementation Details:**
|
|
43
|
-
- WoBulb, WoStrip, and WoStripLight3 now support BLE encryption using a 16-byte key (encryptionKey) and optional IV/mode, following the relay/lock/air purifier pattern.
|
|
44
|
-
- All BLE commands (turnOn, turnOff, setBrightness, setColor, setEffect, etc.) are encrypted if encryptionKey is present in device info.
|
|
45
|
-
- Utility used: src/utils/relay-encryption.ts for AES-128-CTR encryption and command formatting.
|
|
46
|
-
- Tests: test/strip-encryption.test.ts validates encrypted and plain command sending.
|
|
47
|
-
- All tests passing, lint clean after lint:fix.
|
|
48
|
-
- See PR/commit: Task 18.6 implementation, March 7, 2026.
|
|
49
|
-
|
|
50
|
-
### Task 18.5: Add encryption for air purifiers ✅
|
|
51
|
-
**Completed: March 7, 2026**
|
|
52
|
-
**Implementation Details:**
|
|
53
|
-
- WoAirPurifier now supports BLE encryption using a 16-byte key (encryptionKey) and optional IV/mode, following the relay/lock pattern.
|
|
54
|
-
- All BLE commands (turnOn, turnOff, setMode, setFanSpeed, setPresetMode) are encrypted if encryptionKey is present in device info.
|
|
55
|
-
- Utility used: src/utils/relay-encryption.ts for AES-128-CTR encryption and command formatting.
|
|
56
|
-
- Tests: test/airpurifier-encryption.test.ts validates encrypted and plain command sending.
|
|
57
|
-
- All tests passing, lint clean after lint:fix.
|
|
58
|
-
- See PR/commit: Task 18.5 implementation, March 7, 2026.
|
|
59
|
-
|
|
60
|
-
### Task 18.4: Add encryption for relay switches ✅
|
|
61
|
-
**Completed: March 7, 2026**
|
|
62
|
-
**Implementation Details:**
|
|
63
|
-
- Relay switch device classes (WoRelaySwitch1, WoRelaySwitch1PM, WoRelaySwitch2PM) now support BLE encryption using a 16-byte key (encryptionKey) and optional IV/mode, following the lock pattern.
|
|
64
|
-
- All relay switch commands (including channel control) are encrypted if encryptionKey is present in device info.
|
|
65
|
-
- Utility added: src/utils/relay-encryption.ts for AES-128-CTR encryption and command formatting.
|
|
66
|
-
- Tests: test/relay-encryption.test.ts validates encrypted and plain command sending; test/relay-2pm-channel-control.test.ts updated for Buffer compatibility.
|
|
67
|
-
- All tests passing, lint clean after lint:fix.
|
|
68
|
-
- See PR/commit: Task 18.4 implementation, March 7, 2026.
|
|
69
|
-
|
|
70
|
-
### Task 10.3: Add calibration status tracking ✅
|
|
71
|
-
**Completed: March 7, 2026**
|
|
72
|
-
**Implementation Details:**
|
|
73
|
-
- WoCurtain and WoBlindTilt now parse the calibration bit from BLE advertisements and include a `calibrated` property in their status objects.
|
|
74
|
-
- BlindTiltStatus type updated to include `calibrated?: boolean`.
|
|
75
|
-
- Devices log a warning if not calibrated.
|
|
76
|
-
- Validated by build, test, and lint cycle.
|
|
77
|
-
- See PR/commit: Task 10.3 implementation, March 7, 2026.
|
|
78
|
-
|
|
79
|
-
### Task 10.4: Add direction detection for covers ✅
|
|
80
|
-
**Completed: March 7, 2026**
|
|
81
|
-
**Implementation Details:**
|
|
82
|
-
- WoCurtain and WoBlindTilt now track direction ('opening' or 'closing') by comparing the current position to the previous position in getStatus().
|
|
83
|
-
- The status object for both devices includes a `direction` property.
|
|
84
|
-
- This enables UI and integrations to show proper movement icons and states.
|
|
85
|
-
- Validated by build, test, and lint cycle.
|
|
86
|
-
- See PR/commit: Task 10.4 implementation, March 7, 2026.
|
|
87
|
-
|
|
88
|
-
### Task 19.1: Add specific BLE exceptions ✅
|
|
89
|
-
**Completed: March 7, 2026**
|
|
90
|
-
**Implementation Details:**
|
|
91
|
-
- Added SwitchbotOperationError for generic BLE operation failures.
|
|
92
|
-
- Added SwitchbotAuthenticationError for BLE authentication/encryption key failures.
|
|
93
|
-
- Added CharacteristicMissingError for missing BLE characteristics.
|
|
94
|
-
- All new error classes extend SwitchBotError and provide clear error codes and messages.
|
|
95
|
-
- Validated by build, test, and lint cycle.
|
|
96
|
-
- See PR/commit: Task 19.1 implementation, March 7, 2026.
|
|
97
|
-
|
|
98
|
-
### Task 19.4: Add/expand tests for retry logic (DBus, BLEAK, error context) ✅
|
|
99
|
-
**Completed: March 7, 2026**
|
|
100
|
-
**Implementation Details:**
|
|
101
|
-
- Expanded test/utils.retry.test.ts to cover DBus error backoff, BLEAK_RETRY_EXCEPTIONS, and enhanced error context.
|
|
102
|
-
- Validated that retry logic triggers correct backoff and error handling for all relevant error types.
|
|
103
|
-
- All tests pass, build and lint are clean.
|
|
104
|
-
- See PR/commit: Task 19.4 implementation, March 7, 2026.
|
|
105
|
-
|
|
106
|
-
### Task 19.5: Add response length validation ✅
|
|
107
|
-
**Completed: March 7, 2026**
|
|
108
|
-
**Implementation Details:**
|
|
109
|
-
- Added validateResponseLength utility to src/utils/index.ts.
|
|
110
|
-
- Applied response length checks to relay, bulb, and air purifier BLE status parsing.
|
|
111
|
-
- Throws descriptive error if response is truncated (shows actual vs expected length and context).
|
|
112
|
-
- All tests pass, build and lint are clean (only style warnings remain).
|
|
113
|
-
- See PR/commit: Task 19.5 implementation, March 7, 2026.
|
|
114
|
-
|
|
115
|
-
### Task 20.5: Implement notification handling ✅
|
|
116
|
-
**Completed: March 7, 2026**
|
|
117
|
-
**Implementation Details:**
|
|
118
|
-
- BLEConnection now supports per-command notification futures with timeout handling (default 5s, configurable).
|
|
119
|
-
- Unsolicited notifications are logged with device MAC and payload.
|
|
120
|
-
- Test: test/ble-notification-handling.test.ts covers notification futures, timeout, and unsolicited log.
|
|
121
|
-
- Validated by build, test, and lint cycle.
|
|
122
|
-
- See PR/commit: Task 20.5 implementation, March 7, 2026.
|
|
123
|
-
|
|
124
|
-
### Task 21.3: Add multi-command support ✅
|
|
125
|
-
**Completed: March 7, 2026**
|
|
126
|
-
**Implementation Details:**
|
|
127
|
-
- Added sendMultipleCommands() and sendCommandSequence() to Curtain 3, WoBulb, WoStrip, and other multi-command devices.
|
|
128
|
-
- sendMultipleCommands: Sends a series of commands, returns true if any succeed, false if all fail.
|
|
129
|
-
- sendCommandSequence: Sends a series of commands, stops and returns false if any fail, true if all succeed.
|
|
130
|
-
- Used for Curtain 3, light devices, and all newer multi-command models.
|
|
131
|
-
- Fully tested in test/curtain3-features.test.ts and test/light-multi-command.test.ts (all tests pass).
|
|
132
|
-
- Validated by build, test, and lint cycle.
|
|
133
|
-
- See PR/commit: Task 21.3 implementation, March 7, 2026.
|
|
134
|
-
|
|
135
|
-
### Task 21.4: Implement basic settings command (getBasicInfo) ✅
|
|
136
|
-
**Completed: March 7, 2026**
|
|
137
|
-
**Implementation Details:**
|
|
138
|
-
- Universal method `getBasicInfo()` implemented in base device class.
|
|
139
|
-
- Uses BLE command [0x57, 0x02] or API fallback.
|
|
140
|
-
- Added full JSDoc documentation and a dedicated test file for BLE, API, and error cases.
|
|
141
|
-
- Validated by build, test, and lint cycle.
|
|
142
|
-
- See PR/commit: Task 21.4 implementation, March 7, 2026.
|
|
143
|
-
|
|
144
|
-
### Task 21.5: Add mode setting commands ✅
|
|
145
|
-
**Completed: March 7, 2026**
|
|
146
|
-
**Implementation Details:**
|
|
147
|
-
- Universal setMode command implemented in SwitchBotDevice base and all relevant device classes.
|
|
148
|
-
- Supports BLE (0x57 0x03) and API ('setMode') for all devices with mode support.
|
|
149
|
-
- Per-device mode enums/types (e.g., 'press'/'switch', 'auto'/'manual', etc.)
|
|
150
|
-
- Extended settings and universal mode command available for Curtain 3, WoHand, WoHumi, WoAirPurifier, and others.
|
|
151
|
-
- Fully tested in test/set-mode.test.ts, test/humidifier-mode-control.test.ts, test/wo-hand.test.ts, and test/airpurifier-status.test.ts.
|
|
152
|
-
- Validated by build, test, and lint cycle.
|
|
153
|
-
- See PR/commit: Task 21.5 implementation, March 7, 2026.
|
|
154
|
-
|
|
155
|
-
### Task 21.6: Add passive polling ✅
|
|
156
|
-
**Completed: March 7, 2026**
|
|
157
|
-
**Implementation Details:**
|
|
158
|
-
- Added PASSIVE_POLL_INTERVAL constant (24 hours) and pollNeeded() method to SwitchBotDevice base class.
|
|
159
|
-
- pollIfNeeded() method polls device status only if interval elapsed.
|
|
160
|
-
- lastPolledAt timestamp tracks last poll per device.
|
|
161
|
-
- Fully tested in test/passive-polling.test.ts (all tests pass).
|
|
162
|
-
- Validated by build, test, and lint cycle.
|
|
163
|
-
- See PR/commit: Task 21.6 implementation, March 7, 2026.
|
|
164
|
-
|
|
165
|
-
### Task 21.7: Implement cloud device fetching ✅
|
|
166
|
-
**Completed: March 7, 2026**
|
|
167
|
-
**Implementation Details:**
|
|
168
|
-
- OpenAPIClient.getDevices() fetches devices from the SwitchBot account.
|
|
169
|
-
- Model cache is auto-populated from cloud device list.
|
|
170
|
-
- Regional API support (US/CN/EU) handled via baseURL and settings.
|
|
171
|
-
- Fully tested in openapi-get-devices.test.ts and related tests.
|
|
172
|
-
- Validated by build, test, and lint cycle.
|
|
173
|
-
- See PR/commit: Task 21.7 implementation, March 7, 2026.
|
|
174
|
-
|
|
175
|
-
### Task 11.1: Add byte-by-byte response validation ✅
|
|
176
|
-
**Completed: March 7, 2026**
|
|
177
|
-
**Implementation Details:**
|
|
178
|
-
- validateResponseLength utility and explicit byte checks implemented in device parsers (WoRelaySwitch1, WoBulb, WoAirPurifier, etc.).
|
|
179
|
-
- Ensures response length and byte values are validated for all BLE/API responses.
|
|
180
|
-
- Fully tested in device and error handling tests.
|
|
181
|
-
- Validated by build, test, and lint cycle.
|
|
182
|
-
- See PR/commit: Task 11.1 implementation, March 7, 2026.
|
|
183
|
-
|
|
184
|
-
### Task 1.5: Add advertisement data merging
|
|
185
|
-
|
|
186
|
-
**Completed:** March 7, 2026
|
|
187
|
-
|
|
188
|
-
- Implemented `deepMerge` utility for recursive object merging (src/utils/index.ts)
|
|
189
|
-
- Added `mergeAdvertisement` helper for BLEAdvertisement objects (src/utils/index.ts)
|
|
190
|
-
- Integrated merging logic into BLE discovery: new advertisements are recursively merged with previous data, preserving old values when new are null/undefined
|
|
191
|
-
- Ran build, lint, and all tests: all passed
|
|
192
|
-
|
|
193
|
-
This completes Task 1.5 for advertisement data merging.
|
|
194
|
-
|
|
195
|
-
---
|
|
196
|
-
|
|
197
|
-
## Phase 4: Advanced Features (March 7, 2026)
|
|
198
|
-
|
|
199
|
-
### Task 6.4: Light Multi-Command Sequences ✅
|
|
200
|
-
**Implementation Details:**
|
|
201
|
-
- Added `sendCommandSequence(commands)` to `WoBulb` for ordered multi-command execution where all commands must succeed
|
|
202
|
-
- Added `sendMultipleCommands(commands)` to `WoBulb` for fallback-style execution returning true if any command succeeds
|
|
203
|
-
- Updated `BulbCommands` interface with optional `sendCommandSequence` and `sendMultipleCommands`
|
|
204
|
-
- Added `test/light-multi-command.test.ts` with 8 tests validating:
|
|
205
|
-
- Method availability on `WoBulb` and `WoStripLight3`
|
|
206
|
-
- Sequence stop-on-failure behavior
|
|
207
|
-
- Any-success behavior for multiple commands
|
|
208
|
-
- Complex light pattern sequences
|
|
209
|
-
- Full validation passed: build ✅ tests ✅ (249 passing) lint ✅ type-check ✅
|
|
210
|
-
|
|
211
|
-
### Task 7.1: Humidity Level Control ✅
|
|
212
|
-
**Implementation Details:**
|
|
213
|
-
- Added `setLevel(level: number)` to `WoHumi` as target humidity convenience command
|
|
214
|
-
- `setLevel` clamps to valid range (1-100) and delegates to `setEfficiency`
|
|
215
|
-
- Updated `HumidifierCommands` interface with optional `setLevel`
|
|
216
|
-
- Added `test/humidifier-level-control.test.ts` with 3 tests validating:
|
|
217
|
-
- Delegation from `setLevel` to `setEfficiency`
|
|
218
|
-
- Clamping behavior for out-of-range input
|
|
219
|
-
- Continued `setLevel` availability on `WoHumi2` via inheritance
|
|
220
|
-
- Full validation passed: build ✅ tests ✅ (249 passing) lint ✅ type-check ✅
|
|
221
|
-
|
|
222
|
-
### Task 3.2 & 3.3: Curtain 3 Commands & Extended Info ✅
|
|
223
|
-
**Implementation Details:**
|
|
224
|
-
- Added Curtain 3 multi-command sequence support:
|
|
225
|
-
- `sendCommandSequence(commands)` - sends multiple commands in series, all must succeed
|
|
226
|
-
- `sendMultipleCommands(commands)` - sends multiple commands in series, returns true if any succeed
|
|
227
|
-
- Added `getExtendedInfo()` method (BLE command `0x57 0x0F 0x46 0x01`):
|
|
228
|
-
- Returns device chain information (master/slave devices)
|
|
229
|
-
- Provides grouped curtain status (position, calibrated, moving)
|
|
230
|
-
- Added `CurtainExtendedInfo` interface to type system
|
|
231
|
-
- Updated `CurtainCommands` interface with optional new methods
|
|
232
|
-
- Curtain 3 model detection already supported via BLE model '{' and device-type mappings
|
|
233
|
-
- Created `test/curtain3-features.test.ts` with 8 tests validating:
|
|
234
|
-
- Curtain3 device type recognition
|
|
235
|
-
- Multi-command sequence and multiple command methods
|
|
236
|
-
- Extended info method availability
|
|
237
|
-
- Command sequence success/failure behavior
|
|
238
|
-
- Full validation passed: build ✅ tests ✅ (241 passing, +8 new) lint ✅ type-check ✅
|
|
239
|
-
|
|
240
|
-
---
|
|
241
|
-
|
|
242
|
-
## Phase 3: New Devices - Other Devices Block (March 7, 2026)
|
|
243
|
-
|
|
244
|
-
### Task 17.6: HubMini Matter ✅
|
|
245
|
-
**Implementation Details:**
|
|
246
|
-
- Created `WoHubMiniMatter` class extending `WoHub2` in `src/devices/wo-hubmini-matter.ts`
|
|
247
|
-
- Inherits all hub functionality: `getStatus()` returning sensor data (temperature, humidity, lightLevel)
|
|
248
|
-
- Wired through 3-layer export chain (device → devices/index.ts → src/index.ts)
|
|
249
|
-
- Added to runtime registry: `DEVICE_CLASSES['WoHubMiniMatter']` in `src/switchbot.ts`
|
|
250
|
-
- Added device-type mappings in `src/settings.ts`: "HubMini Matter", "SwitchBot HubMini Matter"
|
|
251
|
-
- Created `test/hubmini-matter.test.ts` with 3 tests validating device-type mappings and method inheritance from WoHub2
|
|
252
|
-
- Full validation passed: build ✅ tests ✅ (233 passing) lint ✅ type-check ✅
|
|
253
|
-
|
|
254
|
-
### Task 17.5: Hub3 Enhancement ✅
|
|
255
|
-
**Implementation Details:**
|
|
256
|
-
- Enhanced existing `WoHub3` class (extends `WoHub2` in `src/devices/wo-hub3.ts`)
|
|
257
|
-
- Added device-type alias in `src/settings.ts`: "SwitchBot Hub 3" (in addition to existing "Hub 3")
|
|
258
|
-
- Created `test/hub3.test.ts` with 3 tests validating device-type mappings and method inheritance from WoHub2
|
|
259
|
-
- Verified inheritance: `getStatus()` method returns hub sensor data (temperature, humidity, lightLevel)
|
|
260
|
-
- Full validation passed: build ✅ tests ✅ (230 passing) lint ✅ type-check ✅
|
|
261
|
-
|
|
262
|
-
### Task 17.4: Keypad Vision Pro ✅
|
|
263
|
-
**Implementation Details:**
|
|
264
|
-
- Created `WoKeypadVisionPro` class extending `WoKeypad` in `src/devices/wo-keypad-vision-pro.ts`
|
|
265
|
-
- Inherits all keypad functionality: `getStatus()` methods
|
|
266
|
-
- Wired through 3-layer export chain (device → devices/index.ts → src/index.ts)
|
|
267
|
-
- Added to runtime registry: `DEVICE_CLASSES['WoKeypadVisionPro']` in `src/switchbot.ts`
|
|
268
|
-
- Added device-type mappings in `src/settings.ts`: "Keypad Vision Pro", "SwitchBot Keypad Vision Pro"
|
|
269
|
-
- Created `test/keypad-vision-pro.test.ts` with 3 tests validating device-type mapping and method inheritance
|
|
270
|
-
- Full validation passed: build ✅ tests ✅ (227 passing) lint ✅ type-check ✅
|
|
271
|
-
|
|
272
|
-
### Task 17.3: Keypad Vision ✅
|
|
273
|
-
**Implementation Details:**
|
|
274
|
-
- Created `WoKeypadVision` class extending `WoKeypad` in `src/devices/wo-keypad-vision.ts`
|
|
275
|
-
- Inherits all keypad functionality: `getStatus()` methods
|
|
276
|
-
- Wired through 3-layer export chain (device → devices/index.ts → src/index.ts)
|
|
277
|
-
- Added to runtime registry: `DEVICE_CLASSES['WoKeypadVision']` in `src/switchbot.ts`
|
|
278
|
-
- Added device-type mappings in `src/settings.ts`: "Keypad Vision", "SwitchBot Keypad Vision"
|
|
279
|
-
- Created `test/keypad-vision.test.ts` with 3 tests validating device-type mapping and method inheritance
|
|
280
|
-
- Full validation passed: build ✅ tests ✅ (224 passing) lint ✅ type-check ✅
|
|
281
|
-
|
|
282
|
-
---
|
|
283
|
-
|
|
284
|
-
## Phase 0: Foundation & Preparation ✅
|
|
285
|
-
|
|
286
|
-
### BLE Infrastructure Hardening (Completed March 6, 2026)
|
|
287
|
-
- [x] Add enumerable device properties for Homebridge compatibility
|
|
288
|
-
- [x] Implement ID-based BLE lookups for macOS (empty MAC address support)
|
|
289
|
-
- [x] Add manufacturer data MAC extraction fallback
|
|
290
|
-
- [x] Broaden discovery filters for legacy UUIDs (000d)
|
|
291
|
-
- [x] Add peripheral validation (connectable flag, RSSI bounds)
|
|
292
|
-
- [x] Implement BLE event listener cleanup
|
|
293
|
-
- [x] Add connection error cleanup (characteristics discovery failure)
|
|
294
|
-
- [x] Create BLE lifecycle regression tests
|
|
295
|
-
- [x] Fix resource leaks (event listeners, connection maps)
|
|
296
|
-
|
|
297
|
-
### Testing & Validation (Completed March 6-7, 2026)
|
|
298
|
-
- [x] 124 unit tests passing
|
|
299
|
-
- [x] BLE scanner lifecycle tests
|
|
300
|
-
- [x] BLE connection cleanup tests
|
|
301
|
-
- [x] macOS compatibility validation (45 real devices)
|
|
302
|
-
|
|
303
|
-
---
|
|
304
|
-
|
|
305
|
-
## Phase 1: Core Parity Sprint ✅
|
|
306
|
-
|
|
307
|
-
### Completed March 7, 2026
|
|
308
|
-
- [x] Advertisement status parsing and model cache support
|
|
309
|
-
- Added richer advertisement parsing for Bot, Curtain/Curtain3, Lock/Lock Pro, and Relay Switch models
|
|
310
|
-
- Added per-discovery model cache in `BLEScanner`
|
|
311
|
-
- Stored parsed BLE service data on device info for status fallback
|
|
312
|
-
|
|
313
|
-
- [x] Curtain speed control
|
|
314
|
-
- Added optional speed to `open`, `close`, and `setPosition` commands
|
|
315
|
-
- Updated BLE payload and OpenAPI `setPosition` parameter construction
|
|
316
|
-
|
|
317
|
-
- [x] GCM/CTR BLE encryption plumbing
|
|
318
|
-
- Added encryption mode (`auto`/`ctr`/`gcm`) support in `BLEConnection`
|
|
319
|
-
- Added IV length validation, auto mode resolution, and GCM IV increment behavior
|
|
320
|
-
|
|
321
|
-
- [x] BLE command result and password response validation
|
|
322
|
-
- Added command response checks for ack bytes (`0x01`, `0x05`, `0x06`)
|
|
323
|
-
- Added password-required (`0x07`) and password-incorrect (`0x09`) detection
|
|
324
|
-
|
|
325
|
-
- [x] Persistent BLE connections + operation locking
|
|
326
|
-
- Added per-device operation lock queue in `BLEConnection`
|
|
327
|
-
- Added configurable persistent connection timer with auto-disconnect
|
|
328
|
-
- Added device-level BLE command serialization in base device class
|
|
329
|
-
|
|
330
|
-
---
|
|
331
|
-
|
|
332
|
-
## Phase 2: Command Enhancement (Wave 1) ✅
|
|
333
|
-
|
|
334
|
-
### Completed March 7, 2026
|
|
335
|
-
- [x] Bot mode configuration
|
|
336
|
-
- Implemented `setMode('press'|'switch')`, `setLongPress(duration)`, `handUp()`, and `handDown()` on `WoHand`
|
|
337
|
-
|
|
338
|
-
- [x] Lock advanced features
|
|
339
|
-
- Implemented `unlockWithoutUnlatch()` on `WoSmartLockPro`
|
|
340
|
-
- Added smart pre-checks to skip lock/unlock when already in target state
|
|
341
|
-
- Added `getLockInfo()` helper on lock devices
|
|
342
|
-
- Added BLE notification subscription hooks for lock updates
|
|
343
|
-
|
|
344
|
-
- [x] Light effect presets
|
|
345
|
-
- Added 20 preset effects with `setEffect(effectName, speed)` on `WoBulb`/`WoStrip`
|
|
346
|
-
|
|
347
|
-
- [x] Relay power monitoring
|
|
348
|
-
- Added relay basic-info parsing for voltage/current/energy from BLE response payload
|
|
349
|
-
- Integrated parsed metrics into relay BLE status response
|
|
350
|
-
|
|
351
|
-
- [x] Phase 2 regression coverage
|
|
352
|
-
- Added `test/phase2-features.test.ts` covering Bot mode config, lock smart detection, light effects, and relay metrics parsing
|
|
353
|
-
|
|
354
|
-
---
|
|
355
|
-
|
|
356
|
-
## Phase 2: Command Enhancement (Wave 2) ✅
|
|
357
|
-
|
|
358
|
-
### Completed March 7, 2026
|
|
359
|
-
- [x] Relay 2PM channel-specific control (Task 5.3)
|
|
360
|
-
- Created `WoRelaySwitch2PM` class extending `WoRelaySwitch1`
|
|
361
|
-
- Implemented `setChannel1(state: boolean)` and `setChannel2(state: boolean)` methods
|
|
362
|
-
- Added channel-specific command constants (CHANNEL1_ON/OFF, CHANNEL2_ON/OFF) to DEVICE_COMMANDS.RELAY
|
|
363
|
-
|
|
364
|
-
- [x] Bulb color temperature with min/max bounds (Task 6.3)
|
|
365
|
-
- Added `setColorTemp(minTemp, maxTemp, temp)` method to `WoBulb` class
|
|
366
|
-
- Command format: `0x57 0x0F 0x47 0x01 0x17 BRIGHTNESS MIN_KEL MAX_KEL TEMP`
|
|
367
|
-
- Validates and clamps temperatures, ensures current temp within min/max bounds
|
|
368
|
-
- Auto-corrects reversed min/max values
|
|
369
|
-
|
|
370
|
-
- [x] RGBIC bulb segmented control (Task 6.2)
|
|
371
|
-
- Created `WoRGBICBulb` class extending `WoBulb`
|
|
372
|
-
- Implemented `setSegmentColor(segmentId, r, g, b)` for individual LED segment color control
|
|
373
|
-
- Implemented `setSegmentEffect(segmentId, effectName, speed)` for segment-specific effects
|
|
374
|
-
- Added 25 RGBIC effects including segment_cycle, segment_wave, segment_chase, segment_strobe, segment_twinkle
|
|
375
|
-
- Inherits all standard bulb features from WoBulb (standard effects, color temperature bounds)
|
|
376
|
-
|
|
377
|
-
- [x] Phase 2 Wave 2 regression coverage
|
|
378
|
-
- Added `test/phase2-remaining.test.ts` with 21 tests covering Relay 2PM channels, color temperature bounds, and RGBIC segmented control
|
|
379
|
-
|
|
380
|
-
---
|
|
381
|
-
|
|
382
|
-
## Phase 2: Advanced Features ✅
|
|
383
|
-
|
|
384
|
-
### Completed March 7, 2026
|
|
385
|
-
- [x] Sequence device pattern (Task 21.1)
|
|
386
|
-
- Added `SequenceDevice` base class
|
|
387
|
-
- Tracks advertisement `sequenceNumber` changes and emits `sequence-changed`
|
|
388
|
-
- Auto-triggers `update()` on sequence changes with in-flight suppression
|
|
389
|
-
- Applied to lock, relay switch, and air purifier device families
|
|
390
|
-
- Added regression coverage in `test/sequence-device.test.ts`
|
|
391
|
-
|
|
392
|
-
- [x] Override state during connection pattern (Task 21.2)
|
|
393
|
-
- Added `DeviceOverrideStateDuringConnection` base class
|
|
394
|
-
- Ignores advertisement state (`bleServiceData`, battery, RSSI) while BLE connection is active
|
|
395
|
-
- Prevents stale advertisement fallback state during live connections
|
|
396
|
-
- Applied to bot and plug device families
|
|
397
|
-
- Added regression coverage in `test/device-override-state-during-connection.test.ts`
|
|
398
|
-
|
|
399
|
-
---
|
|
400
|
-
|
|
401
|
-
## Phase 3: New Device Types (Vacuum Variants) ✅
|
|
402
|
-
|
|
403
|
-
### Completed March 7, 2026
|
|
404
|
-
- [x] K10+ / K10+ Pro / K10+ Pro Combo vacuum variants (Tasks 12.1-12.3)
|
|
405
|
-
- Added `WoVacuumK10Plus`, `WoVacuumK10Pro`, and `WoVacuumK10ProCombo` classes
|
|
406
|
-
- Reused shared `WoVacuum` command/status behavior to avoid duplication
|
|
407
|
-
- Wired `DEVICE_CLASS_MAP` routing for K10 family API/BLE names
|
|
408
|
-
|
|
409
|
-
- [x] K11+ / K20 / S10 / S20 vacuum variants (Tasks 12.4-12.7)
|
|
410
|
-
- Added `WoVacuumK11Plus`, `WoVacuumK20`, `WoVacuumS10`, and `WoVacuumS20` classes
|
|
411
|
-
- Updated `SwitchBot` runtime device registry and package exports
|
|
412
|
-
- Added regression coverage in `test/vacuum-variants.test.ts` for class mapping
|
|
413
|
-
|
|
414
|
-
- [x] Lock Lite / Lock Vision variants (Tasks 13.1-13.2)
|
|
415
|
-
- Added `WoSmartLockLite` and `WoSmartLockVision` classes extending `WoSmartLock`
|
|
416
|
-
- Both variants use base lock functionality without unlatch support
|
|
417
|
-
- Wired `DEVICE_CLASS_MAP` routing for lock variant API/BLE names
|
|
418
|
-
|
|
419
|
-
- [x] Lock Vision Pro / Lock Pro WiFi variants (Tasks 13.3-13.4)
|
|
420
|
-
- Added `WoSmartLockVisionPro` and `WoSmartLockProWiFi` classes extending `WoSmartLockPro`
|
|
421
|
-
- Both variants inherit pro lock features including unlatch support
|
|
422
|
-
- Updated `SwitchBot` runtime device registry and package exports
|
|
423
|
-
- Added regression coverage in `test/lock-variants.test.ts` for class mapping and method inheritance
|
|
424
|
-
|
|
425
|
-
---
|
|
426
|
-
|
|
427
|
-
## Phase 3: New Device Types (Relay Variants) ✅
|
|
428
|
-
|
|
429
|
-
### Completed March 7, 2026
|
|
430
|
-
- [x] Relay Switch 2PM wiring completion (Task 14.1)
|
|
431
|
-
- WoRelaySwitch2PM class already existed from Phase 2
|
|
432
|
-
- Completed wiring through src/index.ts exports
|
|
433
|
-
- Added to src/switchbot.ts DEVICE_CLASSES registry
|
|
434
|
-
- Added 'Relay Switch 2PM' mapping to DEVICE_CLASS_MAP in src/settings.ts
|
|
435
|
-
|
|
436
|
-
- [x] Garage Door Opener relay variant (Task 14.2)
|
|
437
|
-
- Added WoGarageDoorOpener class extending WoRelaySwitch1
|
|
438
|
-
- Lightweight variant reuses relay switch control methods (turnOn/turnOff/toggle)
|
|
439
|
-
- Wired through exports, registry, and DEVICE_CLASS_MAP
|
|
440
|
-
- Added regression coverage in test/relay-variants.test.ts (4 tests)
|
|
441
|
-
- Tests verify: 2PM class mapping, Garage Door Opener mapping, channel methods on 2PM, relay methods on opener
|
|
442
|
-
|
|
443
|
-
---
|
|
444
|
-
|
|
445
|
-
## Phase 3: New Device Types (Climate Enhancements) ✅
|
|
446
|
-
|
|
447
|
-
### Completed March 7, 2026
|
|
448
|
-
- [x] Evaporative Humidifier (WoHumi2) enhancement (Task 15.1)
|
|
449
|
-
- Enhanced WoHumi2 with convenience methods: setAuto(), setManual(), setLevel(level)
|
|
450
|
-
- Added evaporative humidifier API aliases in DEVICE_CLASS_MAP to map to WoHumi2
|
|
451
|
-
- Added regression coverage in test/humidifier2-enhancement.test.ts (4 tests)
|
|
452
|
-
- Tests verify WoHumi2 method delegation and evaporative humidifier device-type mapping
|
|
453
|
-
|
|
454
|
-
- [x] Circulator Fan (Battery/USB) variant (Task 15.2)
|
|
455
|
-
- Added WoCirculatorFan class extending WoAirPurifier
|
|
456
|
-
- Wired fan class through exports and SwitchBot runtime DEVICE_CLASSES registry
|
|
457
|
-
- Added device-type aliases in DEVICE_CLASS_MAP for Battery/USB fan names
|
|
458
|
-
- Added regression coverage in test/circulator-fan-variants.test.ts (4 tests)
|
|
459
|
-
- Tests verify model mapping and inherited control methods (turnOn/turnOff/setFanSpeed)
|
|
460
|
-
|
|
461
|
-
- [x] Smart Thermostat Radiator variant (Task 15.3)
|
|
462
|
-
- Added WoSmartThermostatRadiator class extending WoAirPurifier
|
|
463
|
-
- Wired class through exports and SwitchBot runtime DEVICE_CLASSES registry
|
|
464
|
-
- Added device-type aliases in DEVICE_CLASS_MAP for thermostat radiator names
|
|
465
|
-
- Added regression coverage in test/thermostat-radiator-variants.test.ts (4 tests)
|
|
466
|
-
- Tests verify model mapping and inherited climate control methods (turnOn/turnOff/setMode)
|
|
467
|
-
|
|
468
|
-
- [x] Climate Panel variant (Task 15.4)
|
|
469
|
-
- Added WoClimatePanel class extending WoAirPurifier
|
|
470
|
-
- Wired class through exports and SwitchBot runtime DEVICE_CLASSES registry
|
|
471
|
-
- Added climate panel aliases in DEVICE_CLASS_MAP
|
|
472
|
-
- Added regression coverage in test/climate-panel-variants.test.ts (3 tests)
|
|
473
|
-
- Tests verify model mapping and inherited climate control methods (turnOn/turnOff/setMode)
|
|
474
|
-
|
|
475
|
-
## Phase 3: New Device Types (Lighting Variants) ⏳
|
|
476
|
-
|
|
477
|
-
### Completed March 7, 2026
|
|
478
|
-
- [x] Strip Light 3 (Task 16.1)
|
|
479
|
-
- Added WoStripLight3 class extending WoBulb for color control
|
|
480
|
-
- Wired class through exports and SwitchBot runtime DEVICE_CLASSES registry
|
|
481
|
-
- Added device-type mappings: "Strip Light 3", "SwitchBot Strip Light 3"
|
|
482
|
-
- Added regression coverage in test/strip-light-3.test.ts (3 tests)
|
|
483
|
-
- Tests verify device-type mapping for both aliases and inherited color control methods
|
|
484
|
-
|
|
485
|
-
- [x] Floor Lamp (Task 16.2)
|
|
486
|
-
- Added WoFloorLamp class extending WoBulb for color control
|
|
487
|
-
- Wired class through exports and SwitchBot runtime DEVICE_CLASSES registry
|
|
488
|
-
- Added device-type mappings: "Floor Lamp", "SwitchBot Floor Lamp"
|
|
489
|
-
- Added regression coverage in test/floor-lamp.test.ts (3 tests)
|
|
490
|
-
- Tests verify device-type mapping for both aliases and inherited color control methods
|
|
491
|
-
|
|
492
|
-
- [x] RGBICWW Strip Light (Task 16.3)
|
|
493
|
-
- Added WoRGBICWWStripLight class extending WoRGBICBulb for segmented control
|
|
494
|
-
- Wired class through exports and SwitchBot runtime DEVICE_CLASSES registry
|
|
495
|
-
- Added device-type mappings: "RGBICWW Strip Light", "SwitchBot RGBICWW Strip Light"
|
|
496
|
-
- Added regression coverage in test/rgbicww-strip-light.test.ts (3 tests)
|
|
497
|
-
- Tests verify device-type mapping and inherited RGBIC methods (setSegmentColor, setSegmentEffect)
|
|
498
|
-
- Note: Also wired WoRGBICBulb through exports for completeness
|
|
499
|
-
|
|
500
|
-
- [x] RGBICWW Floor Lamp (Task 16.4)
|
|
501
|
-
- Added WoRGBICWWFloorLamp class extending WoRGBICBulb for segmented control
|
|
502
|
-
- Wired class through exports and SwitchBot runtime DEVICE_CLASSES registry
|
|
503
|
-
- Added device-type mappings: "RGBICWW Floor Lamp", "SwitchBot RGBICWW Floor Lamp"
|
|
504
|
-
- Added regression coverage in test/rgbicww-floor-lamp.test.ts (3 tests)
|
|
505
|
-
- Tests verify device-type mapping and inherited RGBIC methods (setSegmentColor, setSegmentEffect)
|
|
506
|
-
|
|
507
|
-
- [x] Art Frame (Task 16.5)
|
|
508
|
-
- Added WoArtFrame class extending WoBulb for color control
|
|
509
|
-
- Wired class through exports and SwitchBot runtime DEVICE_CLASSES registry
|
|
510
|
-
- Added device-type mappings: "Art Frame", "SwitchBot Art Frame"
|
|
511
|
-
- Added regression coverage in test/art-frame.test.ts (3 tests)
|
|
512
|
-
- Tests verify device-type mapping for both aliases and inherited color control methods
|
|
513
|
-
- **Lighting variants block (Tasks 16.1-16.5) complete!** ✅
|
|
514
|
-
|
|
515
|
-
## Phase 3: New Device Types (Other Devices) ⏳
|
|
516
|
-
|
|
517
|
-
### Completed March 7, 2026
|
|
518
|
-
- [x] Plug Mini EU verification (Task 17.1)
|
|
519
|
-
- Verified WoPlugMiniEU exists in runtime registry (aliased to WoPlugMiniUS)
|
|
520
|
-
- Verified device-type mapping: "Plug Mini (EU)" → WoPlugMiniEU
|
|
521
|
-
- Added regression coverage in test/plug-mini-eu.test.ts (2 tests)
|
|
522
|
-
- Tests verify EU variant maps to WoPlugMiniUS class and inherits plug control methods
|
|
523
|
-
- Note: WoPlugMiniEU shares implementation with WoPlugMiniUS (regional variant)
|
|
524
|
-
|
|
525
|
-
- Added WoRollerShade class extending WoCurtain for motorized window covering control
|
|
526
|
-
- Wired class through exports and SwitchBot runtime DEVICE_CLASSES registry
|
|
527
|
-
- Added device-type mappings: "Roller Shade", "SwitchBot Roller Shade"
|
|
528
|
-
- Added regression coverage in test/roller-shade.test.ts (3 tests)
|
|
529
|
-
- Tests verify device-type mapping and inherited curtain control methods (open, close, pause, setPosition)
|
|
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
|
-
|
|
539
|
-
---
|
|
540
|
-
|
|
541
|
-
## Notes
|
|
542
|
-
|
|
543
|
-
When moving a task from todo.md to this file:
|
|
544
|
-
1. Add the completion date
|
|
545
|
-
2. Note any implementation details or deviations
|
|
546
|
-
3. Link to relevant PRs or commits if applicable
|
|
547
|
-
4. Update "Last Updated" timestamp
|
|
548
|
-
|
|
549
|
-
Format: `- [x] **Task X.Y**: Description (Completed: YYYY-MM-DD)`
|