Skip to content

Dev adjust file struct#37

Merged
SeraphicRav merged 5 commits intoSeraphicCorp:mainfrom
XiaoLing-git:dev_adjust_file_struct
Jul 2, 2025
Merged

Dev adjust file struct#37
SeraphicRav merged 5 commits intoSeraphicCorp:mainfrom
XiaoLing-git:dev_adjust_file_struct

Conversation

@XiaoLing-git
Copy link
Contributor

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:

  1. Added commands.py,models.py
  2. move all command enum to commands.py
  3. move all constant to models.py
  4. added "get_supported_devices for all command enum"
  5. update "LockCommands" added DEADBOLT

@SeraphicRav SeraphicRav requested a review from Copilot June 26, 2025 10:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.py and models.py to organize enums and constants.
  • Cleaned up __init__.py by 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):

Copy link
Contributor

@SeraphicRav SeraphicRav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As always, thanks for your contribution !

@XiaoLing-git XiaoLing-git requested a review from SeraphicRav June 27, 2025 08:22
@SeraphicRav SeraphicRav merged commit bb045fb into SeraphicCorp:main Jul 2, 2025
7 checks passed
@SeraphicRav
Copy link
Contributor

Thanks for your contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants