Conversation
838716c to
1be66e8
Compare
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds new features to SwitchBot air purifiers: fan speed control (set percentage), child lock open/close, light-sensitive mode, LED on/off, LED RGB and brightness control, PM2.5 value (US models only), and wireless charging toggle (table models). It also renames the air purifier models to region-specific variants (AIR_PURIFIER_US, AIR_PURIFIER_JP, AIR_PURIFIER_TABLE_US, AIR_PURIFIER_TABLE_JP) for clarity.
Changes:
SwitchbotAirPurifiernow extendsSwitchbotSequenceBaseLightinstead ofSwitchbotSequenceDevice, enabling LED control features- Air purifier enum models renamed from
AIR_PURIFIER/AIR_PURIFIER_TABLEto region-specific variants (*_US,*_JP) - New commands added: set percentage, child lock, wireless charging, LED on/off, LED RGB/brightness, light-sensitive mode
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
switchbot/devices/air_purifier.py |
Core feature additions: new LED commands, percentage, wireless charging, child lock, and updated get_basic_info using 3 commands |
switchbot/const/__init__.py |
Renames air purifier models to region-specific variants; exports AirQualityLevel |
switchbot/devices/device.py |
Adds open/close_child_lock and open/close_wireless_charging base methods; updates API model map |
switchbot/devices/base_light.py |
Refactors _get_basic_info_by_multi_commands to call _send_command directly instead of _get_basic_info |
switchbot/adv_parser.py |
Updates model mappings to region-specific variants |
switchbot/__init__.py |
Exports AirQualityLevel |
tests/test_air_purifier.py |
Updates existing tests and adds new tests for added features |
tests/test_lock.py |
Updates invalid model test to use AIR_PURIFIER_JP |
tests/test_adv_parser.py |
Updates expected model names and enum values |
tests/test_bulb.py |
Updates get_basic_info mock to use _send_command/_check_command_result |
tests/test_ceiling_light.py |
Same mock update as test_bulb.py |
tests/test_strip_light.py |
Same mock update as test_bulb.py |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
159f12d to
2f38e30
Compare
|
LED on/off status detection has been removed; the current communication protocol does not support it. |
|
I still have these on my list to followup. I just haven't had any free cycles |
Breaking changes
remove the models
add models
Support new features