-
Notifications
You must be signed in to change notification settings - Fork 2
Merge ASYNC-branch into MAIN #238
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
Changes from all commits
dd538da
53b046a
9ae86f8
c0b433b
1b6693d
a8f5cb2
53b18b9
93c7cf4
e434ad9
1453ec1
4850605
4e7f737
b06a427
8a0827f
14c8105
f3224b2
d0b48b6
f9b42e3
744e34f
96791e5
a64ffb1
7a28cc2
997f6af
3fcdb1b
629731a
90d1378
f8ac08a
4ba45c2
44f1fd9
c03c806
0132fd8
3c36c7c
a421800
f9bbdd3
35b0266
8f9183c
be45efb
915ae2a
ffc0ae7
b15f7e8
7737beb
d594724
1f3f22f
604cbcc
2894e0a
6c7a4cf
b6a3e17
546c716
845cbe9
0c51916
8063b07
86b5bbc
59e5ec7
162ea85
07bb2c3
e3de82d
83da90f
173a390
6b54141
f7906a8
9ef08a4
369eaa6
fc583d0
31b713b
ab98c8c
387dd33
4025a59
4c73c61
422c66d
059ce73
108b23b
871ce34
7f84427
1379741
ad95c16
36f27a6
a4efc9f
74ac941
c03ebc1
e961058
9851035
30936c1
fe38d9e
7ae1237
6775729
929841d
b6c799e
8cf56b8
9a0021d
aa67b15
13d3484
226b355
8b26dcb
68b232d
40524e0
7816941
2dde300
6c76d19
efb6086
d399acf
a7e803c
c55d2c8
edc1bc4
6ca4fce
1619f30
d0c4434
7adb236
01c2833
542e29f
ea93a24
f97aa63
1d8ad17
a2125a3
2afd234
ea07d7e
257421c
13b8959
33c6ab7
f1d3256
fa0be2b
4304cac
efbc4a1
b5adc20
65a5da2
24265d2
bbf0f0f
d519df5
092df02
d8e0b32
7873b20
5732b32
cd5727f
227a5d8
47e3b77
bcd7156
bfea703
080b095
664bcfa
3fb63cc
0ca5ee1
3cf3c94
99ddd37
4cd1932
f39b0f9
8e14d1b
67c9a0b
5f44259
f9b37d8
c089fad
5bf6a30
361ec59
e3963b1
0927b17
8cea9b4
2001efb
3c78862
93a9df2
5091a10
873d475
a9ec4aa
1b6c7ae
e8a51f5
87b79b1
075795e
9847c80
5df0ee6
0a37faf
5b8f5b8
44e3f83
832797e
8e7056d
c9b4bc6
03dcb98
e42c224
f457369
8e43e6f
00ae598
82244d1
b513069
53f5015
59ec5e2
376670f
6360148
332f59c
dba09be
2026e80
850faec
280f7e9
849bb55
e41d7c6
02d6406
317e90a
45013b4
7827334
4823611
dda3227
b5cca33
6000937
031aa83
096dd52
f8f8b95
f2722e2
268fda1
c840c6f
01aab12
b3cd102
729a895
52dc003
6cb7fa6
43f289d
b920749
152d773
e046fa3
10c4b68
5c47049
d112aae
7caed56
f36f0e6
af55a52
a36a19f
485c222
1f79dfe
8e65a9f
0ed6e32
ff9fb63
840efdf
4399ab0
88b81a3
385c5ab
6c1378d
5b12098
0dfbf72
bac3ac9
ba17ef2
498e8bf
cbf941b
ed78e58
403a550
ad6d830
42ba5a0
49048ab
bec3de3
12797b1
4e903a7
b310341
8c06c82
a8898f8
c1c3ad1
721a8c5
34a987c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,58 @@ | ||||||||||||||||||||||
| // For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||||||||||||||||||||||
| // README at: https://github.com/devcontainers/templates/tree/main/src/python | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| "name": "Python 3", | ||||||||||||||||||||||
| // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||||||||||||||||||||||
| "image": "mcr.microsoft.com/devcontainers/python:3.12", | ||||||||||||||||||||||
| "features": { | ||||||||||||||||||||||
| "ghcr.io/devcontainers-contrib/features/pylint:2": {} | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| // Features to add to the dev container. More info: https://containers.dev/features. | ||||||||||||||||||||||
| // "features": {}, | ||||||||||||||||||||||
| // Use 'forwardPorts' to make a list of ports inside the container available locally. | ||||||||||||||||||||||
| // "forwardPorts": [], | ||||||||||||||||||||||
| // Use 'postCreateCommand' to run commands after the container is created. | ||||||||||||||||||||||
| "postCreateCommand": "git config --global --add safe.directory /workspaces/plugwise_usb-beta && scripts/python-venv.sh && . .venv/bin/activate", | ||||||||||||||||||||||
| // Configure tool-specific properties. | ||||||||||||||||||||||
| // "customizations": {}, | ||||||||||||||||||||||
| // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||||||||||||||||||||||
| // "remoteUser": "root" | ||||||||||||||||||||||
| // Customizations | ||||||||||||||||||||||
| "customizations": { | ||||||||||||||||||||||
| "vscode": { | ||||||||||||||||||||||
| "extensions": [ | ||||||||||||||||||||||
| "ms-python.python", | ||||||||||||||||||||||
| "ms-python.pylint", | ||||||||||||||||||||||
| "github.vscode-pull-request-github", | ||||||||||||||||||||||
| "ryanluker.vscode-coverage-gutters", | ||||||||||||||||||||||
| "ms-python.vscode-pylance", | ||||||||||||||||||||||
| "donjayamanne.python-extension-pack" | ||||||||||||||||||||||
| ], | ||||||||||||||||||||||
| "settings": { | ||||||||||||||||||||||
| "terminal.integrated.defaultProfile.linux": "bash", | ||||||||||||||||||||||
| "terminal.integrated.profiles.linux": { | ||||||||||||||||||||||
| "bash": { | ||||||||||||||||||||||
| "path": "bash", | ||||||||||||||||||||||
| "icon": "terminal-bash" | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| "files.eol": "\n", | ||||||||||||||||||||||
| "editor.tabSize": 4, | ||||||||||||||||||||||
| "python.pythonPath": "/usr/bin/python3", | ||||||||||||||||||||||
| "python.analysis.autoSearchPaths": false, | ||||||||||||||||||||||
| // This makes sure the home assistant types are loaded into the editor | ||||||||||||||||||||||
| "python.analysis.extraPaths": [ | ||||||||||||||||||||||
| "/home/vscode/.local/lib/python3.12/site-packages/" | ||||||||||||||||||||||
| ], | ||||||||||||||||||||||
| "python.linting.pylintEnabled": true, | ||||||||||||||||||||||
| "python.linting.enabled": true, | ||||||||||||||||||||||
| "python.formatting.provider": "ruff", | ||||||||||||||||||||||
|
Comment on lines
+47
to
+49
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Update deprecated Python linting and formatting settings. The Python extension has deprecated these linting and formatting settings in favor of language server configurations and separate formatter extensions. - "python.linting.pylintEnabled": true,
- "python.linting.enabled": true,
- "python.formatting.provider": "ruff",
+ "python.analysis.autoImportCompletions": true,
+ "[python]": {
+ "editor.defaultFormatter": "charliermarsh.ruff",
+ "editor.codeActionsOnSave": {
+ "source.organizeImports": true
+ }
+ },Note: This assumes the Ruff VS Code extension ( 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
| "editor.formatOnPaste": false, | ||||||||||||||||||||||
| "editor.formatOnSave": true, | ||||||||||||||||||||||
| "editor.formatOnType": true, | ||||||||||||||||||||||
| "files.trimTrailingWhitespace": true | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| "appPort": 8123 | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,9 @@ | ||||||||||||
| # Autodetect text files | ||||||||||||
| * text=auto eol=lf | ||||||||||||
|
|
||||||||||||
| # ...Unless the name matches the following | ||||||||||||
| # overriding patterns | ||||||||||||
|
|
||||||||||||
| # Definitively text files | ||||||||||||
| *.py text | ||||||||||||
| *.sh lf | ||||||||||||
|
Comment on lines
+8
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix invalid .gitattributes attribute for shell scripts Proposed fix: -*.sh lf
+*.sh text eol=lf📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| # This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
|
||
| name: Test against HA-core (master/released) | ||
| name: Test against HA-core using pytest-homeassistant-custom-component | ||
|
|
||
| env: | ||
| CACHE_VERSION: 10 | ||
|
|
@@ -18,35 +18,24 @@ jobs: | |
| # Prepare default python version environment | ||
| ha-core-prepare: | ||
| runs-on: ubuntu-latest | ||
| name: Setup for HA-core (release) | ||
| name: Setup for HA-core | ||
| steps: | ||
| - name: Check out committed code | ||
| uses: actions/[email protected] | ||
| - name: Set up Python ${{ env.DEFAULT_PYTHON }} | ||
| id: python | ||
| uses: actions/setup-python@v5 | ||
| uses: actions/setup-python@v5.5.0 | ||
| with: | ||
| python-version: ${{ env.DEFAULT_PYTHON }} | ||
| - name: Restore base HA-core Python ${{ env.DEFAULT_PYTHON }} environment | ||
| id: cache-hacore | ||
| uses: actions/cache@v4 | ||
| env: | ||
| cache-name: cache-hacore | ||
| with: | ||
| path: ./ | ||
| key: >- | ||
| ${{ env.CACHE_VERSION}}-${{ runner.os }}-base-hacore-${{ | ||
| steps.python.outputs.python-version }}-${{ | ||
| hashFiles('./custom_components/plugwise_usb/manifest.json') }}-${{ | ||
| hashFiles('./ha-core/.git/plugwise-tracking') }} | ||
| restore-keys: | | ||
| ${{ env.CACHE_VERSION}}-${{ runner.os }}-base-hacore-${{ steps.python.outputs.python-version }}- | ||
| ${{ env.CACHE_VERSION}}-${{ runner.os }}-base-hacore | ||
| ${{ env.CACHE_VERSION}}-${{ runner.os }} | ||
| ${{ env.CACHE_VERSION}} | ||
| - name: Test through HA-core (master/release) | ||
| - name: Prepare virtual env for testing | ||
| run: | | ||
| scripts/setup_test.sh | ||
| - name: Test | ||
| run: | | ||
| scripts/tests_and_coverage.sh test_and_coverage | ||
| - name: Quality | ||
| run: | | ||
| GITHUB_ACTIONS="" BRANCH="master" scripts/core-testing.sh | ||
| scripts/tests_and_coverage.sh linting | ||
|
|
||
| shellcheck: | ||
| name: Shellcheck | ||
|
|
||
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.
🛠️ Refactor suggestion
Update deprecated Python path setting.
The
python.pythonPathsetting has been deprecated in favor ofpython.defaultInterpreterPath.📝 Committable suggestion
🤖 Prompt for AI Agents