Skip to content

Dev adjust file struct #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 2, 2025

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 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.

2 participants