-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat(cli): midealocal CLI tool #204
Conversation
WalkthroughThe changes introduce a CLI tool to interact with Midea local devices, enabling device discovery, message decoding, and protocol implementation download. Additionally, there's a new Python debugger configuration, constants for authentication, and a new utility package included. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant Device
participant Cloud
User ->> CLI: Execute Command
CLI ->> CLI: Parse Arguments
alt Discover Devices
CLI ->> Device: Send Discovery Signal
Device -->> CLI: Return Device Info
else Load Message
CLI ->> Device: Send Message
Device -->> CLI: Confirm Receipt
else Download Protocol
CLI ->> Cloud: Request Protocol
Cloud -->> CLI: Return Protocol Data
end
CLI -->> User: Display Result
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #204 +/- ##
==========================================
- Coverage 27.09% 26.71% -0.38%
==========================================
Files 79 80 +1
Lines 6891 6989 +98
==========================================
Hits 1867 1867
- Misses 5024 5122 +98 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- .vscode/launch.json (1 hunks)
- midealocal/cli.py (1 hunks)
- midealocal/const.py (1 hunks)
- setup.py (1 hunks)
Files skipped from review due to trivial changes (3)
- .vscode/launch.json
- midealocal/const.py
- setup.py
Additional comments not posted (4)
midealocal/cli.py (4)
24-34
: LGTM!The
_get_keys
function is well-implemented and correctly usesaiohttp
for asynchronous HTTP requests.
74-94
: LGTM!The
_message
function is well-implemented and correctly processes messages for devices.
103-173
: LGTM!The
main
function is well-implemented and correctly sets up the argument parser and subparsers.
176-215
: LGTM!The
_run
function is well-implemented and correctly sets up logging and handles both coroutine and non-coroutine functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- midealocal/cli.py (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- midealocal/cli.py
Why not update/enrich library_test.py that has the same scope ? |
I want to deprecate library_test and provide a tool to understand better and debug the library. |
Actually that's not true. For sure is not feature complete and needs more love to test all functions, but so far is already useful. What we should do is improve the token/key management in the library. |
So, let's move the functionalities to CLI. After installing the midea-local lib, the user could call midealocal . The library_test does an overall test, unable to provide options for the user. |
thanks for add this tools, this should be a useful feature in lib side. and also add detail comments for future changes and quickly understand the process with different developer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- midealocal/cli.py (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- midealocal/cli.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- .gitignore (1 hunks)
- .vscode/launch.json (1 hunks)
- midealocal/cli.py (1 hunks)
- requirements.txt (1 hunks)
Files skipped from review due to trivial changes (2)
- .gitignore
- requirements.txt
Files skipped from review as they are similar to previous changes (2)
- .vscode/launch.json
- midealocal/cli.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- midealocal/cli.py (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- midealocal/cli.py
Maybe remove library_test in this PR as you want to deprecate it |
🤖 I have created a release *beep* *boop* --- ## [1.3.0](v1.2.0...v1.3.0) (2024-07-10) ### Features * **c3:** temperature step as customize ([#209](#209)) ([4da6e3e](4da6e3e)) * **cli:** midealocal CLI tool ([#204](#204)) ([236e33a](236e33a)) ### Bug Fixes * **device:** capabilities ([#212](#212)) ([f7cff37](f7cff37)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added functionality to customize the temperature step in `c3`. - **Chores** - Updated version number to `1.3.0`. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
New Features
Chores
midea-local.json
to.gitignore
.requirements.txt
with theplatformdirs
package.