Skip to content

feat: port pySwitchbot 3.8.3-3.15.1 - #366

Merged
donavanbecker merged 2 commits into
latestfrom
feat/pyswitchbot-3.15.1
Nov 20, 2026
Merged

donavanbecker merged 2 commits into
latestfrom
feat/pyswitchbot-3.15.1

Conversation

@donavanbecker

@donavanbecker donavanbecker commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Ports pySwitchbot 3.9.0, 3.10.0, 3.11.0, 3.12.0, 3.13.0, 3.14.0, 3.15.0 and 3.15.1. 3.8.3, 3.8.4 and 3.10.1 were checked and don't apply (see below).

  • Art Frame 2 and E Ink Photo Magnet (feat: add support for Art Frame 2 sblibs/pySwitchbot#607, #608): new WoArtFrame2 and WoEInkPhotoMagnet classes. Encrypted, so they need setKey. Recognised over BLE by product ID (0011f1c0/0111f1c0, 001295d0/011295d0); cloud codes W1176000 / W1218000 and the OpenAPI deviceType AI Art Frame 2 resolve to the same classes. Status (battery, charging, 16-bit image index, display flags) comes from the advertisement. Methods: getFrameInfo, getImageIds, nextImage, prevImage, randomImage, setImage(index). nextImage/prevImage fall back to the OpenAPI next/previous commands (ai-art-frame-2.md); the other frame commands are BLE-only.
  • Lock Pro (#582): new getBatteryBays(). Lock Pro advertisements now report batteryCharging, powerAlarm, doorMagnetAlarm, leftBatteryCompartmentAlarm and rightBatteryCompartmentAlarm; Lock Pro WiFi reports only the two compartment alarms (and low temperature).
  • Meter Pro / Meter Pro CO2 (#581, #559, #621, #430, #622): BLE settings for weather, display zones and icons, update interval, date format, battery icon, temperature unit, buttons, calibration, comfort level, temperature/humidity alarm and alarm mode/volume. The CO2 model adds triggerCo2Sampling, startCo2Calibration, isUsbPowered, battery/USB update intervals, getCo2Alarm/setCo2Alarm and getCo2LevelThresholds/setCo2LevelThresholds. Inputs are validated before sending, as in 3.15.1. WoSensorTHProCO2 now extends WoSensorTHPro. The MeterPro* enums and SwitchbotOperationError are exported.
  • Guide: "Adding a device class" now says product-ID devices go in PRODUCT_ID_MODEL_MAP.

Tests use pySwitchbot's own fixtures (test/devices/pyswitchbot-3.9-3.11.test.ts, test/devices/meter-pro-settings.test.ts), plus test/devices/openapi-commands.test.ts for AI Art Frame 2.

Not applicable / not ported

  • 3.8.3 connected lock status (#596): node-switchbot reads lock state only from advertisements, which already ignore unknown statuses (fa754c8).
  • 3.8.4 (#586): asyncio plumbing only.
  • 3.10.1 (#591): node-switchbot's light classes don't parse multi-command status replies.
  • Meter Pro time offset / datetime commands predate 3.8 and are still not ported.
  • The original WoArtFrame still extends WoBulb; aligning it with pySwitchbot's Art Frame would change behaviour, so it is left alone (feat: support new OpenAPI device types from SwitchBotAPI (November 2026) #368 adds its OpenAPI next/previous).
  • OpenAPI deleteImage / uploadImage for the frames are not implemented.

Breaking changes

None.

For homebridge-switchbot

New device types Art Frame 2 / AI Art Frame 2 and E Ink Photo Magnet. They expose battery, batteryCharging and imageIndex, plus next/previous image commands. The Meter Pro and lock methods are optional extras. A follow-up PR there will come after this is published.

Related docs: OpenWonderLabs/SwitchBotAPI-BLE#57.

Checks

npm run build, npm test (611 tests), npm run lint and npm run lint-docs pass locally.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LzktUspaxcZ9Dh5WVEtf5W

New in pySwitchbot 3.9.0-3.15.1:
- Art Frame 2 (3.10.0) and E Ink Photo Magnet (3.9.0): new WoArtFrame2 and
  WoEInkPhotoMagnet classes (encrypted sequence devices). Product IDs
  0011f1c0/0111f1c0 and 001295d0/011295d0, cloud model codes W1176000 and
  W1218000, the image frame advertisement (battery, charging, 16-bit image
  index, display flags), and the BLE commands: getFrameInfo (5702),
  nextImage/prevImage (570f7a07 01/00), setImage/randomImage (570f7a02 +
  16-bit id), getImageIds (paged bitmap, 570f7b07 + packet).
- Lock Pro battery bays and advertisement alarms (3.11.0):
  WoSmartLockPro.getBatteryBays() (570f4f0409, Lock Pro only); the Lock Pro
  advertisement now reports batteryCharging, powerAlarm, doorMagnetAlarm
  and both battery compartment alarms; the Lock Pro WiFi gets its own
  layout ('proWifi') with only the compartment and low temperature alarms.
- Meter Pro / Meter Pro CO2 (3.12.0-3.15.1): weather display
  (get/setWeather, read-write-verify, write never retried), display zones
  and icons, data update interval, date format, battery icon, temperature
  unit, button functions, calibration, comfort level, temperature/humidity
  alarm and alarm mode/volume on WoSensorTHPro; CO2 sampling, calibration,
  USB power state, update intervals, CO2 alarm and level thresholds on
  WoSensorTHProCO2, which now extends WoSensorTHPro. Inputs are validated
  before sending, as in 3.15.1. Enums MeterPro* are exported.
- SwitchbotOperationError is now exported from the package.

Not applicable:
- 3.8.3 connected lock status (81352fa): node-switchbot reads lock state
  only from advertisements (already ignoring unknown statuses since
  fa754c8); it has no connected lock-status parser.
- 3.8.4 background task logging (d46452e): asyncio plumbing.
- 3.10.1 truncated light status replies (c777da0): node-switchbot's light
  classes do not parse multi-command status replies.

Not ported: the Meter Pro time offset and datetime commands, which
predate 3.8 and were never ported.

The guide now says product-ID devices are mapped in PRODUCT_ID_MODEL_MAP
when adding a device class.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LzktUspaxcZ9Dh5WVEtf5W
SwitchBotAPI documents the Art Frame 2 as deviceType "AI Art Frame 2" with
next and previous commands (OpenWonderLabs/SwitchBotAPI#526). Resolve it to
WoArtFrame2, and let nextImage/prevImage fall back to those OpenAPI
commands when BLE is unavailable or fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LzktUspaxcZ9Dh5WVEtf5W
@donavanbecker
donavanbecker merged commit 1eddfa6 into latest Nov 20, 2026
3 checks passed
@donavanbecker
donavanbecker deleted the feat/pyswitchbot-3.15.1 branch November 20, 2026 18:51
donavanbecker added a commit that referenced this pull request Nov 20, 2026
…26) (#368)

## What changed

SwitchBotAPI added device pages in OpenWonderLabs/SwitchBotAPI#520 and
#526. This covers the ones that map onto existing classes:

| OpenAPI deviceType | Resolves to | Why |
| --- | --- | --- |
| `Curtain4` (and `Curtain 4`) | `WoCurtain` |
[curtain-4.md](https://github.com/OpenWonderLabs/SwitchBotAPI/blob/latest/devices/curtains-blinds/curtain-4.md):
same `setPosition` `index,mode,position`, `turnOn`/`turnOff`, `pause` |
| `Robot Vacuum Cleaner S30` | `WoVacuumS20` |
[floor-cleaning-robot-s30.md](https://github.com/OpenWonderLabs/SwitchBotAPI/blob/latest/devices/robot-vacuum/floor-cleaning-robot-s30.md):
same `startClean` with `waterLevel`, `dock` |
| `Robot Vacuum Cleaner K11 Plus Pro` | `WoVacuumK11Plus` |
[robot-vacuum-k11-pro.md](https://github.com/OpenWonderLabs/SwitchBotAPI/blob/latest/devices/robot-vacuum/robot-vacuum-k11-pro.md):
same `startClean` shape, `dock` |

`WoArtFrame` (`AI Art Frame`) gains `nextImage()` / `prevImage()`,
sending the new OpenAPI `next` / `previous` commands
([ai-art-frame.md](https://github.com/OpenWonderLabs/SwitchBotAPI/blob/latest/devices/others/ai-art-frame.md)).
`AI Art Frame 2` is handled in #366, which adds `WoArtFrame2`.

Each is pinned in `test/devices/openapi-commands.test.ts`.

Not mapped: `Vision Doorbell`, `Outdoor Pan/Tilt Cam 3K` and `Solar
Pan/Tilt Cam 2K` (cameras: status only, or motion-detection toggles that
no node-switchbot class models yet).

## Breaking changes

None.

## For homebridge-switchbot

Add `Curtain4`, `Robot Vacuum Cleaner S30` and `Robot Vacuum Cleaner K11
Plus Pro` to `DEVICE_TYPES` / normalization once this is published.

## Checks

`npm run build`, `npm test` and `npm run lint` pass locally.

---
_Generated by [Claude Code](https://claude.ai/code)_

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants