generated from ludeeus/integration_blueprint
-
Notifications
You must be signed in to change notification settings - Fork 16
General updates #23
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
General updates #23
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,35 +1,52 @@ | ||
| { | ||
| "name": "custom-components/readme", | ||
| "image": "mcr.microsoft.com/devcontainers/python:3.12", | ||
| "postCreateCommand": "scripts/setup", | ||
| "forwardPorts": [ | ||
| 8123 | ||
| ], | ||
| "portsAttributes": { | ||
| "8123": { | ||
| "label": "Home Assistant", | ||
| "onAutoForward": "notify" | ||
| } | ||
| }, | ||
| "customizations": { | ||
| "vscode": { | ||
| "extensions": [ | ||
| "ms-python.python" | ||
| ], | ||
| "settings": { | ||
| "files.eol": "\n", | ||
| "editor.tabSize": 4, | ||
| "editor.formatOnPaste": true, | ||
| "editor.formatOnSave": true, | ||
| "editor.formatOnType": false, | ||
| "files.trimTrailingWhitespace": true, | ||
| "python.formatting.provider": "black", | ||
| "python.analysis.typeCheckingMode": "basic", | ||
| "python.analysis.autoImportCompletions": true, | ||
| "python.defaultInterpreterPath": "/usr/local/bin/python" | ||
| } | ||
| } | ||
| }, | ||
| "remoteUser": "vscode", | ||
| "features": {} | ||
| { | ||
| "name": "custom-components/readme", | ||
| "image": "mcr.microsoft.com/devcontainers/python:3.13", | ||
| "postCreateCommand": "scripts/setup", | ||
| "forwardPorts": [ | ||
| 8123 | ||
| ], | ||
| "portsAttributes": { | ||
| "8123": { | ||
| "label": "Home Assistant", | ||
| "onAutoForward": "notify" | ||
| } | ||
| }, | ||
| "customizations": { | ||
| "vscode": { | ||
| "extensions": [ | ||
| "charliermarsh.ruff", | ||
| "github.vscode-pull-request-github", | ||
| "ms-python.python", | ||
| "ms-python.vscode-pylance", | ||
| "ryanluker.vscode-coverage-gutters" | ||
| ], | ||
| "settings": { | ||
| "files.eol": "\n", | ||
| "editor.tabSize": 4, | ||
| "editor.formatOnPaste": true, | ||
| "editor.formatOnSave": true, | ||
| "editor.formatOnType": false, | ||
| "files.trimTrailingWhitespace": true, | ||
| "python.analysis.typeCheckingMode": "basic", | ||
| "python.analysis.autoImportCompletions": true, | ||
| "python.defaultInterpreterPath": "/usr/local/bin/python", | ||
| "[python]": { | ||
| "editor.defaultFormatter": "charliermarsh.ruff" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "remoteUser": "vscode", | ||
| "features": { | ||
| "ghcr.io/devcontainers/features/python:1": { | ||
| "version": "3.13.2" | ||
| }, | ||
| "ghcr.io/devcontainers-extra/features/apt-packages:1": { | ||
| "packages": [ | ||
| "ffmpeg", | ||
| "libturbojpeg0", | ||
| "libpcap-dev" | ||
| ] | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| * text=auto eol=lf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| blank_issues_enabled: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: "devcontainers" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "daily" | ||
|
|
||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "daily" | ||
|
|
||
| - package-ecosystem: "pip" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "daily" | ||
| ignore: | ||
| # Dependabot should not update Home Assistant as that should match the homeassistant key in hacs.json | ||
| - dependency-name: "homeassistant" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| change-template: "- #$NUMBER $TITLE @$AUTHOR" | ||
| sort-direction: ascending | ||
| include-labels: | ||
| - "beta" | ||
| - "breaking-change" | ||
| - "bugfix" | ||
| - "dependencies" | ||
| - "enhancement" | ||
| - "feature" | ||
| - "refactor" | ||
| categories: | ||
| - title: "💥 Breaking changes" | ||
| label: "breaking-change" | ||
|
|
||
| - title: "🚧 Beta changes" | ||
| label: "beta" | ||
| collapse-after: 1 | ||
|
|
||
| - title: "✨ New features" | ||
| label: "feature" | ||
|
|
||
| - title: "🚀 Performance" | ||
| label: "enhancement" | ||
|
|
||
| - title: "🔨 Refactor" | ||
| label: "refactor" | ||
|
|
||
| - title: "🐛 Bug fixes" | ||
| label: "bugfix" | ||
|
|
||
| - title: "⬆️ Dependency updates" | ||
| label: "dependencies" | ||
| collapse-after: 1 | ||
|
|
||
| template: | | ||
| $CHANGES | ||
|
|
||
| *** | ||
| If you are using this integration, please consider enabling [Home Assistant usage analytics](https://www.home-assistant.io/integrations/analytics/#usage-analytics). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| name: Lint | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - "main" | ||
| pull_request: | ||
| branches: | ||
| - "main" | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| ruff: | ||
| name: "Ruff" | ||
| runs-on: "ubuntu-latest" | ||
| steps: | ||
| - name: Checkout the repository | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | ||
| with: | ||
| python-version: "3.13" | ||
| cache: "pip" | ||
|
|
||
| - name: Install requirements | ||
| run: python3 -m pip install -r requirements.txt | ||
|
|
||
| - name: Lint | ||
| run: python3 -m ruff check . | ||
|
|
||
| - name: Format | ||
| run: python3 -m ruff format . --check |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| name: Release Drafter | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| release-drafter: | ||
| name: Release Drafter | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout the repository | ||
| uses: actions/[email protected] | ||
|
|
||
| - name: Get next version | ||
| id: version | ||
| run: | | ||
| echo "version=$(jq .version -r ./custom_components/healthchecksio/manifest.json)" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Run Release Drafter | ||
| uses: release-drafter/[email protected] | ||
| with: | ||
| tag: ${{ steps.version.outputs.version }} | ||
| name: ${{ steps.version.outputs.version }} | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,61 +1,55 @@ | ||
| name: Release Workflow | ||
| name: Publish | ||
|
|
||
| on: | ||
| release: | ||
| types: | ||
| - published | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| concurrency: | ||
| group: publish-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| release: | ||
| name: Release | ||
| release_zip_file: | ||
| name: Publish readme zip file asset | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: 📥 Checkout the repository | ||
| uses: actions/checkout@v2 | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
|
||
| - name: 🔢 Get release version | ||
| id: version | ||
| uses: home-assistant/actions/helpers/version@master | ||
| - name: 🛠️ Set up Python | ||
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | ||
| with: | ||
| python-version: "3.13" | ||
|
|
||
| - name: ℹ️ Get integration information | ||
| id: information | ||
| run: | | ||
| name=$(find custom_components/ -type d -maxdepth 1 | tail -n 1 | cut -d "/" -f2) | ||
| echo "::set-output name=name::$name" | ||
| - name: 🔢 Get version | ||
| if: ${{ github.event_name == 'release' }} | ||
| id: version | ||
| uses: home-assistant/actions/helpers/version@a19f5f4e08ef2786e4604a948f62addd937a6bc9 # master | ||
|
|
||
| - name: 🖊️ Set version number | ||
| # Pack the readme dir as a zip and upload to the release | ||
| - name: 📦 ZIP readme dir | ||
| run: | | ||
| sed -i '/INTEGRATION_VERSION = /c\INTEGRATION_VERSION = "${{ steps.version.outputs.version }}"' \ | ||
| "${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/const.py" | ||
| jq '.version = "${{ steps.version.outputs.version }}"' \ | ||
| "${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/manifest.json" > tmp \ | ||
| && mv -f tmp "${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/manifest.json" | ||
| cd ${{ github.workspace }}/custom_components/readme | ||
| zip readme.zip -r ./ | ||
|
|
||
| - name: 👀 Validate data | ||
| run: | | ||
| if ! grep -q 'INTEGRATION_VERSION = "${{ steps.version.outputs.version }}"' ${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/const.py; then | ||
| echo "The version in custom_components/${{ steps.information.outputs.name }}/const.py was not correct" | ||
| cat ${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/const.py | grep INTEGRATION_VERSION | ||
| exit 1 | ||
| fi | ||
| manifestversion=$(jq -r '.version' ${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/manifest.json) | ||
| if [ "$manifestversion" != "${{ steps.version.outputs.version }}" ]; then | ||
| echo "The version in custom_components/${{ steps.information.outputs.name }}/manifest.json was not correct" | ||
| echo "$manifestversion" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: 📦 Create zip file for the integration | ||
| run: | | ||
| cd "${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}" | ||
| zip ${{ steps.information.outputs.name }}.zip -r ./ | ||
| - name: 📤 Upload zip to action | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | ||
| if: ${{ github.event_name == 'push' }} | ||
| with: | ||
| name: readme.zip | ||
| path: ${{ github.workspace }}/custom_components/readme/readme.zip | ||
| retention-days: 7 | ||
|
|
||
| - name: 📤 Upload the zip file as a release asset | ||
| uses: actions/upload-release-asset@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: 📤 Upload zip to release | ||
| uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2 | ||
| if: ${{ github.event_name == 'release' }} | ||
| with: | ||
| upload_url: ${{ github.event.release.upload_url }} | ||
| asset_path: "${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/${{ steps.information.outputs.name }}.zip" | ||
| asset_name: ${{ steps.information.outputs.name }}.zip | ||
| asset_content_type: application/zip | ||
| files: ${{ github.workspace }}/custom_components/readme/readme.zip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,37 +1,35 @@ | ||
| name: Validate | ||
|
|
||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| schedule: | ||
| - cron: "0 0 * * *" | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| schedule: | ||
| - cron: "0 0 * * *" | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| validate-hassfest: | ||
| hassfest: # https://developers.home-assistant.io/blog/2020/04/16/hassfest | ||
| name: Hassfest validation | ||
| runs-on: ubuntu-latest | ||
| name: With hassfest | ||
| steps: | ||
| - name: Check out repository | ||
| uses: actions/checkout@v2 | ||
| - name: Checkout the repository | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
|
||
| - name: Hassfest validation | ||
| uses: "home-assistant/actions/hassfest@master" | ||
| - name: Run hassfest validation | ||
| uses: home-assistant/actions/hassfest@a19f5f4e08ef2786e4604a948f62addd937a6bc9 # master | ||
|
|
||
| validate-hacs: | ||
| hacs: # https://github.com/hacs/action | ||
| name: HACS validation | ||
| runs-on: ubuntu-latest | ||
| name: With HACS Action | ||
| steps: | ||
| - name: Check out repository | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: HACS validation | ||
| uses: hacs/action@main | ||
| with: | ||
| category: integration | ||
| comment: false | ||
| ignore: brands | ||
| - name: Run HACS validation | ||
| uses: hacs/action@d556e736723344f83838d08488c983a15381059a # 22.5.0 | ||
| with: | ||
| category: integration | ||
| ignore: brands |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.