Repository navigation
feat: resolve the Lock Ultra and Permanent Outdoor Lights OpenAPI device types - #359
Merged
Merged
Conversation
…ice types SwitchBotAPI documents two deviceType strings that did not resolve to a class: - "Lock Ultra": the deviceType the Lock Ultra status response reports (the device list says "Smart Lock Ultra", already mapped). Maps to WoSmartLockPro. - "Permanent Outdoor Lights": same commands as the RGBICWW Strip Light (turnOn/turnOff/toggle, setBrightness, setColor, setColorTemperature). Maps to WoRGBICWWStripLight. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LzktUt9rqfrSfRydbWruTR
donavanbecker
added a commit
to OpenWonderLabs/homebridge-switchbot
that referenced
this pull request
Nov 6, 2026
## What - `node-switchbot`: `^6.0.2` → `^6.0.4`. 6.0.4 is already on npm. - 6.0.3 ([node-switchbot#358](OpenWonderLabs/node-switchbot#358)) raises undici to 8.12.3 for its security fixes. - 6.0.4 ([node-switchbot#359](OpenWonderLabs/node-switchbot#359)) resolves the OpenAPI deviceTypes `Permanent Outdoor Lights` and `Lock Ultra`. - **Permanent Outdoor Lights** is a new device type: - added to `DEVICE_TYPES` (Lighting) and to `DEVICE_TYPE_NORMALIZATION_MAP`; - created as a `LightStripDevice`, like the RGBICWW Strip Light it shares commands with; - normalized to `lightstrip` for Matter. - `config.schema.json` regenerated by the build. - `Lock Ultra` needs no plugin change: the device list reports it as `Smart Lock Ultra`, which is already supported. ## Tests `test/device/model-identities.spec.ts` checks that the type normalizes and that `createDevice` returns a `LightStripDevice`. Build, test (220 passed, 1 skipped) and lint pass. The lockfile was regenerated with npm 11. Only the `node-switchbot` and `undici` entries change. ## Target branch No `beta-*` branch exists, and this session isn't allowed to create one, so this targets `latest` as the guide's fallback says. No config migration needed. --- _Generated by [Claude Code](https://claude.ai/code/session_01LzktUt9rqfrSfRydbWruTR)_ Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two
deviceTypestrings documented in SwitchBotAPI didn't resolve to a device class. They are now mapped inDEVICE_CLASS_MAP:Lock UltraWoSmartLockProdevices/locks-security/lock-ultra.md: the status response reportsLock Ultra, but the device list reportsSmart Lock Ultra, which is already mapped.Permanent Outdoor LightsWoRGBICWWStripLightdevices/lighting/permanent-outdoor-lights.md: the same commands as the RGBICWW Strip Light (turnOn/turnOff/toggle,setBrightness,setColor"r:g:b",setColorTemperature2700–6500).Tests
test/types/device-type-resolution.test.ts: both names resolve.test/devices/openapi-commands.test.ts: Permanent Outdoor Lights sends the documented light commands, and Lock Ultra sendslockandunlock.Build, test (466 passed) and lint pass.
Not covered
These OpenAPI types still have no class and need more than an alias:
RGBICWW Ceiling Light: separate main and colour lights (turnOnMainLight,setColorLightRGB...).WeatherStation: temperature, humidity and battery, plus display-text commands. It has no BLE model in pySwitchbot, and mapping it to a meter class would make it wait for BLE advertisements.No breaking changes. Afterwards, homebridge-switchbot can add
Permanent Outdoor Lightsto its device types once this is published.Generated by Claude Code