Skip to content

Commit 776e0c3

Browse files
authored
Initial commit
0 parents  commit 776e0c3

31 files changed

+1043
-0
lines changed

.devcontainer.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "ludeeus/integration_blueprint",
3+
"image": "mcr.microsoft.com/devcontainers/python:3.13",
4+
"postCreateCommand": "scripts/setup",
5+
"forwardPorts": [
6+
8123
7+
],
8+
"portsAttributes": {
9+
"8123": {
10+
"label": "Home Assistant",
11+
"onAutoForward": "notify"
12+
}
13+
},
14+
"customizations": {
15+
"vscode": {
16+
"extensions": [
17+
"charliermarsh.ruff",
18+
"github.vscode-pull-request-github",
19+
"ms-python.python",
20+
"ms-python.vscode-pylance",
21+
"ryanluker.vscode-coverage-gutters"
22+
],
23+
"settings": {
24+
"files.eol": "\n",
25+
"editor.tabSize": 4,
26+
"editor.formatOnPaste": true,
27+
"editor.formatOnSave": true,
28+
"editor.formatOnType": false,
29+
"files.trimTrailingWhitespace": true,
30+
"python.analysis.typeCheckingMode": "basic",
31+
"python.analysis.autoImportCompletions": true,
32+
"python.defaultInterpreterPath": "/usr/local/bin/python",
33+
"[python]": {
34+
"editor.defaultFormatter": "charliermarsh.ruff"
35+
}
36+
}
37+
}
38+
},
39+
"remoteUser": "vscode",
40+
"features": {
41+
"ghcr.io/devcontainers-extra/features/apt-packages:1": {
42+
"packages": "ffmpeg,libturbojpeg0,libpcap-dev"
43+
}
44+
}
45+
}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
name: "Bug report"
3+
description: "Report a bug with the integration"
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: Before you open a new issue, search through the existing issues to see if others have had the same problem.
8+
- type: textarea
9+
attributes:
10+
label: "System Health details"
11+
description: "Paste the data from the System Health card in Home Assistant (https://www.home-assistant.io/more-info/system-health#github-issues)"
12+
validations:
13+
required: true
14+
- type: checkboxes
15+
attributes:
16+
label: Checklist
17+
options:
18+
- label: I have enabled debug logging for my installation.
19+
required: true
20+
- label: I have filled out the issue template to the best of my ability.
21+
required: true
22+
- label: This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
23+
required: true
24+
- label: This issue is not a duplicate issue of any [previous issues](https://github.com/ludeeus/integration_blueprint/issues?q=is%3Aissue+label%3A%22Bug%22+)..
25+
required: true
26+
- type: textarea
27+
attributes:
28+
label: "Describe the issue"
29+
description: "A clear and concise description of what the issue is."
30+
validations:
31+
required: true
32+
- type: textarea
33+
attributes:
34+
label: Reproduction steps
35+
description: "Without steps to reproduce, it will be hard to fix. It is very important that you fill out this part. Issues without it will be closed."
36+
value: |
37+
1.
38+
2.
39+
3.
40+
...
41+
validations:
42+
required: true
43+
- type: textarea
44+
attributes:
45+
label: "Debug logs"
46+
description: "To enable debug logs check this https://www.home-assistant.io/integrations/logger/, this **needs** to include _everything_ from startup of Home Assistant to the point where you encounter the issue."
47+
render: text
48+
validations:
49+
required: true
50+
51+
- type: textarea
52+
attributes:
53+
label: "Diagnostics dump"
54+
description: "Drag the diagnostics dump file here. (see https://www.home-assistant.io/integrations/diagnostics/ for info)"

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: false
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
name: "Feature request"
3+
description: "Suggest an idea for this project"
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: Before you open a new feature request, search through the existing feature requests to see if others have had the same idea.
8+
- type: checkboxes
9+
attributes:
10+
label: Checklist
11+
options:
12+
- label: I have filled out the template to the best of my ability.
13+
required: true
14+
- label: This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
15+
required: true
16+
- label: This issue is not a duplicate feature request of [previous feature requests](https://github.com/ludeeus/integration_blueprint/issues?q=is%3Aissue+label%3A%22Feature+Request%22+).
17+
required: true
18+
19+
- type: textarea
20+
attributes:
21+
label: "Is your feature request related to a problem? Please describe."
22+
description: "A clear and concise description of what the problem is."
23+
placeholder: "I'm always frustrated when [...]"
24+
validations:
25+
required: true
26+
27+
- type: textarea
28+
attributes:
29+
label: "Describe the solution you'd like"
30+
description: "A clear and concise description of what you want to happen."
31+
validations:
32+
required: true
33+
34+
- type: textarea
35+
attributes:
36+
label: "Describe alternatives you've considered"
37+
description: "A clear and concise description of any alternative solutions or features you've considered."
38+
validations:
39+
required: true
40+
41+
- type: textarea
42+
attributes:
43+
label: "Additional context"
44+
description: "Add any other context or screenshots about the feature request here."
45+
validations:
46+
required: true

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
2+
version: 2
3+
updates:
4+
- package-ecosystem: "devcontainers"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"
8+
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "daily"
13+
14+
- package-ecosystem: "pip"
15+
directory: "/"
16+
schedule:
17+
interval: "daily"
18+
ignore:
19+
# Dependabot should not update Home Assistant as that should match the homeassistant key in hacs.json
20+
- dependency-name: "homeassistant"

.github/workflows/lint.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
branches:
9+
- "main"
10+
11+
permissions: {}
12+
13+
jobs:
14+
ruff:
15+
name: "Ruff"
16+
runs-on: "ubuntu-latest"
17+
steps:
18+
- name: Checkout the repository
19+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
23+
with:
24+
python-version: "3.13"
25+
cache: "pip"
26+
27+
- name: Install requirements
28+
run: python3 -m pip install -r requirements.txt
29+
30+
- name: Lint
31+
run: python3 -m ruff check .
32+
33+
- name: Format
34+
run: python3 -m ruff format . --check

.github/workflows/validate.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Validate
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 0 * * *"
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
branches:
12+
- main
13+
14+
permissions: {}
15+
16+
jobs:
17+
hassfest: # https://developers.home-assistant.io/blog/2020/04/16/hassfest
18+
name: Hassfest validation
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout the repository
22+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
23+
24+
- name: Run hassfest validation
25+
uses: home-assistant/actions/hassfest@87c064c607f3c5cc673a24258d0c98d23033bfc3 # master
26+
27+
hacs: # https://github.com/hacs/action
28+
name: HACS validation
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Run HACS validation
32+
uses: hacs/action@d556e736723344f83838d08488c983a15381059a # 22.5.0
33+
with:
34+
category: integration
35+
# Remove this 'ignore' key when you have added brand images for your integration to https://github.com/home-assistant/brands
36+
ignore: brands

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# artifacts
2+
__pycache__
3+
.pytest*
4+
*.egg-info
5+
*/build/*
6+
*/dist/*
7+
8+
9+
# misc
10+
.coverage
11+
.vscode
12+
coverage.xml
13+
.ruff_cache
14+
15+
16+
# Home Assistant configuration
17+
config/*
18+
!config/configuration.yaml

.ruff.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# The contents of this file is based on https://github.com/home-assistant/core/blob/dev/pyproject.toml
2+
3+
target-version = "py313"
4+
5+
[lint]
6+
select = [
7+
"ALL",
8+
]
9+
10+
ignore = [
11+
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
12+
"D203", # no-blank-line-before-class (incompatible with formatter)
13+
"D212", # multi-line-summary-first-line (incompatible with formatter)
14+
"COM812", # incompatible with formatter
15+
"ISC001", # incompatible with formatter
16+
]
17+
18+
[lint.flake8-pytest-style]
19+
fixture-parentheses = false
20+
21+
[lint.pyupgrade]
22+
keep-runtime-typing = true
23+
24+
[lint.mccabe]
25+
max-complexity = 25

0 commit comments

Comments
 (0)