node-switchbot 3.6.6 → 4.0.0-beta.1
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/npm-version-script-esm.js +97 -0
- package/CHANGELOG.md +322 -0
- package/PRODUCTION_READY.md +135 -0
- package/README.md +92 -0
- package/dist/api.d.ts +130 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +286 -0
- package/dist/api.js.map +1 -0
- package/dist/ble.d.ts +116 -0
- package/dist/ble.d.ts.map +1 -0
- package/dist/ble.js +430 -0
- package/dist/ble.js.map +1 -0
- package/dist/devices/base.d.ts +146 -0
- package/dist/devices/base.d.ts.map +1 -0
- package/dist/devices/base.js +324 -0
- package/dist/devices/base.js.map +1 -0
- package/dist/devices/index.d.ts +30 -0
- package/dist/devices/index.d.ts.map +1 -0
- package/dist/devices/index.js +34 -0
- package/dist/devices/index.js.map +1 -0
- package/dist/devices/wo-air-purifier-table.d.ts +8 -0
- package/dist/devices/wo-air-purifier-table.d.ts.map +1 -0
- package/dist/devices/wo-air-purifier-table.js +12 -0
- package/dist/devices/wo-air-purifier-table.js.map +1 -0
- package/dist/devices/wo-air-purifier.d.ts +28 -0
- package/dist/devices/wo-air-purifier.d.ts.map +1 -0
- package/dist/devices/wo-air-purifier.js +105 -0
- package/dist/devices/wo-air-purifier.js.map +1 -0
- package/dist/devices/wo-blind-tilt.d.ts +36 -0
- package/dist/devices/wo-blind-tilt.d.ts.map +1 -0
- package/dist/devices/wo-blind-tilt.js +95 -0
- package/dist/devices/wo-blind-tilt.js.map +1 -0
- package/dist/devices/wo-bulb.d.ts +32 -0
- package/dist/devices/wo-bulb.d.ts.map +1 -0
- package/dist/devices/wo-bulb.js +109 -0
- package/dist/devices/wo-bulb.js.map +1 -0
- package/dist/devices/wo-ceiling-light.d.ts +8 -0
- package/dist/devices/wo-ceiling-light.d.ts.map +1 -0
- package/dist/devices/wo-ceiling-light.js +12 -0
- package/dist/devices/wo-ceiling-light.js.map +1 -0
- package/dist/devices/wo-contact.d.ts +12 -0
- package/dist/devices/wo-contact.d.ts.map +1 -0
- package/dist/devices/wo-contact.js +50 -0
- package/dist/devices/wo-contact.js.map +1 -0
- package/dist/devices/wo-curtain.d.ts +28 -0
- package/dist/devices/wo-curtain.d.ts.map +1 -0
- package/dist/devices/wo-curtain.js +82 -0
- package/dist/devices/wo-curtain.js.map +1 -0
- package/dist/devices/wo-hand.d.ts +24 -0
- package/dist/devices/wo-hand.d.ts.map +1 -0
- package/dist/devices/wo-hand.js +70 -0
- package/dist/devices/wo-hand.js.map +1 -0
- package/dist/devices/wo-hub2.d.ts +12 -0
- package/dist/devices/wo-hub2.d.ts.map +1 -0
- package/dist/devices/wo-hub2.js +48 -0
- package/dist/devices/wo-hub2.js.map +1 -0
- package/dist/devices/wo-hub3.d.ts +8 -0
- package/dist/devices/wo-hub3.d.ts.map +1 -0
- package/dist/devices/wo-hub3.js +12 -0
- package/dist/devices/wo-hub3.js.map +1 -0
- package/dist/devices/wo-humi.d.ts +28 -0
- package/dist/devices/wo-humi.d.ts.map +1 -0
- package/dist/devices/wo-humi.js +91 -0
- package/dist/devices/wo-humi.js.map +1 -0
- package/dist/devices/wo-humi2.d.ts +8 -0
- package/dist/devices/wo-humi2.d.ts.map +1 -0
- package/dist/devices/wo-humi2.js +12 -0
- package/dist/devices/wo-humi2.js.map +1 -0
- package/dist/devices/wo-io-sensor-th.d.ts +8 -0
- package/dist/devices/wo-io-sensor-th.d.ts.map +1 -0
- package/dist/devices/wo-io-sensor-th.js +12 -0
- package/dist/devices/wo-io-sensor-th.js.map +1 -0
- package/dist/devices/wo-keypad.d.ts +13 -0
- package/dist/devices/wo-keypad.d.ts.map +1 -0
- package/dist/devices/wo-keypad.js +46 -0
- package/dist/devices/wo-keypad.js.map +1 -0
- package/dist/devices/wo-leak.d.ts +12 -0
- package/dist/devices/wo-leak.d.ts.map +1 -0
- package/dist/devices/wo-leak.js +46 -0
- package/dist/devices/wo-leak.js.map +1 -0
- package/dist/devices/wo-lock-pro.d.ts +24 -0
- package/dist/devices/wo-lock-pro.d.ts.map +1 -0
- package/dist/devices/wo-lock-pro.js +72 -0
- package/dist/devices/wo-lock-pro.js.map +1 -0
- package/dist/devices/wo-lock.d.ts +20 -0
- package/dist/devices/wo-lock.d.ts.map +1 -0
- package/dist/devices/wo-lock.js +64 -0
- package/dist/devices/wo-lock.js.map +1 -0
- package/dist/devices/wo-plug-mini-jp.d.ts +8 -0
- package/dist/devices/wo-plug-mini-jp.d.ts.map +1 -0
- package/dist/devices/wo-plug-mini-jp.js +12 -0
- package/dist/devices/wo-plug-mini-jp.js.map +1 -0
- package/dist/devices/wo-plug-mini-us.d.ts +24 -0
- package/dist/devices/wo-plug-mini-us.d.ts.map +1 -0
- package/dist/devices/wo-plug-mini-us.js +70 -0
- package/dist/devices/wo-plug-mini-us.js.map +1 -0
- package/dist/devices/wo-presence.d.ts +12 -0
- package/dist/devices/wo-presence.d.ts.map +1 -0
- package/dist/devices/wo-presence.js +48 -0
- package/dist/devices/wo-presence.js.map +1 -0
- package/dist/devices/wo-relay-switch-1.d.ts +24 -0
- package/dist/devices/wo-relay-switch-1.d.ts.map +1 -0
- package/dist/devices/wo-relay-switch-1.js +70 -0
- package/dist/devices/wo-relay-switch-1.js.map +1 -0
- package/dist/devices/wo-relay-switch-1pm.d.ts +8 -0
- package/dist/devices/wo-relay-switch-1pm.d.ts.map +1 -0
- package/dist/devices/wo-relay-switch-1pm.js +12 -0
- package/dist/devices/wo-relay-switch-1pm.js.map +1 -0
- package/dist/devices/wo-remote.d.ts +13 -0
- package/dist/devices/wo-remote.d.ts.map +1 -0
- package/dist/devices/wo-remote.js +45 -0
- package/dist/devices/wo-remote.js.map +1 -0
- package/dist/devices/wo-sensor-th-plus.d.ts +8 -0
- package/dist/devices/wo-sensor-th-plus.d.ts.map +1 -0
- package/dist/devices/wo-sensor-th-plus.js +12 -0
- package/dist/devices/wo-sensor-th-plus.js.map +1 -0
- package/dist/devices/wo-sensor-th-pro-co2.d.ts +8 -0
- package/dist/devices/wo-sensor-th-pro-co2.d.ts.map +1 -0
- package/dist/devices/wo-sensor-th-pro-co2.js +12 -0
- package/dist/devices/wo-sensor-th-pro-co2.js.map +1 -0
- package/dist/devices/wo-sensor-th-pro.d.ts +8 -0
- package/dist/devices/wo-sensor-th-pro.d.ts.map +1 -0
- package/dist/devices/wo-sensor-th-pro.js +12 -0
- package/dist/devices/wo-sensor-th-pro.js.map +1 -0
- package/dist/devices/wo-sensor-th.d.ts +12 -0
- package/dist/devices/wo-sensor-th.d.ts.map +1 -0
- package/dist/devices/wo-sensor-th.js +49 -0
- package/dist/devices/wo-sensor-th.js.map +1 -0
- package/dist/devices/wo-strip.d.ts +8 -0
- package/dist/devices/wo-strip.d.ts.map +1 -0
- package/dist/devices/wo-strip.js +12 -0
- package/dist/devices/wo-strip.js.map +1 -0
- package/dist/errors.d.ts +63 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +103 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +10 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -10
- package/dist/index.js.map +1 -1
- package/dist/settings.d.ts +126 -47
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +214 -64
- package/dist/settings.js.map +1 -1
- package/dist/switchbot.d.ts +87 -0
- package/dist/switchbot.d.ts.map +1 -0
- package/dist/switchbot.js +422 -0
- package/dist/switchbot.js.map +1 -0
- package/dist/types/api.d.ts +187 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/api.js +6 -0
- package/dist/types/api.js.map +1 -0
- package/dist/types/ble.d.ts +246 -348
- package/dist/types/ble.d.ts.map +1 -1
- package/dist/types/ble.js +94 -1
- package/dist/types/ble.js.map +1 -1
- package/dist/types/device.d.ts +209 -0
- package/dist/types/device.d.ts.map +1 -0
- package/dist/types/device.js +6 -0
- package/dist/types/device.js.map +1 -0
- package/dist/types/index.d.ts +115 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +19 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/index.d.ts +97 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +206 -0
- package/dist/utils/index.js.map +1 -0
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/highlight.css +20 -6
- package/docs/assets/icons.js +1 -1
- package/docs/assets/icons.svg +1 -1
- package/docs/assets/main.js +2 -2
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +3 -3
- package/docs/classes/APIError.html +6 -0
- package/docs/classes/APINotAvailableError.html +4 -0
- package/docs/classes/BLEConnection.html +17 -0
- package/docs/classes/BLENotAvailableError.html +4 -0
- package/docs/classes/BLEScanner.html +15 -0
- package/docs/classes/CommandFailedError.html +6 -0
- package/docs/classes/ConnectionTimeoutError.html +5 -0
- package/docs/classes/DeviceManager.html +25 -0
- package/docs/classes/DeviceNotFoundError.html +4 -0
- package/docs/classes/DiscoveryError.html +5 -0
- package/docs/classes/OpenAPIClient.html +66 -0
- package/docs/classes/SwitchBot.html +22 -0
- package/docs/classes/SwitchBotDevice.html +28 -0
- package/docs/classes/SwitchBotError.html +4 -0
- package/docs/classes/ValidationError.html +5 -0
- package/docs/classes/WoAirPurifier.html +32 -80
- package/docs/classes/WoAirPurifierTable.html +36 -83
- package/docs/classes/WoBlindTilt.html +34 -73
- package/docs/classes/WoBulb.html +33 -85
- package/docs/classes/WoCeilingLight.html +38 -107
- package/docs/classes/WoContact.html +27 -52
- package/docs/classes/WoCurtain.html +32 -69
- package/docs/classes/WoHand.html +30 -59
- package/docs/classes/WoHub2.html +27 -52
- package/docs/classes/WoHub3.html +28 -52
- package/docs/classes/WoHumi.html +33 -65
- package/docs/classes/WoHumi2.html +36 -67
- package/docs/classes/WoIOSensorTH.html +28 -53
- package/docs/classes/WoKeypad.html +28 -52
- package/docs/classes/WoLeak.html +27 -53
- package/docs/classes/WoPlugMiniJP.html +34 -78
- package/docs/classes/WoPlugMiniUS.html +30 -75
- package/docs/classes/WoPresence.html +27 -60
- package/docs/classes/WoRelaySwitch1.html +31 -55
- package/docs/classes/WoRelaySwitch1PM.html +34 -57
- package/docs/classes/WoRemote.html +28 -52
- package/docs/classes/WoSensorTH.html +27 -46
- package/docs/classes/WoSensorTHPlus.html +28 -46
- package/docs/classes/WoSensorTHPro.html +28 -46
- package/docs/classes/WoSensorTHProCO2.html +28 -46
- package/docs/classes/WoSmartLock.html +29 -111
- package/docs/classes/WoSmartLockPro.html +31 -111
- package/docs/classes/WoStrip.html +38 -94
- package/docs/enums/LogLevel.html +4 -7
- package/docs/enums/SwitchBotBLEModel.html +11 -6
- package/docs/enums/SwitchBotBLEModelName.html +13 -6
- package/docs/functions/updateBaseURL.html +3 -3
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +40 -6
- package/docs/interfaces/APICommandRequest.html +5 -0
- package/docs/interfaces/APICommandResponse.html +5 -0
- package/docs/interfaces/APIDevice.html +18 -0
- package/docs/interfaces/APIDeviceStatus.html +36 -0
- package/docs/interfaces/APIErrorResponse.html +5 -0
- package/docs/interfaces/APIResponse.html +5 -0
- package/docs/interfaces/AirPurifierCommands.html +5 -0
- package/docs/interfaces/AirPurifierServiceData.html +14 -0
- package/docs/interfaces/AirPurifierStatus.html +17 -0
- package/docs/interfaces/BLEAdvertisement.html +6 -0
- package/docs/interfaces/BLEScanOptions.html +10 -0
- package/docs/interfaces/BLEServiceData.html +10 -0
- package/docs/interfaces/BlindTiltCommands.html +7 -0
- package/docs/interfaces/BlindTiltServiceData.html +14 -0
- package/docs/interfaces/BlindTiltStatus.html +15 -0
- package/docs/interfaces/BotCommands.html +4 -0
- package/docs/interfaces/BotServiceData.html +12 -0
- package/docs/interfaces/BotStatus.html +14 -0
- package/docs/interfaces/BulbCommands.html +6 -0
- package/docs/interfaces/BulbServiceData.html +19 -0
- package/docs/interfaces/BulbStatus.html +16 -0
- package/docs/interfaces/CeilingLightCommands.html +6 -0
- package/docs/interfaces/CeilingLightServiceData.html +19 -0
- package/docs/interfaces/CeilingLightStatus.html +16 -0
- package/docs/interfaces/CommandResult.html +12 -0
- package/docs/interfaces/ContactServiceData.html +13 -0
- package/docs/interfaces/ContactStatus.html +15 -0
- package/docs/interfaces/CurtainCommands.html +5 -0
- package/docs/interfaces/CurtainServiceData.html +14 -0
- package/docs/interfaces/CurtainStatus.html +17 -0
- package/docs/interfaces/DeviceInfo.html +26 -0
- package/docs/interfaces/DeviceListResponse.html +4 -0
- package/docs/interfaces/DeviceStatus.html +12 -0
- package/docs/interfaces/DiscoveryOptions.html +14 -0
- package/docs/interfaces/HubServiceData.html +14 -0
- package/docs/interfaces/HubStatus.html +15 -0
- package/docs/interfaces/HumidifierCommands.html +5 -0
- package/docs/interfaces/HumidifierServiceData.html +14 -0
- package/docs/interfaces/HumidifierStatus.html +18 -0
- package/docs/interfaces/KeypadStatus.html +13 -0
- package/docs/interfaces/LeakServiceData.html +11 -0
- package/docs/interfaces/LeakStatus.html +13 -0
- package/docs/interfaces/LockCommands.html +3 -0
- package/docs/interfaces/LockServiceData.html +15 -0
- package/docs/interfaces/LockStatus.html +15 -0
- package/docs/interfaces/MeterServiceData.html +13 -0
- package/docs/interfaces/MeterStatus.html +15 -0
- package/docs/interfaces/MotionServiceData.html +13 -0
- package/docs/interfaces/MotionStatus.html +14 -0
- package/docs/interfaces/PlugCommands.html +4 -0
- package/docs/interfaces/PlugServiceData.html +17 -0
- package/docs/interfaces/PlugStatus.html +16 -0
- package/docs/interfaces/PresenceServiceData.html +12 -0
- package/docs/interfaces/PresenceStatus.html +14 -0
- package/docs/interfaces/RelaySwitchCommands.html +4 -0
- package/docs/interfaces/RelaySwitchServiceData.html +14 -0
- package/docs/interfaces/RelaySwitchStatus.html +16 -0
- package/docs/interfaces/RemoteStatus.html +12 -0
- package/docs/interfaces/SceneListResponse.html +3 -0
- package/docs/interfaces/StripCommands.html +6 -0
- package/docs/interfaces/StripServiceData.html +19 -0
- package/docs/interfaces/StripStatus.html +16 -0
- package/docs/interfaces/SwitchBotConfig.html +18 -0
- package/docs/interfaces/WebhookConfig.html +4 -0
- package/docs/interfaces/WebhookDetails.html +7 -0
- package/docs/interfaces/WebhookQueryResponse.html +5 -0
- package/docs/interfaces/WebhookSetupResponse.html +5 -0
- package/docs/modules.html +1 -1
- package/docs/types/ConnectionType.html +2 -0
- package/docs/types/PhysicalDeviceType.html +2 -0
- package/docs/types/VirtualDeviceType.html +2 -0
- package/docs/variables/urls.html +1 -1
- package/package.json +12 -21
- package/.github/scripts/npm-version-script-esm-auto.js +0 -207
- package/dist/device.d.ts +0 -1626
- package/dist/device.d.ts.map +0 -1
- package/dist/device.js +0 -3602
- package/dist/device.js.map +0 -1
- package/dist/device.test.d.ts +0 -2
- package/dist/device.test.d.ts.map +0 -1
- package/dist/device.test.js +0 -336
- package/dist/device.test.js.map +0 -1
- package/dist/index.test.d.ts +0 -2
- package/dist/index.test.d.ts.map +0 -1
- package/dist/index.test.js +0 -14
- package/dist/index.test.js.map +0 -1
- package/dist/parameter-checker.d.ts +0 -91
- package/dist/parameter-checker.d.ts.map +0 -1
- package/dist/parameter-checker.js +0 -262
- package/dist/parameter-checker.js.map +0 -1
- package/dist/parameter-checker.test.d.ts +0 -2
- package/dist/parameter-checker.test.d.ts.map +0 -1
- package/dist/parameter-checker.test.js +0 -56
- package/dist/parameter-checker.test.js.map +0 -1
- package/dist/settings.test.d.ts +0 -2
- package/dist/settings.test.d.ts.map +0 -1
- package/dist/settings.test.js +0 -61
- package/dist/settings.test.js.map +0 -1
- package/dist/switchbot-ble.d.ts +0 -89
- package/dist/switchbot-ble.d.ts.map +0 -1
- package/dist/switchbot-ble.js +0 -320
- package/dist/switchbot-ble.js.map +0 -1
- package/dist/switchbot-ble.test.d.ts +0 -2
- package/dist/switchbot-ble.test.d.ts.map +0 -1
- package/dist/switchbot-ble.test.js +0 -32
- package/dist/switchbot-ble.test.js.map +0 -1
- package/dist/switchbot-openapi.d.ts +0 -139
- package/dist/switchbot-openapi.d.ts.map +0 -1
- package/dist/switchbot-openapi.js +0 -375
- package/dist/switchbot-openapi.js.map +0 -1
- package/dist/switchbot-openapi.test.d.ts +0 -2
- package/dist/switchbot-openapi.test.d.ts.map +0 -1
- package/dist/switchbot-openapi.test.js +0 -36
- package/dist/switchbot-openapi.test.js.map +0 -1
- package/dist/types/ble-guards.d.ts +0 -12
- package/dist/types/ble-guards.d.ts.map +0 -1
- package/dist/types/ble-guards.js +0 -10
- package/dist/types/ble-guards.js.map +0 -1
- package/dist/types/ble-guards.test.d.ts +0 -2
- package/dist/types/ble-guards.test.d.ts.map +0 -1
- package/dist/types/ble-guards.test.js +0 -62
- package/dist/types/ble-guards.test.js.map +0 -1
- package/dist/types/openapi.d.ts +0 -638
- package/dist/types/openapi.d.ts.map +0 -1
- package/dist/types/openapi.js +0 -3
- package/dist/types/openapi.js.map +0 -1
- package/docs/classes/Advertising.html +0 -21
- package/docs/classes/ErrorUtils.html +0 -25
- package/docs/classes/ParameterChecker.html +0 -69
- package/docs/classes/SwitchBotBLE.html +0 -39
- package/docs/classes/SwitchBotOpenAPI.html +0 -57
- package/docs/classes/SwitchbotDevice.html +0 -47
- package/docs/classes/ValidationUtils.html +0 -51
- package/docs/classes/WoPlugMiniEU.html +0 -84
- package/docs/classes/WoSmartLockUltra.html +0 -113
- package/docs/enums/SwitchBotBLEModelFriendlyName.html +0 -39
- package/docs/enums/SwitchBotModel.html +0 -53
- package/docs/interfaces/AdvertisementData.html +0 -3
- package/docs/interfaces/Chars.html +0 -4
- package/docs/interfaces/ColorLightServiceDataBase.html +0 -17
- package/docs/interfaces/ErrorObject.html +0 -3
- package/docs/interfaces/LockBaseServiceData.html +0 -15
- package/docs/interfaces/NobleTypes.html +0 -3
- package/docs/interfaces/Params.html +0 -6
- package/docs/interfaces/PlugMiniServiceDataBase.html +0 -12
- package/docs/interfaces/Rule.html +0 -9
- package/docs/interfaces/ServiceData.html +0 -2
- package/docs/interfaces/SwitchBotBLEDevice.html +0 -28
- package/docs/interfaces/SwitchBotScanner.html +0 -6
- package/docs/interfaces/TemperatureServiceDataBase.html +0 -10
- package/docs/interfaces/WebhookDetail.html +0 -6
- package/docs/interfaces/ad.html +0 -5
- package/docs/interfaces/body.html +0 -3
- package/docs/interfaces/bodyChange.html +0 -4
- package/docs/interfaces/deleteWebhookResponse.html +0 -4
- package/docs/interfaces/device.html +0 -7
- package/docs/interfaces/deviceList.html +0 -2
- package/docs/interfaces/deviceStatus.html +0 -7
- package/docs/interfaces/deviceStatusRequest.html +0 -4
- package/docs/interfaces/deviceWebhook.html +0 -4
- package/docs/interfaces/deviceWebhookContext.html +0 -4
- package/docs/interfaces/devices.html +0 -4
- package/docs/interfaces/infraredRemoteList.html +0 -2
- package/docs/interfaces/irdevice.html +0 -5
- package/docs/interfaces/pushRequest.html +0 -5
- package/docs/interfaces/pushResponse.html +0 -5
- package/docs/interfaces/pushResponseBody.html +0 -3
- package/docs/interfaces/queryWebhookResponse.html +0 -4
- package/docs/interfaces/setupWebhookResponse.html +0 -4
- package/docs/interfaces/updateWebhookResponse.html +0 -4
- package/docs/interfaces/webhookRequest.html +0 -4
- package/docs/types/BLEDeviceServiceData.html +0 -1
- package/docs/types/IndoorCam.html +0 -1
- package/docs/types/MacAddress.html +0 -1
- package/docs/types/airPurifier.html +0 -1
- package/docs/types/airPurifierPM25WebhookContext.html +0 -1
- package/docs/types/airPurifierServiceData.html +0 -1
- package/docs/types/airPurifierStatus.html +0 -1
- package/docs/types/airPurifierTable.html +0 -1
- package/docs/types/airPurifierTablePM25WebhookContext.html +0 -1
- package/docs/types/airPurifierTableServiceData.html +0 -1
- package/docs/types/airPurifierTableStatus.html +0 -1
- package/docs/types/airPurifierTableVOC.html +0 -1
- package/docs/types/airPurifierTableVOCStatus.html +0 -1
- package/docs/types/airPurifierTableVOCWebhookContext.html +0 -1
- package/docs/types/airPurifierTableWebhookContext.html +0 -1
- package/docs/types/airPurifierVOC.html +0 -1
- package/docs/types/airPurifierVOCStatus.html +0 -1
- package/docs/types/airPurifierVOCWebhookContext.html +0 -1
- package/docs/types/airPurifierWebhookContext.html +0 -1
- package/docs/types/batteryCirculatorFan.html +0 -1
- package/docs/types/batteryCirculatorFanServiceData.html +0 -1
- package/docs/types/batteryCirculatorFanStatus.html +0 -1
- package/docs/types/batteryCirculatorFanWebhookContext.html +0 -1
- package/docs/types/blindTilt.html +0 -1
- package/docs/types/blindTiltServiceData.html +0 -1
- package/docs/types/blindTiltStatus.html +0 -1
- package/docs/types/blindTiltWebhookContext.html +0 -1
- package/docs/types/bot.html +0 -1
- package/docs/types/botServiceData.html +0 -1
- package/docs/types/botStatus.html +0 -1
- package/docs/types/botWebhookContext.html +0 -1
- package/docs/types/ceilingLight.html +0 -1
- package/docs/types/ceilingLightPro.html +0 -1
- package/docs/types/ceilingLightProServiceData.html +0 -1
- package/docs/types/ceilingLightProStatus.html +0 -1
- package/docs/types/ceilingLightProWebhookContext.html +0 -1
- package/docs/types/ceilingLightServiceData.html +0 -1
- package/docs/types/ceilingLightStatus.html +0 -1
- package/docs/types/ceilingLightWebhookContext.html +0 -1
- package/docs/types/circulatorFanStatus.html +0 -1
- package/docs/types/circulatorFanWebhookContext.html +0 -1
- package/docs/types/colorBulb.html +0 -1
- package/docs/types/colorBulbServiceData.html +0 -1
- package/docs/types/colorBulbStatus.html +0 -1
- package/docs/types/colorBulbWebhookContext.html +0 -1
- package/docs/types/commandType.html +0 -2
- package/docs/types/contactSensor.html +0 -1
- package/docs/types/contactSensorServiceData.html +0 -1
- package/docs/types/contactSensorStatus.html +0 -1
- package/docs/types/contactSensorWebhookContext.html +0 -1
- package/docs/types/curtain.html +0 -1
- package/docs/types/curtain3.html +0 -1
- package/docs/types/curtain3ServiceData.html +0 -1
- package/docs/types/curtain3WebhookContext.html +0 -1
- package/docs/types/curtainServiceData.html +0 -1
- package/docs/types/curtainStatus.html +0 -1
- package/docs/types/curtainWebhookContext.html +0 -1
- package/docs/types/floorCleaningRobotS10.html +0 -1
- package/docs/types/floorCleaningRobotS10Status.html +0 -1
- package/docs/types/floorCleaningRobotS10WebhookContext.html +0 -1
- package/docs/types/hub2.html +0 -1
- package/docs/types/hub2ServiceData.html +0 -1
- package/docs/types/hub2Status.html +0 -1
- package/docs/types/hub2WebhookContext.html +0 -1
- package/docs/types/hub3ServiceData.html +0 -1
- package/docs/types/humidifier.html +0 -1
- package/docs/types/humidifier2ServiceData.html +0 -1
- package/docs/types/humidifier2Status.html +0 -1
- package/docs/types/humidifier2WebhookContext.html +0 -1
- package/docs/types/humidifierServiceData.html +0 -1
- package/docs/types/humidifierStatus.html +0 -1
- package/docs/types/humidifierWebhookContext.html +0 -1
- package/docs/types/indoorCameraWebhookContext.html +0 -1
- package/docs/types/keypad.html +0 -1
- package/docs/types/keypadDetectorServiceData.html +0 -1
- package/docs/types/keypadTouch.html +0 -1
- package/docs/types/keypadTouchWebhookContext.html +0 -1
- package/docs/types/keypadWebhookContext.html +0 -1
- package/docs/types/lock.html +0 -1
- package/docs/types/lockPro.html +0 -1
- package/docs/types/lockProServiceData.html +0 -1
- package/docs/types/lockProStatus.html +0 -1
- package/docs/types/lockProWebhookContext.html +0 -1
- package/docs/types/lockServiceData.html +0 -1
- package/docs/types/lockStatus.html +0 -1
- package/docs/types/lockWebhookContext.html +0 -1
- package/docs/types/meter.html +0 -1
- package/docs/types/meterPlus.html +0 -1
- package/docs/types/meterPlusServiceData.html +0 -1
- package/docs/types/meterPlusStatus.html +0 -1
- package/docs/types/meterPlusWebhookContext.html +0 -1
- package/docs/types/meterPro.html +0 -1
- package/docs/types/meterProCO2ServiceData.html +0 -1
- package/docs/types/meterProCO2Status.html +0 -1
- package/docs/types/meterProCO2WebhookContext.html +0 -1
- package/docs/types/meterProServiceData.html +0 -1
- package/docs/types/meterProStatus.html +0 -1
- package/docs/types/meterProWebhookContext.html +0 -1
- package/docs/types/meterServiceData.html +0 -1
- package/docs/types/meterStatus.html +0 -1
- package/docs/types/meterWebhookContext.html +0 -1
- package/docs/types/motionSensor.html +0 -1
- package/docs/types/motionSensorServiceData.html +0 -1
- package/docs/types/motionSensorStatus.html +0 -1
- package/docs/types/motionSensorWebhookContext.html +0 -1
- package/docs/types/onadvertisement.html +0 -1
- package/docs/types/ondiscover.html +0 -1
- package/docs/types/outdoorMeter.html +0 -1
- package/docs/types/outdoorMeterServiceData.html +0 -1
- package/docs/types/outdoorMeterStatus.html +0 -1
- package/docs/types/outdoorMeterWebhookContext.html +0 -1
- package/docs/types/panTiltCamWebhookContext.html +0 -1
- package/docs/types/pantiltCam.html +0 -1
- package/docs/types/pantiltCam2k.html +0 -1
- package/docs/types/plug.html +0 -1
- package/docs/types/plugMini.html +0 -1
- package/docs/types/plugMiniEUServiceData.html +0 -1
- package/docs/types/plugMiniEUWebhookContext.html +0 -1
- package/docs/types/plugMiniJPServiceData.html +0 -1
- package/docs/types/plugMiniJPWebhookContext.html +0 -1
- package/docs/types/plugMiniStatus.html +0 -1
- package/docs/types/plugMiniUSServiceData.html +0 -1
- package/docs/types/plugMiniUSWebhookContext.html +0 -1
- package/docs/types/plugStatus.html +0 -1
- package/docs/types/plugWebhookContext.html +0 -1
- package/docs/types/presenceSensor.html +0 -1
- package/docs/types/presenceSensorServiceData.html +0 -1
- package/docs/types/presenceSensorStatus.html +0 -1
- package/docs/types/presenceSensorWebhookContext.html +0 -1
- package/docs/types/relaySwitch1Context.html +0 -1
- package/docs/types/relaySwitch1PMContext.html +0 -1
- package/docs/types/relaySwitch1PMServiceData.html +0 -1
- package/docs/types/relaySwitch1PMStatus.html +0 -1
- package/docs/types/relaySwitch1ServiceData.html +0 -1
- package/docs/types/relaySwitch1Status.html +0 -1
- package/docs/types/remote.html +0 -1
- package/docs/types/remoteServiceData.html +0 -1
- package/docs/types/robotVacuumCleanerS1.html +0 -1
- package/docs/types/robotVacuumCleanerS1Plus.html +0 -1
- package/docs/types/robotVacuumCleanerS1PlusStatus.html +0 -1
- package/docs/types/robotVacuumCleanerS1PlusWebhookContext.html +0 -1
- package/docs/types/robotVacuumCleanerS1Status.html +0 -1
- package/docs/types/robotVacuumCleanerS1WebhookContext.html +0 -1
- package/docs/types/robotVacuumCleanerServiceData.html +0 -1
- package/docs/types/stripLight.html +0 -1
- package/docs/types/stripLightServiceData.html +0 -1
- package/docs/types/stripLightStatus.html +0 -1
- package/docs/types/stripLightWebhookContext.html +0 -1
- package/docs/types/waterLeakDetector.html +0 -1
- package/docs/types/waterLeakDetectorServiceData.html +0 -1
- package/docs/types/waterLeakDetectorStatus.html +0 -1
- package/docs/types/waterLeakDetectorWebhookContext.html +0 -1
- package/docs/variables/parameterChecker.html +0 -1
- package/eslint.config.js +0 -48
- package/typedoc.json +0 -17
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-hub3.d.ts","sourceRoot":"","sources":["../../src/devices/wo-hub3.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC;;;GAGG;AACH,qBAAa,MAAO,SAAQ,MAAM;CAAG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* Copyright(C) 2024-2026, donavanbecker (https://github.com/donavanbecker). All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* devices/wo-hub3.ts: SwitchBot v4.0.0 - Hub 3 Device
|
|
4
|
+
*/
|
|
5
|
+
import { WoHub2 } from './wo-hub2.js';
|
|
6
|
+
/**
|
|
7
|
+
* Hub 3 Device
|
|
8
|
+
* Uses same logic as Hub 2
|
|
9
|
+
*/
|
|
10
|
+
export class WoHub3 extends WoHub2 {
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=wo-hub3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-hub3.js","sourceRoot":"","sources":["../../src/devices/wo-hub3.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC;;;GAGG;AACH,MAAM,OAAO,MAAO,SAAQ,MAAM;CAAG"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { HumidifierCommands, HumidifierStatus } from '../types/device.js';
|
|
2
|
+
import { SwitchBotDevice } from './base.js';
|
|
3
|
+
/**
|
|
4
|
+
* Humidifier Device
|
|
5
|
+
*/
|
|
6
|
+
export declare class WoHumi extends SwitchBotDevice implements HumidifierCommands {
|
|
7
|
+
/**
|
|
8
|
+
* Turn on
|
|
9
|
+
*/
|
|
10
|
+
turnOn(): Promise<boolean>;
|
|
11
|
+
/**
|
|
12
|
+
* Turn off
|
|
13
|
+
*/
|
|
14
|
+
turnOff(): Promise<boolean>;
|
|
15
|
+
/**
|
|
16
|
+
* Set mode (auto/manual)
|
|
17
|
+
*/
|
|
18
|
+
setMode(mode: 'auto' | 'manual'): Promise<boolean>;
|
|
19
|
+
/**
|
|
20
|
+
* Set nebulization efficiency (0-100)
|
|
21
|
+
*/
|
|
22
|
+
setEfficiency(level: number): Promise<boolean>;
|
|
23
|
+
/**
|
|
24
|
+
* Get device status
|
|
25
|
+
*/
|
|
26
|
+
getStatus(): Promise<HumidifierStatus>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=wo-humi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-humi.d.ts","sourceRoot":"","sources":["../../src/devices/wo-humi.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAI9E,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3C;;GAEG;AACH,qBAAa,MAAO,SAAQ,eAAgB,YAAW,kBAAkB;IACvE;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAQhC;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;IAQjC;;OAEG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IAaxD;;OAEG;IACG,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAiBpD;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAuC7C"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/* Copyright(C) 2024-2026, donavanbecker (https://github.com/donavanbecker). All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* devices/wo-humi.ts: SwitchBot v4.0.0 - Humidifier Device
|
|
4
|
+
*/
|
|
5
|
+
import { DEVICE_COMMANDS } from '../settings.js';
|
|
6
|
+
import { clamp, hexToBuffer } from '../utils/index.js';
|
|
7
|
+
import { SwitchBotDevice } from './base.js';
|
|
8
|
+
/**
|
|
9
|
+
* Humidifier Device
|
|
10
|
+
*/
|
|
11
|
+
export class WoHumi extends SwitchBotDevice {
|
|
12
|
+
/**
|
|
13
|
+
* Turn on
|
|
14
|
+
*/
|
|
15
|
+
async turnOn() {
|
|
16
|
+
const result = await this.sendCommand(hexToBuffer(DEVICE_COMMANDS.HUMIDIFIER.TURN_ON), 'turnOn');
|
|
17
|
+
return result.success;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Turn off
|
|
21
|
+
*/
|
|
22
|
+
async turnOff() {
|
|
23
|
+
const result = await this.sendCommand(hexToBuffer(DEVICE_COMMANDS.HUMIDIFIER.TURN_OFF), 'turnOff');
|
|
24
|
+
return result.success;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Set mode (auto/manual)
|
|
28
|
+
*/
|
|
29
|
+
async setMode(mode) {
|
|
30
|
+
const bleCommand = mode === 'auto'
|
|
31
|
+
? DEVICE_COMMANDS.HUMIDIFIER.SET_AUTO_MODE
|
|
32
|
+
: DEVICE_COMMANDS.HUMIDIFIER.SET_MANUAL_MODE;
|
|
33
|
+
const result = await this.sendCommand(hexToBuffer(bleCommand), 'setMode', mode === 'auto' ? 'auto' : '101');
|
|
34
|
+
return result.success;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Set nebulization efficiency (0-100)
|
|
38
|
+
*/
|
|
39
|
+
async setEfficiency(level) {
|
|
40
|
+
const clampedLevel = clamp(level, 0, 100);
|
|
41
|
+
// For BLE, use increase/decrease commands based on desired level
|
|
42
|
+
// This is a simplified approach - full implementation would track current level
|
|
43
|
+
const bleCommand = clampedLevel > 50
|
|
44
|
+
? hexToBuffer(DEVICE_COMMANDS.HUMIDIFIER.INCREASE)
|
|
45
|
+
: hexToBuffer(DEVICE_COMMANDS.HUMIDIFIER.DECREASE);
|
|
46
|
+
const result = await this.sendCommand(bleCommand, 'setMode', clampedLevel.toString());
|
|
47
|
+
return result.success;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get device status
|
|
51
|
+
*/
|
|
52
|
+
async getStatus() {
|
|
53
|
+
try {
|
|
54
|
+
// Try API first if available
|
|
55
|
+
if (this.hasAPI()) {
|
|
56
|
+
const apiStatus = await this.getAPIStatus();
|
|
57
|
+
return {
|
|
58
|
+
deviceId: this.info.id,
|
|
59
|
+
connectionType: 'api',
|
|
60
|
+
power: apiStatus.power || 'off',
|
|
61
|
+
humidity: apiStatus.humidity,
|
|
62
|
+
mode: apiStatus.auto ? 'auto' : 'manual',
|
|
63
|
+
nebulizationEfficiency: apiStatus.nebulizationEfficiency,
|
|
64
|
+
lackWater: apiStatus.lackWater,
|
|
65
|
+
temperature: apiStatus.temperature,
|
|
66
|
+
version: apiStatus.version,
|
|
67
|
+
updatedAt: new Date(),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
// Fallback to BLE
|
|
71
|
+
if (this.hasBLE()) {
|
|
72
|
+
const bleData = await this.getBLEStatus();
|
|
73
|
+
return {
|
|
74
|
+
deviceId: this.info.id,
|
|
75
|
+
connectionType: 'ble',
|
|
76
|
+
power: bleData.onState ? 'on' : 'off',
|
|
77
|
+
mode: bleData.autoMode ? 'auto' : 'manual',
|
|
78
|
+
nebulizationEfficiency: bleData.percentage,
|
|
79
|
+
lackWater: bleData.lackWater,
|
|
80
|
+
updatedAt: new Date(),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
throw new Error('No connection method available');
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
this.logger.error('Failed to get status', error);
|
|
87
|
+
throw error;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=wo-humi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-humi.js","sourceRoot":"","sources":["../../src/devices/wo-humi.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +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;CAAG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* Copyright(C) 2024-2026, donavanbecker (https://github.com/donavanbecker). All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* devices/wo-humi2.ts: SwitchBot v4.0.0 - Humidifier 2 Device
|
|
4
|
+
*/
|
|
5
|
+
import { WoHumi } from './wo-humi.js';
|
|
6
|
+
/**
|
|
7
|
+
* Humidifier 2 Device
|
|
8
|
+
* Uses same logic as Humidifier
|
|
9
|
+
*/
|
|
10
|
+
export class WoHumi2 extends WoHumi {
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=wo-humi2.js.map
|
|
@@ -0,0 +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;CAAG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WoSensorTH } from './wo-sensor-th.js';
|
|
2
|
+
/**
|
|
3
|
+
* Outdoor Meter (Temperature/Humidity Sensor for outdoor use)
|
|
4
|
+
* Uses same logic as standard Meter
|
|
5
|
+
*/
|
|
6
|
+
export declare class WoIOSensorTH extends WoSensorTH {
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=wo-io-sensor-th.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-io-sensor-th.d.ts","sourceRoot":"","sources":["../../src/devices/wo-io-sensor-th.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C;;;GAGG;AACH,qBAAa,YAAa,SAAQ,UAAU;CAAG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* Copyright(C) 2024-2026, donavanbecker (https://github.com/donavanbecker). All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* devices/wo-io-sensor-th.ts: SwitchBot v4.0.0 - Outdoor Meter
|
|
4
|
+
*/
|
|
5
|
+
import { WoSensorTH } from './wo-sensor-th.js';
|
|
6
|
+
/**
|
|
7
|
+
* Outdoor Meter (Temperature/Humidity Sensor for outdoor use)
|
|
8
|
+
* Uses same logic as standard Meter
|
|
9
|
+
*/
|
|
10
|
+
export class WoIOSensorTH extends WoSensorTH {
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=wo-io-sensor-th.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-io-sensor-th.js","sourceRoot":"","sources":["../../src/devices/wo-io-sensor-th.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,UAAU;CAAG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { KeypadStatus } from '../types/device.js';
|
|
2
|
+
import { SwitchBotDevice } from './base.js';
|
|
3
|
+
/**
|
|
4
|
+
* Keypad Device (Touch/Physical)
|
|
5
|
+
* Note: Keypad is primarily for lock control, read-only for status
|
|
6
|
+
*/
|
|
7
|
+
export declare class WoKeypad extends SwitchBotDevice {
|
|
8
|
+
/**
|
|
9
|
+
* Get device status
|
|
10
|
+
*/
|
|
11
|
+
getStatus(): Promise<KeypadStatus>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=wo-keypad.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-keypad.d.ts","sourceRoot":"","sources":["../../src/devices/wo-keypad.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3C;;;GAGG;AACH,qBAAa,QAAS,SAAQ,eAAe;IAC3C;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,YAAY,CAAC;CAgCzC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/* Copyright(C) 2024-2026, donavanbecker (https://github.com/donavanbecker). All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* devices/wo-keypad.ts: SwitchBot v4.0.0 - Keypad Device
|
|
4
|
+
*/
|
|
5
|
+
import { SwitchBotDevice } from './base.js';
|
|
6
|
+
/**
|
|
7
|
+
* Keypad Device (Touch/Physical)
|
|
8
|
+
* Note: Keypad is primarily for lock control, read-only for status
|
|
9
|
+
*/
|
|
10
|
+
export class WoKeypad extends SwitchBotDevice {
|
|
11
|
+
/**
|
|
12
|
+
* Get device status
|
|
13
|
+
*/
|
|
14
|
+
async getStatus() {
|
|
15
|
+
try {
|
|
16
|
+
// Try API first if available
|
|
17
|
+
if (this.hasAPI()) {
|
|
18
|
+
const apiStatus = await this.getAPIStatus();
|
|
19
|
+
return {
|
|
20
|
+
deviceId: this.info.id,
|
|
21
|
+
connectionType: 'api',
|
|
22
|
+
lockState: apiStatus.lockState,
|
|
23
|
+
battery: apiStatus.battery,
|
|
24
|
+
version: apiStatus.version,
|
|
25
|
+
updatedAt: new Date(),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
// Fallback to BLE
|
|
29
|
+
if (this.hasBLE()) {
|
|
30
|
+
const bleData = await this.getBLEStatus();
|
|
31
|
+
return {
|
|
32
|
+
deviceId: this.info.id,
|
|
33
|
+
connectionType: 'ble',
|
|
34
|
+
battery: bleData.battery,
|
|
35
|
+
updatedAt: new Date(),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
throw new Error('No connection method available');
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
this.logger.error('Failed to get status', error);
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=wo-keypad.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-keypad.js","sourceRoot":"","sources":["../../src/devices/wo-keypad.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3C;;;GAGG;AACH,MAAM,OAAO,QAAS,SAAQ,eAAe;IAC3C;;OAEG;IACH,KAAK,CAAC,SAAS;QACb,IAAI,CAAC;YACH,6BAA6B;YAC7B,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;gBAClB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;gBAC3C,OAAO;oBACL,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE;oBACtB,cAAc,EAAE,KAAK;oBACrB,SAAS,EAAE,SAAS,CAAC,SAAS;oBAC9B,OAAO,EAAE,SAAS,CAAC,OAAO;oBAC1B,OAAO,EAAE,SAAS,CAAC,OAAO;oBAC1B,SAAS,EAAE,IAAI,IAAI,EAAE;iBACtB,CAAA;YACH,CAAC;YAED,kBAAkB;YAClB,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;gBAClB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;gBACzC,OAAO;oBACL,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE;oBACtB,cAAc,EAAE,KAAK;oBACrB,OAAO,EAAE,OAAO,CAAC,OAAO;oBACxB,SAAS,EAAE,IAAI,IAAI,EAAE;iBACtB,CAAA;YACH,CAAC;YAED,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;QACnD,CAAC;QAAC,OAAO,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,12 @@
|
|
|
1
|
+
import type { LeakStatus } from '../types/device.js';
|
|
2
|
+
import { SwitchBotDevice } from './base.js';
|
|
3
|
+
/**
|
|
4
|
+
* Water Leak Detector Device
|
|
5
|
+
*/
|
|
6
|
+
export declare class WoLeak extends SwitchBotDevice {
|
|
7
|
+
/**
|
|
8
|
+
* Get device status
|
|
9
|
+
*/
|
|
10
|
+
getStatus(): Promise<LeakStatus>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=wo-leak.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-leak.d.ts","sourceRoot":"","sources":["../../src/devices/wo-leak.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3C;;GAEG;AACH,qBAAa,MAAO,SAAQ,eAAe;IACzC;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,UAAU,CAAC;CAiCvC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/* Copyright(C) 2024-2026, donavanbecker (https://github.com/donavanbecker). All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* devices/wo-leak.ts: SwitchBot v4.0.0 - Water Leak Detector Device
|
|
4
|
+
*/
|
|
5
|
+
import { SwitchBotDevice } from './base.js';
|
|
6
|
+
/**
|
|
7
|
+
* Water Leak Detector Device
|
|
8
|
+
*/
|
|
9
|
+
export class WoLeak extends SwitchBotDevice {
|
|
10
|
+
/**
|
|
11
|
+
* Get device status
|
|
12
|
+
*/
|
|
13
|
+
async getStatus() {
|
|
14
|
+
try {
|
|
15
|
+
// Try API first if available
|
|
16
|
+
if (this.hasAPI()) {
|
|
17
|
+
const apiStatus = await this.getAPIStatus();
|
|
18
|
+
return {
|
|
19
|
+
deviceId: this.info.id,
|
|
20
|
+
connectionType: 'api',
|
|
21
|
+
waterLeakDetected: apiStatus.waterLeakDetected || false,
|
|
22
|
+
battery: apiStatus.battery,
|
|
23
|
+
version: apiStatus.version,
|
|
24
|
+
updatedAt: new Date(),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
// Fallback to BLE
|
|
28
|
+
if (this.hasBLE()) {
|
|
29
|
+
const bleData = await this.getBLEStatus();
|
|
30
|
+
return {
|
|
31
|
+
deviceId: this.info.id,
|
|
32
|
+
connectionType: 'ble',
|
|
33
|
+
waterLeakDetected: bleData.waterLeakDetected || false,
|
|
34
|
+
battery: bleData.battery,
|
|
35
|
+
updatedAt: new Date(),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
throw new Error('No connection method available');
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
this.logger.error('Failed to get status', error);
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=wo-leak.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-leak.js","sourceRoot":"","sources":["../../src/devices/wo-leak.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3C;;GAEG;AACH,MAAM,OAAO,MAAO,SAAQ,eAAe;IACzC;;OAEG;IACH,KAAK,CAAC,SAAS;QACb,IAAI,CAAC;YACH,6BAA6B;YAC7B,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;gBAClB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;gBAC3C,OAAO;oBACL,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE;oBACtB,cAAc,EAAE,KAAK;oBACrB,iBAAiB,EAAE,SAAS,CAAC,iBAAiB,IAAI,KAAK;oBACvD,OAAO,EAAE,SAAS,CAAC,OAAO;oBAC1B,OAAO,EAAE,SAAS,CAAC,OAAO;oBAC1B,SAAS,EAAE,IAAI,IAAI,EAAE;iBACtB,CAAA;YACH,CAAC;YAED,kBAAkB;YAClB,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;gBAClB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;gBACzC,OAAO;oBACL,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE;oBACtB,cAAc,EAAE,KAAK;oBACrB,iBAAiB,EAAE,OAAO,CAAC,iBAAiB,IAAI,KAAK;oBACrD,OAAO,EAAE,OAAO,CAAC,OAAO;oBACxB,SAAS,EAAE,IAAI,IAAI,EAAE;iBACtB,CAAA;YACH,CAAC;YAED,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;QACnD,CAAC;QAAC,OAAO,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,24 @@
|
|
|
1
|
+
import type { LockCommands, LockStatus } from '../types/device.js';
|
|
2
|
+
import { SwitchBotDevice } from './base.js';
|
|
3
|
+
/**
|
|
4
|
+
* Smart Lock Pro Device (with unlatch support)
|
|
5
|
+
*/
|
|
6
|
+
export declare class WoSmartLockPro extends SwitchBotDevice implements LockCommands {
|
|
7
|
+
/**
|
|
8
|
+
* Lock the lock
|
|
9
|
+
*/
|
|
10
|
+
lock(): Promise<boolean>;
|
|
11
|
+
/**
|
|
12
|
+
* Unlock the lock
|
|
13
|
+
*/
|
|
14
|
+
unlock(): Promise<boolean>;
|
|
15
|
+
/**
|
|
16
|
+
* Unlatch the lock (Lock Pro only)
|
|
17
|
+
*/
|
|
18
|
+
unlatch(): Promise<boolean>;
|
|
19
|
+
/**
|
|
20
|
+
* Get device status
|
|
21
|
+
*/
|
|
22
|
+
getStatus(): Promise<LockStatus>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=wo-lock-pro.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-lock-pro.d.ts","sourceRoot":"","sources":["../../src/devices/wo-lock-pro.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAGlE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3C;;GAEG;AACH,qBAAa,cAAe,SAAQ,eAAgB,YAAW,YAAY;IACzE;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;IAQ9B;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAQhC;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;IAQjC;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,UAAU,CAAC;CAqCvC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/* Copyright(C) 2024-2026, donavanbecker (https://github.com/donavanbecker). All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* devices/wo-lock-pro.ts: SwitchBot v4.0.0 - Smart Lock Pro Device
|
|
4
|
+
*/
|
|
5
|
+
import { WoSmartLockProCommands } from '../settings.js';
|
|
6
|
+
import { SwitchBotDevice } from './base.js';
|
|
7
|
+
/**
|
|
8
|
+
* Smart Lock Pro Device (with unlatch support)
|
|
9
|
+
*/
|
|
10
|
+
export class WoSmartLockPro extends SwitchBotDevice {
|
|
11
|
+
/**
|
|
12
|
+
* Lock the lock
|
|
13
|
+
*/
|
|
14
|
+
async lock() {
|
|
15
|
+
const result = await this.sendCommand(WoSmartLockProCommands.LOCK, 'lock');
|
|
16
|
+
return result.success;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Unlock the lock
|
|
20
|
+
*/
|
|
21
|
+
async unlock() {
|
|
22
|
+
const result = await this.sendCommand(WoSmartLockProCommands.UNLOCK, 'unlock');
|
|
23
|
+
return result.success;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Unlatch the lock (Lock Pro only)
|
|
27
|
+
*/
|
|
28
|
+
async unlatch() {
|
|
29
|
+
const result = await this.sendCommand(WoSmartLockProCommands.UNLATCH, 'unlock');
|
|
30
|
+
return result.success;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get device status
|
|
34
|
+
*/
|
|
35
|
+
async getStatus() {
|
|
36
|
+
try {
|
|
37
|
+
// Try API first if available
|
|
38
|
+
if (this.hasAPI()) {
|
|
39
|
+
const apiStatus = await this.getAPIStatus();
|
|
40
|
+
return {
|
|
41
|
+
deviceId: this.info.id,
|
|
42
|
+
connectionType: 'api',
|
|
43
|
+
lockState: apiStatus.lockState || 'locked',
|
|
44
|
+
doorState: apiStatus.doorState,
|
|
45
|
+
calibrated: apiStatus.calibrate,
|
|
46
|
+
battery: apiStatus.battery,
|
|
47
|
+
version: apiStatus.version,
|
|
48
|
+
updatedAt: new Date(),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
// Fallback to BLE
|
|
52
|
+
if (this.hasBLE()) {
|
|
53
|
+
const bleData = await this.getBLEStatus();
|
|
54
|
+
return {
|
|
55
|
+
deviceId: this.info.id,
|
|
56
|
+
connectionType: 'ble',
|
|
57
|
+
lockState: bleData.lockState || 'locked',
|
|
58
|
+
doorState: bleData.doorOpen ? 'opened' : 'closed',
|
|
59
|
+
calibrated: bleData.calibration,
|
|
60
|
+
battery: bleData.battery,
|
|
61
|
+
updatedAt: new Date(),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
throw new Error('No connection method available');
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
this.logger.error('Failed to get status', error);
|
|
68
|
+
throw error;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=wo-lock-pro.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-lock-pro.js","sourceRoot":"","sources":["../../src/devices/wo-lock-pro.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3C;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,eAAe;IACjD;;OAEG;IACH,KAAK,CAAC,IAAI;QACR,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CACnC,sBAAsB,CAAC,IAAI,EAC3B,MAAM,CACP,CAAA;QACD,OAAO,MAAM,CAAC,OAAO,CAAA;IACvB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM;QACV,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CACnC,sBAAsB,CAAC,MAAM,EAC7B,QAAQ,CACT,CAAA;QACD,OAAO,MAAM,CAAC,OAAO,CAAA;IACvB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO;QACX,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CACnC,sBAAsB,CAAC,OAAO,EAC9B,QAAQ,CACT,CAAA;QACD,OAAO,MAAM,CAAC,OAAO,CAAA;IACvB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS;QACb,IAAI,CAAC;YACH,6BAA6B;YAC7B,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;gBAClB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;gBAC3C,OAAO;oBACL,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE;oBACtB,cAAc,EAAE,KAAK;oBACrB,SAAS,EAAE,SAAS,CAAC,SAAS,IAAI,QAAQ;oBAC1C,SAAS,EAAE,SAAS,CAAC,SAAS;oBAC9B,UAAU,EAAE,SAAS,CAAC,SAAS;oBAC/B,OAAO,EAAE,SAAS,CAAC,OAAO;oBAC1B,OAAO,EAAE,SAAS,CAAC,OAAO;oBAC1B,SAAS,EAAE,IAAI,IAAI,EAAE;iBACtB,CAAA;YACH,CAAC;YAED,kBAAkB;YAClB,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;gBAClB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;gBACzC,OAAO;oBACL,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE;oBACtB,cAAc,EAAE,KAAK;oBACrB,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,QAAQ;oBACxC,SAAS,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ;oBACjD,UAAU,EAAE,OAAO,CAAC,WAAW;oBAC/B,OAAO,EAAE,OAAO,CAAC,OAAO;oBACxB,SAAS,EAAE,IAAI,IAAI,EAAE;iBACtB,CAAA;YACH,CAAC;YAED,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;QACnD,CAAC;QAAC,OAAO,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,20 @@
|
|
|
1
|
+
import type { LockCommands, LockStatus } from '../types/device.js';
|
|
2
|
+
import { SwitchBotDevice } from './base.js';
|
|
3
|
+
/**
|
|
4
|
+
* Smart Lock Device
|
|
5
|
+
*/
|
|
6
|
+
export declare class WoSmartLock extends SwitchBotDevice implements LockCommands {
|
|
7
|
+
/**
|
|
8
|
+
* Lock the lock
|
|
9
|
+
*/
|
|
10
|
+
lock(): Promise<boolean>;
|
|
11
|
+
/**
|
|
12
|
+
* Unlock the lock
|
|
13
|
+
*/
|
|
14
|
+
unlock(): Promise<boolean>;
|
|
15
|
+
/**
|
|
16
|
+
* Get device status
|
|
17
|
+
*/
|
|
18
|
+
getStatus(): Promise<LockStatus>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=wo-lock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-lock.d.ts","sourceRoot":"","sources":["../../src/devices/wo-lock.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAGlE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3C;;GAEG;AACH,qBAAa,WAAY,SAAQ,eAAgB,YAAW,YAAY;IACtE;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;IAQ9B;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAQhC;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,UAAU,CAAC;CAoCvC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/* Copyright(C) 2024-2026, donavanbecker (https://github.com/donavanbecker). All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* devices/wo-lock.ts: SwitchBot v4.0.0 - Smart Lock Device
|
|
4
|
+
*/
|
|
5
|
+
import { WoSmartLockCommands } from '../settings.js';
|
|
6
|
+
import { SwitchBotDevice } from './base.js';
|
|
7
|
+
/**
|
|
8
|
+
* Smart Lock Device
|
|
9
|
+
*/
|
|
10
|
+
export class WoSmartLock extends SwitchBotDevice {
|
|
11
|
+
/**
|
|
12
|
+
* Lock the lock
|
|
13
|
+
*/
|
|
14
|
+
async lock() {
|
|
15
|
+
const result = await this.sendCommand(WoSmartLockCommands.LOCK, 'lock');
|
|
16
|
+
return result.success;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Unlock the lock
|
|
20
|
+
*/
|
|
21
|
+
async unlock() {
|
|
22
|
+
const result = await this.sendCommand(WoSmartLockCommands.UNLOCK, 'unlock');
|
|
23
|
+
return result.success;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get device status
|
|
27
|
+
*/
|
|
28
|
+
async getStatus() {
|
|
29
|
+
try {
|
|
30
|
+
// Try API first if available
|
|
31
|
+
if (this.hasAPI()) {
|
|
32
|
+
const apiStatus = await this.getAPIStatus();
|
|
33
|
+
return {
|
|
34
|
+
deviceId: this.info.id,
|
|
35
|
+
connectionType: 'api',
|
|
36
|
+
lockState: apiStatus.lockState || 'locked',
|
|
37
|
+
doorState: apiStatus.doorState,
|
|
38
|
+
calibrated: apiStatus.calibrate,
|
|
39
|
+
battery: apiStatus.battery,
|
|
40
|
+
version: apiStatus.version,
|
|
41
|
+
updatedAt: new Date(),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
// Fallback to BLE
|
|
45
|
+
if (this.hasBLE()) {
|
|
46
|
+
const bleData = await this.getBLEStatus();
|
|
47
|
+
return {
|
|
48
|
+
deviceId: this.info.id,
|
|
49
|
+
connectionType: 'ble',
|
|
50
|
+
lockState: bleData.lockState || 'locked',
|
|
51
|
+
calibrated: bleData.calibration,
|
|
52
|
+
battery: bleData.battery,
|
|
53
|
+
updatedAt: new Date(),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
throw new Error('No connection method available');
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
this.logger.error('Failed to get status', error);
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=wo-lock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-lock.js","sourceRoot":"","sources":["../../src/devices/wo-lock.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3C;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,eAAe;IAC9C;;OAEG;IACH,KAAK,CAAC,IAAI;QACR,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CACnC,mBAAmB,CAAC,IAAI,EACxB,MAAM,CACP,CAAA;QACD,OAAO,MAAM,CAAC,OAAO,CAAA;IACvB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM;QACV,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CACnC,mBAAmB,CAAC,MAAM,EAC1B,QAAQ,CACT,CAAA;QACD,OAAO,MAAM,CAAC,OAAO,CAAA;IACvB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS;QACb,IAAI,CAAC;YACH,6BAA6B;YAC7B,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;gBAClB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;gBAC3C,OAAO;oBACL,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE;oBACtB,cAAc,EAAE,KAAK;oBACrB,SAAS,EAAE,SAAS,CAAC,SAAS,IAAI,QAAQ;oBAC1C,SAAS,EAAE,SAAS,CAAC,SAAS;oBAC9B,UAAU,EAAE,SAAS,CAAC,SAAS;oBAC/B,OAAO,EAAE,SAAS,CAAC,OAAO;oBAC1B,OAAO,EAAE,SAAS,CAAC,OAAO;oBAC1B,SAAS,EAAE,IAAI,IAAI,EAAE;iBACtB,CAAA;YACH,CAAC;YAED,kBAAkB;YAClB,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;gBAClB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;gBACzC,OAAO;oBACL,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE;oBACtB,cAAc,EAAE,KAAK;oBACrB,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,QAAQ;oBACxC,UAAU,EAAE,OAAO,CAAC,WAAW;oBAC/B,OAAO,EAAE,OAAO,CAAC,OAAO;oBACxB,SAAS,EAAE,IAAI,IAAI,EAAE;iBACtB,CAAA;YACH,CAAC;YAED,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;QACnD,CAAC;QAAC,OAAO,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-plug-mini-jp.d.ts","sourceRoot":"","sources":["../../src/devices/wo-plug-mini-jp.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD;;;GAGG;AACH,qBAAa,YAAa,SAAQ,YAAY;CAAG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* Copyright(C) 2024-2026, donavanbecker (https://github.com/donavanbecker). All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* devices/wo-plug-mini-jp.ts: SwitchBot v4.0.0 - Plug Mini (JP)
|
|
4
|
+
*/
|
|
5
|
+
import { WoPlugMiniUS } from './wo-plug-mini-us.js';
|
|
6
|
+
/**
|
|
7
|
+
* Plug Mini (JP) Device
|
|
8
|
+
* Uses same logic as US version
|
|
9
|
+
*/
|
|
10
|
+
export class WoPlugMiniJP extends WoPlugMiniUS {
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=wo-plug-mini-jp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-plug-mini-jp.js","sourceRoot":"","sources":["../../src/devices/wo-plug-mini-jp.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,YAAY;CAAG"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { PlugCommands, PlugStatus } from '../types/device.js';
|
|
2
|
+
import { SwitchBotDevice } from './base.js';
|
|
3
|
+
/**
|
|
4
|
+
* Plug Mini (US) Device
|
|
5
|
+
*/
|
|
6
|
+
export declare class WoPlugMiniUS extends SwitchBotDevice implements PlugCommands {
|
|
7
|
+
/**
|
|
8
|
+
* Turn on
|
|
9
|
+
*/
|
|
10
|
+
turnOn(): Promise<boolean>;
|
|
11
|
+
/**
|
|
12
|
+
* Turn off
|
|
13
|
+
*/
|
|
14
|
+
turnOff(): Promise<boolean>;
|
|
15
|
+
/**
|
|
16
|
+
* Toggle power
|
|
17
|
+
*/
|
|
18
|
+
toggle(): Promise<boolean>;
|
|
19
|
+
/**
|
|
20
|
+
* Get device status
|
|
21
|
+
*/
|
|
22
|
+
getStatus(): Promise<PlugStatus>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=wo-plug-mini-us.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wo-plug-mini-us.d.ts","sourceRoot":"","sources":["../../src/devices/wo-plug-mini-us.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAGlE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3C;;GAEG;AACH,qBAAa,YAAa,SAAQ,eAAgB,YAAW,YAAY;IACvE;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAQhC;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;IAQjC;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAQhC;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,UAAU,CAAC;CAmCvC"}
|