feat: add Remote With Screen (Universal Remote) support#520
feat: add Remote With Screen (Universal Remote) support#520Onero-testdev wants to merge 1 commit into
Conversation
Add support for the SwitchBot Universal Remote (Remote With Screen, WoRemoteWithScreen). The device advertises its battery level and charging state in the manufacturer specific data, and the battery level / charging state can also be queried over BLE via the basic info command. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
PR Review — feat: add Remote With Screen (Universal Remote) supportClean, well-scoped new-device PR that follows the codebase's established patterns. No blocking issues. Specific strengths:
Minor, non-blocking:
🟢 Suggestions
1. No length guard before reading _data[12]
|
bluetoothbot
left a comment
There was a problem hiding this comment.
No blocking issues found.
Summary
Add support for the SwitchBot Universal Remote (internal name Remote With Screen /
WoRemoteWithScreen).This is a new model that exposes its battery level and charging state. Support is added so consumers (e.g. Home Assistant) can surface battery status.
Details
Advertisement parsing
process_woremote_with_screen(data, mfr_data)parser inadv_parsers/remote.py.mfr_data[9](manufacturer data starts at ADV byte 5):{"battery": None, "charging": None}whenmfr_datais missing or too short (guards againstIndexError).Device class
SwitchbotRemoteWithScreendevice (devices/remote_with_screen.py), exported from the package.get_basic_info()queries the device over BLE using the general basic-info command (5702) and parsesres[1]= battery,res[12]= charging.Registration
SwitchbotModel.REMOTE_WITH_SCREEN = "WoRemoteWithScreen".SUPPORTED_TYPESfor both the pairing-state device-type byte0x07and the normal-state byte0x27('), manufacturer id2409(UUID0x0969)."WoRemoteWithScreen"toAPI_MODEL_TO_ENUM.Tests
tests/test_remote_with_screen.py—get_basic_infobattery/charging parsing + empty-response handling.tests/test_adv_parser.py— active-scan parsing and charging-bit handling.tests/test_short_payload_guards.py— short/Nonemfr_dataguard.Full suite passes locally (
1222 passed).Note from SwitchBot team
This change is developed by the official SwitchBot team. The implementation has been verified with real hardware testing on physical devices.
If you have any questions or need clarification, please reach out: