Skip to content

Commit

Permalink
feat(cli)!: download protocol (#214)
Browse files Browse the repository at this point in the history
Breaking change was introduced by #219 
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Enhanced Midea Local CLI with a new `MideaCLI` class for better
structure and functionality.
	- Added detailed logging configuration for better monitoring.

- **Bug Fixes**
- Improved data handling in `download_lua` to include model numbers
conditionally.

- **Documentation**
- Updated `.vscode/extensions.json` to recommend the
`vscode-coverage-gutters` extension.

- **Tests**
- Expanded test coverage for Midea Local CLI features, including cloud
interaction, device discovery, message sending, and more.

- **Chores**
- Updated `.gitignore` to exclude LUA protocol files and renamed library
configuration file.
- Modified `.vscode/settings.json` for enhanced test coverage reporting.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
rokam and pre-commit-ci[bot] authored Jul 12, 2024
1 parent f74ff8e commit 7a99374
Show file tree
Hide file tree
Showing 7 changed files with 518 additions and 143 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ reports/
# IDE
.idea/

# Optional config file for library_test.py script
# Optional config file for library script
library_test.json
midea-local.json

# LUA protocol implementation
*.lua
cov.xml
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"recommendations": [
"charliermarsh.ruff",
"esbenp.prettier-vscode",
"ms-python.python"
"ms-python.python",
"ryanluker.vscode-coverage-gutters"
]
}
34 changes: 34 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,35 @@
"module": "midealocal.cli",
"args": [
"save",
"-d",
"--cloud-name",
"${input:cloud-name}",
"--username",
"${input:username}",
"--password",
"${input:password}"
]
},
{
"name": "Python Debugger: Download from host",
"type": "debugpy",
"request": "launch",
"module": "midealocal.cli",
"args": ["download", "-d", "--host", "${input:host}"]
},
{
"name": "Python Debugger: Download from sn and type",
"type": "debugpy",
"request": "launch",
"module": "midealocal.cli",
"args": [
"download",
"-d",
"--device-type",
"${input:device-type}",
"--device-sn",
"${input:device-sn}"
]
}
],
"inputs": [
Expand All @@ -38,6 +60,18 @@
"description": "Enter the host IP address (leave empty to broadcast on the network)",
"default": ""
},
{
"id": "device-type",
"type": "promptString",
"description": "Enter the device type ex. AC",
"default": ""
},
{
"id": "device-sn",
"type": "promptString",
"description": "Enter the device serial number.",
"default": ""
},
{
"id": "message",
"type": "promptString",
Expand Down
8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{
"python.testing.pytestArgs": ["tests", "--no-cov"],
"python.testing.pytestArgs": [
"tests",
"--cov-report",
"xml:cov.xml",
"--cov",
"midealocal"
],
"python.testing.pytestEnabled": true,
"pylint.importStrategy": "fromEnvironment",
"python.testing.unittestEnabled": false
Expand Down
Loading

0 comments on commit 7a99374

Please sign in to comment.