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
|
@@ -7,11 +7,11 @@ export declare class WoCurtain extends SwitchBotDevice implements CurtainCommand
|
|
|
7
7
|
/**
|
|
8
8
|
* Open curtain (position 0%)
|
|
9
9
|
*/
|
|
10
|
-
open(): Promise<boolean>;
|
|
10
|
+
open(speed?: number): Promise<boolean>;
|
|
11
11
|
/**
|
|
12
12
|
* Close curtain (position 100%)
|
|
13
13
|
*/
|
|
14
|
-
close(): Promise<boolean>;
|
|
14
|
+
close(speed?: number): Promise<boolean>;
|
|
15
15
|
/**
|
|
16
16
|
* Pause curtain movement
|
|
17
17
|
*/
|
|
@@ -19,7 +19,7 @@ export declare class WoCurtain extends SwitchBotDevice implements CurtainCommand
|
|
|
19
19
|
/**
|
|
20
20
|
* Set curtain position (0-100%)
|
|
21
21
|
*/
|
|
22
|
-
setPosition(position: number): Promise<boolean>;
|
|
22
|
+
setPosition(position: number, speed?: number): Promise<boolean>;
|
|
23
23
|
/**
|
|
24
24
|
* Get device status
|
|
25
25
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wo-curtain.d.ts","sourceRoot":"","sources":["../../src/devices/wo-curtain.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAIxE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3C;;GAEG;AACH,qBAAa,SAAU,SAAQ,eAAgB,YAAW,eAAe;IACvE;;OAEG;IACG,IAAI,
|
|
1
|
+
{"version":3,"file":"wo-curtain.d.ts","sourceRoot":"","sources":["../../src/devices/wo-curtain.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAIxE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3C;;GAEG;AACH,qBAAa,SAAU,SAAQ,eAAgB,YAAW,eAAe;IACvE;;OAEG;IACG,IAAI,CAAC,KAAK,SAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAUzC;;OAEG;IACG,KAAK,CAAC,KAAK,SAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAU1C;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC;IAQ/B;;OAEG;IACG,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,SAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAelE;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,aAAa,CAAC;CAoC1C"}
|
|
@@ -12,15 +12,17 @@ export class WoCurtain extends SwitchBotDevice {
|
|
|
12
12
|
/**
|
|
13
13
|
* Open curtain (position 0%)
|
|
14
14
|
*/
|
|
15
|
-
async open() {
|
|
16
|
-
const
|
|
15
|
+
async open(speed = 255) {
|
|
16
|
+
const clampedSpeed = clamp(speed, 1, 255);
|
|
17
|
+
const result = await this.sendCommand([...DEVICE_COMMANDS.CURTAIN.POSITION, clampedSpeed, 0], 'setPosition', `0,${clampedSpeed.toString(16).padStart(2, '0')},0`);
|
|
17
18
|
return result.success;
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
20
21
|
* Close curtain (position 100%)
|
|
21
22
|
*/
|
|
22
|
-
async close() {
|
|
23
|
-
const
|
|
23
|
+
async close(speed = 255) {
|
|
24
|
+
const clampedSpeed = clamp(speed, 1, 255);
|
|
25
|
+
const result = await this.sendCommand([...DEVICE_COMMANDS.CURTAIN.POSITION, clampedSpeed, 100], 'setPosition', `0,${clampedSpeed.toString(16).padStart(2, '0')},100`);
|
|
24
26
|
return result.success;
|
|
25
27
|
}
|
|
26
28
|
/**
|
|
@@ -33,11 +35,12 @@ export class WoCurtain extends SwitchBotDevice {
|
|
|
33
35
|
/**
|
|
34
36
|
* Set curtain position (0-100%)
|
|
35
37
|
*/
|
|
36
|
-
async setPosition(position) {
|
|
38
|
+
async setPosition(position, speed = 255) {
|
|
37
39
|
const clampedPosition = clamp(position, 0, 100);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
40
|
+
const clampedSpeed = clamp(speed, 1, 255);
|
|
41
|
+
// BLE command with speed and position bytes
|
|
42
|
+
const bleCommand = [...DEVICE_COMMANDS.CURTAIN.POSITION, clampedSpeed, clampedPosition];
|
|
43
|
+
const result = await this.sendCommand(bleCommand, 'setPosition', `0,${clampedSpeed.toString(16).padStart(2, '0')},${clampedPosition}`);
|
|
41
44
|
return result.success;
|
|
42
45
|
}
|
|
43
46
|
/**
|
|
@@ -61,7 +64,7 @@ export class WoCurtain extends SwitchBotDevice {
|
|
|
61
64
|
}
|
|
62
65
|
// Fallback to BLE
|
|
63
66
|
if (this.hasBLE()) {
|
|
64
|
-
const bleData = await this.getBLEStatus();
|
|
67
|
+
const bleData = await this.getBLEStatus().catch(() => this.normalizeBLEStatusData(undefined));
|
|
65
68
|
return {
|
|
66
69
|
deviceId: this.info.id,
|
|
67
70
|
connectionType: 'ble',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wo-curtain.js","sourceRoot":"","sources":["../../src/devices/wo-curtain.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3C;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,eAAe;IAC5C;;OAEG;IACH,KAAK,CAAC,IAAI;
|
|
1
|
+
{"version":3,"file":"wo-curtain.js","sourceRoot":"","sources":["../../src/devices/wo-curtain.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3C;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,eAAe;IAC5C;;OAEG;IACH,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG;QACpB,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,CAAA;QACzC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CACnC,CAAC,GAAG,eAAe,CAAC,OAAO,CAAC,QAAQ,EAAE,YAAY,EAAE,CAAC,CAAC,EACtD,aAAa,EACb,KAAK,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,Q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AsB,EAAE,KAAK,CAAC,CAAA;YAChD,MAAM,KAAK,CAAA;QACb,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-floor-lamp.d.ts","sourceRoot":"","sources":["../../src/devices/wo-floor-lamp.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC;;;GAGG;AACH,qBAAa,WAAY,SAAQ,MAAM;CAAG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* Copyright(C) 2024-2026, donavanbecker (https://github.com/donavanbecker). All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* devices/wo-floor-lamp.ts: SwitchBot v4.0.0 - Floor Lamp
|
|
4
|
+
*/
|
|
5
|
+
import { WoBulb } from './wo-bulb.js';
|
|
6
|
+
/**
|
|
7
|
+
* Floor Lamp Device
|
|
8
|
+
* Uses same logic as Color Bulb
|
|
9
|
+
*/
|
|
10
|
+
export class WoFloorLamp extends WoBulb {
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=wo-floor-lamp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-floor-lamp.js","sourceRoot":"","sources":["../../src/devices/wo-floor-lamp.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC;;;GAGG;AACH,MAAM,OAAO,WAAY,SAAQ,MAAM;CAAG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WoRelaySwitch1 } from './wo-relay-switch-1.js';
|
|
2
|
+
/**
|
|
3
|
+
* Garage Door Opener Device (uses relay switch control)
|
|
4
|
+
* Extends Relay Switch 1 for simple open/close control
|
|
5
|
+
*/
|
|
6
|
+
export declare class WoGarageDoorOpener extends WoRelaySwitch1 {
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=wo-garage-door-opener.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-garage-door-opener.d.ts","sourceRoot":"","sources":["../../src/devices/wo-garage-door-opener.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEvD;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,cAAc;CAAG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* Copyright(C) 2024-2026, donavanbecker (https://github.com/donavanbecker). All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* devices/wo-garage-door-opener.ts: SwitchBot v4.0.0 - Garage Door Opener Device
|
|
4
|
+
*/
|
|
5
|
+
import { WoRelaySwitch1 } from './wo-relay-switch-1.js';
|
|
6
|
+
/**
|
|
7
|
+
* Garage Door Opener Device (uses relay switch control)
|
|
8
|
+
* Extends Relay Switch 1 for simple open/close control
|
|
9
|
+
*/
|
|
10
|
+
export class WoGarageDoorOpener extends WoRelaySwitch1 {
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=wo-garage-door-opener.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-garage-door-opener.js","sourceRoot":"","sources":["../../src/devices/wo-garage-door-opener.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEvD;;;GAGG;AACH,MAAM,OAAO,kBAAmB,SAAQ,cAAc;CAAG"}
|
|
@@ -1,9 +1,25 @@
|
|
|
1
|
+
import type { OpenAPIClient } from '../api.js';
|
|
2
|
+
import type { BLEConnection } from '../ble.js';
|
|
1
3
|
import type { BotCommands, BotStatus } from '../types/device.js';
|
|
2
|
-
import {
|
|
4
|
+
import type { DeviceInfo } from '../types/index.js';
|
|
5
|
+
import { DeviceOverrideStateDuringConnection } from './device-override-state-during-connection.js';
|
|
3
6
|
/**
|
|
4
7
|
* Bot (WoHand) Device - Press or switch button device
|
|
8
|
+
* Supports optional BLE password protection
|
|
5
9
|
*/
|
|
6
|
-
export declare class WoHand extends
|
|
10
|
+
export declare class WoHand extends DeviceOverrideStateDuringConnection implements BotCommands {
|
|
11
|
+
private password?;
|
|
12
|
+
constructor(info: DeviceInfo, options?: {
|
|
13
|
+
bleConnection?: BLEConnection;
|
|
14
|
+
apiClient?: OpenAPIClient;
|
|
15
|
+
enableFallback?: boolean;
|
|
16
|
+
preferredConnection?: 'ble' | 'api';
|
|
17
|
+
enableConnectionIntelligence?: boolean;
|
|
18
|
+
enableCircuitBreaker?: boolean;
|
|
19
|
+
enableRetry?: boolean;
|
|
20
|
+
password?: string;
|
|
21
|
+
logLevel?: number;
|
|
22
|
+
});
|
|
7
23
|
/**
|
|
8
24
|
* Turn on (switch mode)
|
|
9
25
|
*/
|
|
@@ -16,6 +32,41 @@ export declare class WoHand extends SwitchBotDevice implements BotCommands {
|
|
|
16
32
|
* Press (press mode)
|
|
17
33
|
*/
|
|
18
34
|
press(): Promise<boolean>;
|
|
35
|
+
/**
|
|
36
|
+
* Set Bot mode
|
|
37
|
+
*/
|
|
38
|
+
setMode(mode: 'press' | 'switch'): Promise<boolean>;
|
|
39
|
+
/**
|
|
40
|
+
* Set Bot long-press duration (1-255 deciseconds)
|
|
41
|
+
*/
|
|
42
|
+
setLongPress(duration: number): Promise<boolean>;
|
|
43
|
+
/**
|
|
44
|
+
* Raise Bot arm
|
|
45
|
+
*/
|
|
46
|
+
handUp(): Promise<boolean>;
|
|
47
|
+
/**
|
|
48
|
+
* Lower Bot arm
|
|
49
|
+
*/
|
|
50
|
+
handDown(): Promise<boolean>;
|
|
51
|
+
/**
|
|
52
|
+
* Execute password-protected Bot command
|
|
53
|
+
* @param action - Bot action to perform
|
|
54
|
+
* @returns True if command was successful
|
|
55
|
+
*/
|
|
56
|
+
private executePasswordCommand;
|
|
57
|
+
/**
|
|
58
|
+
* Set or update Bot password
|
|
59
|
+
* @param password - 4-character alphanumeric password (case-sensitive)
|
|
60
|
+
*/
|
|
61
|
+
setPassword(password: string): void;
|
|
62
|
+
/**
|
|
63
|
+
* Clear Bot password
|
|
64
|
+
*/
|
|
65
|
+
clearPassword(): void;
|
|
66
|
+
/**
|
|
67
|
+
* Check if password is configured
|
|
68
|
+
*/
|
|
69
|
+
hasPassword(): boolean;
|
|
19
70
|
/**
|
|
20
71
|
* Get device status
|
|
21
72
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wo-hand.d.ts","sourceRoot":"","sources":["../../src/devices/wo-hand.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"wo-hand.d.ts","sourceRoot":"","sources":["../../src/devices/wo-hand.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAInD,OAAO,EAAE,mCAAmC,EAAE,MAAM,8CAA8C,CAAA;AAElG;;;GAGG;AACH,qBAAa,MAAO,SAAQ,mCAAoC,YAAW,WAAW;IACpF,OAAO,CAAC,QAAQ,CAAC,CAAQ;gBAGvB,IAAI,EAAE,UAAU,EAChB,OAAO,GAAE;QACP,aAAa,CAAC,EAAE,aAAa,CAAA;QAC7B,SAAS,CAAC,EAAE,aAAa,CAAA;QACzB,cAAc,CAAC,EAAE,OAAO,CAAA;QACxB,mBAAmB,CAAC,EAAE,KAAK,GAAG,KAAK,CAAA;QACnC,4BAA4B,CAAC,EAAE,OAAO,CAAA;QACtC,oBAAoB,CAAC,EAAE,OAAO,CAAA;QAC9B,WAAW,CAAC,EAAE,OAAO,CAAA;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;KACb;IAiBR;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAchC;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;IAcjC;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC;IAc/B;;OAEG;IACG,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IAUzD;;OAEG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAUtD;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAQhC;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC;IAQlC;;;;OAIG;YACW,sBAAsB;IAmCpC;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAMnC;;OAEG;IACH,aAAa,IAAI,IAAI;IAKrB;;OAEG;IACH,WAAW,IAAI,OAAO;IAItB;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC;CAmCtC"}
|
package/dist/devices/wo-hand.js
CHANGED
|
@@ -3,15 +3,38 @@
|
|
|
3
3
|
* devices/wo-hand.ts: SwitchBot v4.0.0 - Bot (WoHand) Device
|
|
4
4
|
*/
|
|
5
5
|
import { DEVICE_COMMANDS } from '../settings.js';
|
|
6
|
-
import {
|
|
6
|
+
import { BOT_BLE_ACTIONS, buildBotBleCommand, parseBotBleResponse, validateBotPassword } from '../utils/index.js';
|
|
7
|
+
import { DeviceOverrideStateDuringConnection } from './device-override-state-during-connection.js';
|
|
7
8
|
/**
|
|
8
9
|
* Bot (WoHand) Device - Press or switch button device
|
|
10
|
+
* Supports optional BLE password protection
|
|
9
11
|
*/
|
|
10
|
-
export class WoHand extends
|
|
12
|
+
export class WoHand extends DeviceOverrideStateDuringConnection {
|
|
13
|
+
password;
|
|
14
|
+
constructor(info, options = {}) {
|
|
15
|
+
super(info, options);
|
|
16
|
+
// Validate and store password if provided
|
|
17
|
+
if (options.password) {
|
|
18
|
+
try {
|
|
19
|
+
validateBotPassword(options.password);
|
|
20
|
+
this.password = options.password;
|
|
21
|
+
this.logger.info('Bot password configured');
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
this.logger.error('Invalid password format', error);
|
|
25
|
+
throw error;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
11
29
|
/**
|
|
12
30
|
* Turn on (switch mode)
|
|
13
31
|
*/
|
|
14
32
|
async turnOn() {
|
|
33
|
+
// Use password-protected command if password is configured
|
|
34
|
+
if (this.password) {
|
|
35
|
+
return await this.executePasswordCommand(BOT_BLE_ACTIONS.TURN_ON);
|
|
36
|
+
}
|
|
37
|
+
// Standard command
|
|
15
38
|
const result = await this.sendCommand(DEVICE_COMMANDS.BOT.TURN_ON, 'turnOn');
|
|
16
39
|
return result.success;
|
|
17
40
|
}
|
|
@@ -19,6 +42,11 @@ export class WoHand extends SwitchBotDevice {
|
|
|
19
42
|
* Turn off (switch mode)
|
|
20
43
|
*/
|
|
21
44
|
async turnOff() {
|
|
45
|
+
// Use password-protected command if password is configured
|
|
46
|
+
if (this.password) {
|
|
47
|
+
return await this.executePasswordCommand(BOT_BLE_ACTIONS.TURN_OFF);
|
|
48
|
+
}
|
|
49
|
+
// Standard command
|
|
22
50
|
const result = await this.sendCommand(DEVICE_COMMANDS.BOT.TURN_OFF, 'turnOff');
|
|
23
51
|
return result.success;
|
|
24
52
|
}
|
|
@@ -26,9 +54,99 @@ export class WoHand extends SwitchBotDevice {
|
|
|
26
54
|
* Press (press mode)
|
|
27
55
|
*/
|
|
28
56
|
async press() {
|
|
57
|
+
// Use password-protected command if password is configured
|
|
58
|
+
if (this.password) {
|
|
59
|
+
return await this.executePasswordCommand(BOT_BLE_ACTIONS.PRESS);
|
|
60
|
+
}
|
|
61
|
+
// Standard command
|
|
29
62
|
const result = await this.sendCommand(DEVICE_COMMANDS.BOT.PRESS, 'press');
|
|
30
63
|
return result.success;
|
|
31
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Set Bot mode
|
|
67
|
+
*/
|
|
68
|
+
async setMode(mode) {
|
|
69
|
+
const modeByte = mode === 'switch' ? 0x01 : 0x00;
|
|
70
|
+
const result = await this.sendCommand([...DEVICE_COMMANDS.BOT.SET_MODE, modeByte], 'setMode', mode);
|
|
71
|
+
return result.success;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Set Bot long-press duration (1-255 deciseconds)
|
|
75
|
+
*/
|
|
76
|
+
async setLongPress(duration) {
|
|
77
|
+
const clampedDuration = Math.min(255, Math.max(1, Math.trunc(duration)));
|
|
78
|
+
const result = await this.sendCommand([...DEVICE_COMMANDS.BOT.SET_LONG_PRESS, clampedDuration], 'setLongPress', clampedDuration);
|
|
79
|
+
return result.success;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Raise Bot arm
|
|
83
|
+
*/
|
|
84
|
+
async handUp() {
|
|
85
|
+
const result = await this.sendCommand(DEVICE_COMMANDS.BOT.UP, 'turnOff');
|
|
86
|
+
return result.success;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Lower Bot arm
|
|
90
|
+
*/
|
|
91
|
+
async handDown() {
|
|
92
|
+
const result = await this.sendCommand(DEVICE_COMMANDS.BOT.DOWN, 'turnOn');
|
|
93
|
+
return result.success;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Execute password-protected Bot command
|
|
97
|
+
* @param action - Bot action to perform
|
|
98
|
+
* @returns True if command was successful
|
|
99
|
+
*/
|
|
100
|
+
async executePasswordCommand(action) {
|
|
101
|
+
if (!this.password) {
|
|
102
|
+
throw new Error('Password not configured for this Bot device');
|
|
103
|
+
}
|
|
104
|
+
if (!this.hasBLE()) {
|
|
105
|
+
throw new Error('BLE not available - password-protected commands require BLE connection');
|
|
106
|
+
}
|
|
107
|
+
try {
|
|
108
|
+
// Build encrypted command
|
|
109
|
+
const command = buildBotBleCommand(action, this.password);
|
|
110
|
+
this.logger.debug('Sending password-protected command', { action });
|
|
111
|
+
// Send command via BLE
|
|
112
|
+
const mac = this.info.mac ?? `id:${this.info.bleId}`;
|
|
113
|
+
await this.bleConnection.write(mac, command);
|
|
114
|
+
// Read response
|
|
115
|
+
const responseBuffer = await this.bleConnection.read(mac);
|
|
116
|
+
// Parse and validate response
|
|
117
|
+
parseBotBleResponse(responseBuffer);
|
|
118
|
+
this.info.activeConnection = 'ble';
|
|
119
|
+
this.emit('command', { type: 'ble', success: true, encrypted: true });
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
this.logger.error('Password-protected command failed', error);
|
|
124
|
+
this.emit('error', { type: 'ble', error, encrypted: true });
|
|
125
|
+
throw error;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Set or update Bot password
|
|
130
|
+
* @param password - 4-character alphanumeric password (case-sensitive)
|
|
131
|
+
*/
|
|
132
|
+
setPassword(password) {
|
|
133
|
+
validateBotPassword(password);
|
|
134
|
+
this.password = password;
|
|
135
|
+
this.logger.info('Bot password updated');
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Clear Bot password
|
|
139
|
+
*/
|
|
140
|
+
clearPassword() {
|
|
141
|
+
this.password = undefined;
|
|
142
|
+
this.logger.info('Bot password cleared');
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Check if password is configured
|
|
146
|
+
*/
|
|
147
|
+
hasPassword() {
|
|
148
|
+
return !!this.password;
|
|
149
|
+
}
|
|
32
150
|
/**
|
|
33
151
|
* Get device status
|
|
34
152
|
*/
|
|
@@ -49,7 +167,7 @@ export class WoHand extends SwitchBotDevice {
|
|
|
49
167
|
}
|
|
50
168
|
// Fallback to BLE
|
|
51
169
|
if (this.hasBLE()) {
|
|
52
|
-
const bleData = await this.getBLEStatus();
|
|
170
|
+
const bleData = await this.getBLEStatus().catch(() => this.normalizeBLEStatusData(undefined));
|
|
53
171
|
return {
|
|
54
172
|
deviceId: this.info.id,
|
|
55
173
|
connectionType: 'ble',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wo-hand.js","sourceRoot":"","sources":["../../src/devices/wo-hand.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"wo-hand.js","sourceRoot":"","sources":["../../src/devices/wo-hand.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACjH,OAAO,EAAE,mCAAmC,EAAE,MAAM,8CAA8C,CAAA;AAElG;;;GAGG;AACH,MAAM,OAAO,MAAO,SAAQ,mCAAmC;IACrD,QAAQ,CAAS;IAEzB,YACE,IAAgB,EAChB,UAUI,EAAE;QAEN,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QAEpB,0CAA0C;QAC1C,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;YACrB,IAAI,CAAC;gBACH,mBAAmB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;gBACrC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;gBAChC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAA;YAC7C,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAA;gBACnD,MAAM,KAAK,CAAA;YACb,CAAC;QACH,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM;QACV,2DAA2D;QAC3D,IAAI,IAAI,CAAC,QAAQ,EAA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AAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAA;YAChD,MAAM,KAAK,CAAA;QACb,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-hubmini-matter.d.ts","sourceRoot":"","sources":["../../src/devices/wo-hubmini-matter.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,MAAM;CAAG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* Copyright(C) 2024-2026, donavanbecker (https://github.com/donavanbecker). All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* devices/wo-hubmini-matter.ts: SwitchBot v4.0.0 - HubMini Matter Device
|
|
4
|
+
*/
|
|
5
|
+
import { WoHub2 } from './wo-hub2.js';
|
|
6
|
+
/**
|
|
7
|
+
* HubMini Matter Device
|
|
8
|
+
* Uses same hub logic as Hub 2
|
|
9
|
+
*/
|
|
10
|
+
export class WoHubMiniMatter extends WoHub2 {
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=wo-hubmini-matter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-hubmini-matter.js","sourceRoot":"","sources":["../../src/devices/wo-hubmini-matter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC;;;GAGG;AACH,MAAM,OAAO,eAAgB,SAAQ,MAAM;CAAG"}
|
|
@@ -4,5 +4,17 @@ import { WoHumi } from './wo-humi.js';
|
|
|
4
4
|
* Uses same logic as Humidifier
|
|
5
5
|
*/
|
|
6
6
|
export declare class WoHumi2 extends WoHumi {
|
|
7
|
+
/**
|
|
8
|
+
* Set auto mode
|
|
9
|
+
*/
|
|
10
|
+
setAuto(): Promise<boolean>;
|
|
11
|
+
/**
|
|
12
|
+
* Set manual mode
|
|
13
|
+
*/
|
|
14
|
+
setManual(): Promise<boolean>;
|
|
15
|
+
/**
|
|
16
|
+
* Set target humidity level (mapped to nebulization efficiency)
|
|
17
|
+
*/
|
|
18
|
+
setLevel(level: number): Promise<boolean>;
|
|
7
19
|
}
|
|
8
20
|
//# sourceMappingURL=wo-humi2.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wo-humi2.d.ts","sourceRoot":"","sources":["../../src/devices/wo-humi2.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC;;;GAGG;AACH,qBAAa,OAAQ,SAAQ,MAAM;
|
|
1
|
+
{"version":3,"file":"wo-humi2.d.ts","sourceRoot":"","sources":["../../src/devices/wo-humi2.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC;;;GAGG;AACH,qBAAa,OAAQ,SAAQ,MAAM;IACjC;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;IAIjC;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAInC;;OAEG;IACG,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAGhD"}
|
package/dist/devices/wo-humi2.js
CHANGED
|
@@ -8,5 +8,23 @@ import { WoHumi } from './wo-humi.js';
|
|
|
8
8
|
* Uses same logic as Humidifier
|
|
9
9
|
*/
|
|
10
10
|
export class WoHumi2 extends WoHumi {
|
|
11
|
+
/**
|
|
12
|
+
* Set auto mode
|
|
13
|
+
*/
|
|
14
|
+
async setAuto() {
|
|
15
|
+
return this.setMode('auto');
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Set manual mode
|
|
19
|
+
*/
|
|
20
|
+
async setManual() {
|
|
21
|
+
return this.setMode('manual');
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Set target humidity level (mapped to nebulization efficiency)
|
|
25
|
+
*/
|
|
26
|
+
async setLevel(level) {
|
|
27
|
+
return this.setEfficiency(level);
|
|
28
|
+
}
|
|
11
29
|
}
|
|
12
30
|
//# sourceMappingURL=wo-humi2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wo-humi2.js","sourceRoot":"","sources":["../../src/devices/wo-humi2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC;;;GAGG;AACH,MAAM,OAAO,OAAQ,SAAQ,MAAM;
|
|
1
|
+
{"version":3,"file":"wo-humi2.js","sourceRoot":"","sources":["../../src/devices/wo-humi2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC;;;GAGG;AACH,MAAM,OAAO,OAAQ,SAAQ,MAAM;IACjC;;OAEG;IACH,KAAK,CAAC,OAAO;QACX,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAC7B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;IAC/B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;IAClC,CAAC;CACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WoKeypadVisionPro device class for SwitchBot Keypad Vision Pro
|
|
3
|
+
* Extends base WoKeypad functionality for lock keypad operations
|
|
4
|
+
*/
|
|
5
|
+
import type { KeypadStatus } from '../types/device.js';
|
|
6
|
+
import { WoKeypad } from './wo-keypad.js';
|
|
7
|
+
/**
|
|
8
|
+
* SwitchBot Keypad Vision Pro device
|
|
9
|
+
* @extends WoKeypad
|
|
10
|
+
*/
|
|
11
|
+
export declare class WoKeypadVisionPro extends WoKeypad {
|
|
12
|
+
/**
|
|
13
|
+
* Get keypad status (inherited from WoKeypad)
|
|
14
|
+
* @returns Promise resolving to KeypadStatus
|
|
15
|
+
*/
|
|
16
|
+
getStatus(): Promise<KeypadStatus>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=wo-keypad-vision-pro.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-keypad-vision-pro.d.ts","sourceRoot":"","sources":["../../src/devices/wo-keypad-vision-pro.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,QAAQ;IAC7C;;;OAGG;IACG,SAAS,IAAI,OAAO,CAAC,YAAY,CAAC;CAGzC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { WoKeypad } from './wo-keypad.js';
|
|
2
|
+
/**
|
|
3
|
+
* SwitchBot Keypad Vision Pro device
|
|
4
|
+
* @extends WoKeypad
|
|
5
|
+
*/
|
|
6
|
+
export class WoKeypadVisionPro extends WoKeypad {
|
|
7
|
+
/**
|
|
8
|
+
* Get keypad status (inherited from WoKeypad)
|
|
9
|
+
* @returns Promise resolving to KeypadStatus
|
|
10
|
+
*/
|
|
11
|
+
async getStatus() {
|
|
12
|
+
return super.getStatus();
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=wo-keypad-vision-pro.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-keypad-vision-pro.js","sourceRoot":"","sources":["../../src/devices/wo-keypad-vision-pro.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,QAAQ;IAC7C;;;OAGG;IACH,KAAK,CAAC,SAAS;QACb,OAAO,KAAK,CAAC,SAAS,EAAE,CAAA;IAC1B,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-keypad-vision.d.ts","sourceRoot":"","sources":["../../src/devices/wo-keypad-vision.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC;;;GAGG;AACH,qBAAa,cAAe,SAAQ,QAAQ;CAAG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* Copyright(C) 2024-2026, donavanbecker (https://github.com/donavanbecker). All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* devices/wo-keypad-vision.ts: SwitchBot v4.0.0 - Keypad Vision
|
|
4
|
+
*/
|
|
5
|
+
import { WoKeypad } from './wo-keypad.js';
|
|
6
|
+
/**
|
|
7
|
+
* Keypad Vision Device
|
|
8
|
+
* Uses same logic as Keypad for lock control
|
|
9
|
+
*/
|
|
10
|
+
export class WoKeypadVision extends WoKeypad {
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=wo-keypad-vision.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-keypad-vision.js","sourceRoot":"","sources":["../../src/devices/wo-keypad-vision.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC;;;GAGG;AACH,MAAM,OAAO,cAAe,SAAQ,QAAQ;CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-lock-lite.d.ts","sourceRoot":"","sources":["../../src/devices/wo-lock-lite.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE1C;;GAEG;AACH,qBAAa,eAAgB,SAAQ,WAAW;CAAG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* Copyright(C) 2024-2026, donavanbecker (https://github.com/donavanbecker). All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* devices/wo-lock-lite.ts: SwitchBot v4.0.0 - Smart Lock Lite Device
|
|
4
|
+
*/
|
|
5
|
+
import { WoSmartLock } from './wo-lock.js';
|
|
6
|
+
/**
|
|
7
|
+
* Smart Lock Lite Device
|
|
8
|
+
*/
|
|
9
|
+
export class WoSmartLockLite extends WoSmartLock {
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=wo-lock-lite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-lock-lite.js","sourceRoot":"","sources":["../../src/devices/wo-lock-lite.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE1C;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,WAAW;CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-lock-pro-wifi.d.ts","sourceRoot":"","sources":["../../src/devices/wo-lock-pro-wifi.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,cAAc;CAAG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* Copyright(C) 2024-2026, donavanbecker (https://github.com/donavanbecker). All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* devices/wo-lock-pro-wifi.ts: SwitchBot v4.0.0 - Smart Lock Pro WiFi Device
|
|
4
|
+
*/
|
|
5
|
+
import { WoSmartLockPro } from './wo-lock-pro.js';
|
|
6
|
+
/**
|
|
7
|
+
* Smart Lock Pro WiFi Device (with WiFi connectivity and unlatch support)
|
|
8
|
+
*/
|
|
9
|
+
export class WoSmartLockProWiFi extends WoSmartLockPro {
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=wo-lock-pro-wifi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-lock-pro-wifi.js","sourceRoot":"","sources":["../../src/devices/wo-lock-pro-wifi.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,cAAc;CAAG"}
|