Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR restructures the code by extracting command enums and constants into separate modules, updates imports, and enhances linting and versioning.
- Introduced
commands.pyandmodels.pyto organize enums and constants. - Cleaned up
__init__.pyby removing duplicated definitions and importing the new modules. - Bumped package version to 2.7.0 and added ruff linting in the Makefile.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| switchbot_api/models.py | Added enums for power states, fan modes, and vacuum modes. |
| switchbot_api/commands.py | Defined command enums and get_supported_devices methods. |
| switchbot_api/init.py | Removed duplicates, imported new modules, updated __all__. |
| pyproject.toml | Bumped version from 2.6.0 to 2.7.0. |
| makefile | Added ruff linting steps. |
Comments suppressed due to low confidence (1)
switchbot_api/commands.py:328
- This command class doesn’t override
get_supported_devices, unlike most other command enums. Consider adding a method that returns its supported device list for consistency.
class TVCommands(Commands):
SeraphicRav
requested changes
Jun 26, 2025
Contributor
SeraphicRav
left a comment
There was a problem hiding this comment.
As always, thanks for your contribution !
19 tasks
SeraphicRav
approved these changes
Jul 2, 2025
Contributor
|
Thanks for your contribution |
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.
hi : @SeraphicRav I'm so sorry about I modify code so often recently , I 'm work for switchbot cloud of HA, for some reason I have to change code here ; if you have any comments or suggestions , please let me know, best wish,
The main changes this time are as follows: