Add support for Rgbic Neon Rope Light#452
Add support for Rgbic Neon Rope Light#452XiaoLing-git wants to merge 9 commits intosblibs:masterfrom
Conversation
XiaoLing-git
commented
Feb 28, 2026
- Rgbic Neon Rope Light
- Rgbic Neon Wire Rope Light
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 3 files with indirect coverage changes 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds initial support for SwitchBot RGBIC Neon Rope Light / Neon Wire Rope Light by extending model constants, advertisement parsing, and introducing a dedicated neon light-strip device class, with accompanying test updates.
Changes:
- Add new
SwitchbotModelentries for RGBIC Neon Rope Light and RGBIC Neon Wire Rope Light. - Extend
adv_parser.SUPPORTED_TYPESto recognize the new model identifiers. - Add
SwitchbotRgbicNeonLightdevice class and update tests to include the new model.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
switchbot/const/__init__.py |
Adds enum constants for the two new neon models. |
switchbot/adv_parser.py |
Adds SUPPORTED_TYPES entries for new neon rope/wire model IDs. |
switchbot/devices/light_strip.py |
Introduces SwitchbotRgbicNeonLight (RGB-only) device class. |
switchbot/__init__.py |
Exports SwitchbotRgbicNeonLight from the package. |
tests/test_adv_parser.py |
Adds advertisement parsing test vectors for RGBIC Neon Rope Light. |
tests/__init__.py |
Adds RGBIC_NEON_LIGHT_INFO test fixture data. |
tests/test_strip_light.py |
Adds neon device to parametrized strip-light tests and adjusts assertions. |
.idea/workspace.xml |
Adds IDE workspace file (should not be committed). |
Files not reviewed (1)
- .idea/workspace.xml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @property | ||
| def color_modes(self) -> set[ColorMode]: | ||
| """Return the supported color modes.""" | ||
| return {ColorMode.RGB} | ||
|
|
There was a problem hiding this comment.
SwitchbotRgbicNeonLight.color_modes reports RGB-only support, but the class still inherits _set_color_temp_command from SwitchbotLightStrip, making set_color_temp appear supported. If neon devices truly don't support color temperature, override _set_color_temp_command to an empty string (or override set_color_temp to raise) so unsupported operations fail fast and match color_modes.
| AdvTestCase( | ||
| b"@L\xca!pz/\x8b'\x00\x11:\x00", | ||
| b"\x00\x00\x00\x00\x10\xd0\xb6", | ||
| { | ||
| "sequence_number": 47, | ||
| "isOn": True, | ||
| "brightness": 11, | ||
| "delay": False, | ||
| "network_state": 2, | ||
| "color_mode": 7, | ||
| }, | ||
| b"\x00\x10\xd0\xb6", | ||
| "RGBIC Neon Rope Light", | ||
| SwitchbotModel.RGBIC_NEON_ROPE_LIGHT, | ||
| ), |
There was a problem hiding this comment.
PR description mentions both "RGBIC Neon Rope Light" and "RGBIC Neon Wire Rope Light", but tests only cover SwitchbotModel.RGBIC_NEON_ROPE_LIGHT. Add analogous advertisement parsing test cases for the wire rope light model IDs (...\xd0\xb5) so both additions are validated.
| (FLOOR_LAMP_INFO, light_strip.SwitchbotStripLight3), | ||
| (RGBICWW_STRIP_LIGHT_INFO, light_strip.SwitchbotRgbicLight), | ||
| (RGBICWW_FLOOR_LAMP_INFO, light_strip.SwitchbotRgbicLight), | ||
| (RGBIC_NEON_LIGHT_INFO, light_strip.SwitchbotRgbicNeonLight), |
There was a problem hiding this comment.
This fixture adds SwitchbotRgbicNeonLight into the same parametrized device set as devices that support color temperature. Many of the tests below assume color-temp support (e.g., set/validate color_temp and set_color_temp), which is inconsistent with SwitchbotRgbicNeonLight.color_modes returning only ColorMode.RGB. Consider splitting the fixture (or parametrizing expected capabilities) so tests only exercise operations supported by each device model.
| (RGBIC_NEON_LIGHT_INFO, light_strip.SwitchbotRgbicNeonLight), |
| async def verify_encryption_key( | ||
| cls, | ||
| device: BLEDevice, | ||
| key_id: str, | ||
| encryption_key: str, | ||
| model: SwitchbotModel = SwitchbotModel.RGBICWW_STRIP_LIGHT, | ||
| **kwargs: Any, | ||
| ) -> bool: | ||
| return await super().verify_encryption_key( | ||
| device, key_id, encryption_key, model, **kwargs | ||
| ) |
There was a problem hiding this comment.
verify_encryption_key on SwitchbotRgbicNeonLight also defaults model to SwitchbotModel.RGBICWW_STRIP_LIGHT. This should align with the neon model(s), otherwise encryption verification may be performed against the wrong model identifier when callers use the default.
| assert device.is_on() is True | ||
| assert device.on is True | ||
| assert device.color_mode == ColorMode.RGB | ||
| assert device.color_modes == { | ||
| ColorMode.RGB, | ||
| ColorMode.COLOR_TEMP, | ||
| } | ||
| assert ColorMode.RGB in device.color_modes | ||
| assert device.rgb == (30, 0, 0) |
There was a problem hiding this comment.
The color_modes assertion was weakened from an exact set check to only verifying ColorMode.RGB is present. This reduces coverage for models that should also support ColorMode.COLOR_TEMP (e.g., Strip Light 3 / RGBICWW devices). Prefer asserting the full expected set per model so regressions in supported modes are caught, while still allowing neon to be RGB-only.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
bdraco
left a comment
There was a problem hiding this comment.
There are unrelated changes in this PR