Skip to content

Commit f5c835a

Browse files
committed
rename integration to Nilan Connect
1 parent 665f299 commit f5c835a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+4128
-3554
lines changed

.devcontainer.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "nilan_connect/devcontainer",
3+
"image": "mcr.microsoft.com/devcontainers/python:3.12-bookworm",
4+
"postCreateCommand": "scripts/setup.sh",
5+
"appPort": [
6+
"1338:8123",
7+
"6790:6790"
8+
],
9+
"portsAttributes": {
10+
"8123": {
11+
"label": "Home Assistant - Nilan Connect",
12+
"onAutoForward": "notify"
13+
}
14+
},
15+
"customizations": {
16+
"vscode": {
17+
"extensions": [
18+
"ms-python.python",
19+
"github.vscode-pull-request-github",
20+
"ryanluker.vscode-coverage-gutters",
21+
"ms-python.vscode-pylance",
22+
"ms-python.black-formatter",
23+
"eamodio.gitlens"
24+
],
25+
"settings": {
26+
"files.eol": "\n",
27+
"editor.tabSize": 4,
28+
"python.pythonPath": "/usr/bin/python3",
29+
"python.analysis.autoSearchPaths": false,
30+
"python.formatting.provider": "black",
31+
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
32+
"editor.formatOnPaste": false,
33+
"editor.formatOnSave": true,
34+
"editor.formatOnType": true,
35+
"files.trimTrailingWhitespace": true
36+
}
37+
}
38+
},
39+
"remoteUser": "root"
40+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Bug / problem report
3+
about: Report a problem so we can improve the integration
4+
title: ''
5+
labels:
6+
assignees: HairingX
7+
8+
---
9+
10+
**Describe the bug or problem (In Danish is OK)**
11+
<!--
12+
A clear and concise description of what the bug or problem is.
13+
-->
14+
15+
**Please answer the following**
16+
- Version of integration:
17+
- Version of Home Assistant:
18+
- [ ] I have more than one child
19+
- [ ] My children are attending different schools / institutions
20+
21+
**REQUIRED! Provide debug log from the integration**
22+
- Enable by adding the following to your configuration.yaml:
23+
```
24+
logger:
25+
default: info
26+
logs:
27+
custom_components.nilan_connect: debug
28+
```
29+
- Restart Home Assistant
30+
- Capture all log lines (from the integration only), save it to a file and attach it to here.

.github/dependabot.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: github-actions
9+
directory: "/"
10+
schedule:
11+
interval: daily
12+
- package-ecosystem: pip
13+
directory: "/.github/workflows"
14+
schedule:
15+
interval: daily
16+
- package-ecosystem: pip
17+
directory: "/"
18+
schedule:
19+
interval: daily
20+
time: "04:00"
21+
labels:
22+
- dependencies

.github/release-drafter.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
change-template: '- #$NUMBER $TITLE @$AUTHOR'
4+
sort-direction: ascending
5+
exclude-labels:
6+
- 'skip-changelog'
7+
categories:
8+
- title: '🛠 Breaking Changes'
9+
labels:
10+
- breaking-change
11+
12+
- title: '🚀 Features'
13+
labels:
14+
- 'feature request'
15+
- 'enhancement'
16+
17+
- title: '🐛 Bug Fixes'
18+
labels:
19+
- 'fix'
20+
- 'bugfix'
21+
- 'bug'
22+
23+
- title: '🧰 Maintenance'
24+
label: 'chore'
25+
26+
- title: ":package: Dependencies"
27+
labels:
28+
- 'dependencies'
29+
30+
version-resolver:
31+
major:
32+
labels:
33+
- 'major'
34+
minor:
35+
labels:
36+
- 'minor'
37+
patch:
38+
labels:
39+
- 'patch'
40+
default: patch
41+
template: |
42+
## Changes
43+
$CHANGES
44+
autolabeler:
45+
- label: 'bug'
46+
branch:
47+
- '/fix\/.+/'
48+
- label: 'feature request'
49+
branch:
50+
- '/feature\/.+/'
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
"""Update the manifest file."""
2+
import json
3+
import os
4+
import sys
5+
6+
7+
def update_manifest():
8+
"""Update the manifest file."""
9+
version = "0.0.0"
10+
manifest_path = False
11+
dorequirements = False
12+
13+
for index, value in enumerate(sys.argv):
14+
if value in ["--version", "-V"]:
15+
version = str(sys.argv[index + 1]).replace("v", "")
16+
if value in ["--path", "-P"]:
17+
manifest_path = str(sys.argv[index + 1])[1:-1]
18+
if value in ["--requirements", "-R"]:
19+
dorequirements = True
20+
21+
if not manifest_path:
22+
sys.exit("Missing path to manifest file")
23+
24+
with open(
25+
f"{os.getcwd()}/{manifest_path}/manifest.json",
26+
encoding="UTF-8",
27+
) as manifestfile:
28+
manifest = json.load(manifestfile)
29+
30+
manifest["version"] = version
31+
32+
if dorequirements:
33+
requirements = []
34+
with open(
35+
f"{os.getcwd()}/requirements.txt",
36+
encoding="UTF-8",
37+
) as file:
38+
for line in file:
39+
requirements.append(line.rstrip())
40+
41+
new_requirements = []
42+
for requirement in requirements:
43+
req = requirement.split("==")[0].lower()
44+
new_requirements = [
45+
requirement
46+
for x in manifest["requirements"]
47+
if x.lower().startswith(req)
48+
]
49+
new_requirements += [
50+
x for x in manifest["requirements"] if not x.lower().startswith(req)
51+
]
52+
manifest["requirements"] = new_requirements
53+
54+
with open(
55+
f"{os.getcwd()}/{manifest_path}/manifest.json",
56+
"w",
57+
encoding="UTF-8",
58+
) as manifestfile:
59+
manifestfile.write(
60+
json.dumps(
61+
{
62+
"domain": manifest["domain"],
63+
"name": manifest["name"],
64+
**{
65+
k: v
66+
for k, v in sorted(manifest.items())
67+
if k not in ("domain", "name")
68+
},
69+
},
70+
indent=4,
71+
)
72+
)
73+
74+
75+
update_manifest()
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Close inactive issues
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: "30 1 * * *"
6+
7+
jobs:
8+
close-issues:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
pull-requests: write
13+
steps:
14+
- uses: actions/stale@v4
15+
with:
16+
days-before-issue-stale: 30
17+
days-before-issue-close: 14
18+
stale-issue-label: "stale"
19+
stale-issue-message: "This issue is stale because it has been open for 30 days with no activity."
20+
close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale."
21+
days-before-pr-stale: -1
22+
days-before-pr-close: -1
23+
repo-token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Code validation
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
validate-hassfest:
9+
name: Hassfest validation
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: checkout
13+
uses: actions/checkout@v4
14+
- name: validation
15+
uses: home-assistant/actions/hassfest@master
16+
17+
validate-hacs:
18+
name: HACS validation
19+
runs-on: "ubuntu-latest"
20+
steps:
21+
- name: checkout
22+
uses: "actions/checkout@v4"
23+
- name: validation
24+
uses: "hacs/action@main"
25+
with:
26+
category: "integration"

.github/workflows/release-dev.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release dev
2+
3+
on:
4+
workflow_dispatch:
5+
6+
env:
7+
COMPONENT_DIR: nilan_connect
8+
9+
jobs:
10+
release_zip_file:
11+
name: Prepare release asset
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out repository
15+
uses: actions/checkout@v4
16+
- name: Create zip
17+
run: |
18+
cd custom_components/nilan_connect
19+
zip nilan_connect.zip -r ./
20+
- name: Upload zip to release
21+
uses: svenstaro/upload-release-action@v2
22+
with:
23+
repo_token: ${{ secrets.GITHUB_TOKEN }}
24+
file: ./custom_components/nilan_connect/nilan_connect.zip
25+
asset_name: nilan_connect.zip
26+
tag: ${{ github.ref }}
27+
overwrite: true
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Release Drafter
2+
3+
on:
4+
# workflow_dispatch:
5+
push:
6+
# branches to consider in the event; optional, defaults to all
7+
branches:
8+
- main
9+
# pull_request event is required only for autolabeler
10+
pull_request:
11+
# Only following types are handled by the action, but one can default to all as well
12+
types: [opened, reopened, synchronize]
13+
# pull_request_target event is required for autolabeler to support PRs from forks
14+
# pull_request_target:
15+
# types: [opened, reopened, synchronize]
16+
17+
# permissions:
18+
# contents: read
19+
20+
jobs:
21+
update_release_draft:
22+
name: Update release draft
23+
runs-on: ubuntu-latest
24+
permissions:
25+
# write permission is required to create a github release
26+
contents: write
27+
# write permission is required for autolabeler
28+
# otherwise, read permission is required at least
29+
pull-requests: write
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
36+
# Drafts your next Release notes as Pull Requests are merged into "master"
37+
- name: Create Release
38+
uses: release-drafter/release-drafter@v6
39+
with:
40+
disable-releaser: github.ref != 'refs/heads/master'
41+
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
42+
# with:
43+
# config-name: my-config.yml
44+
# disable-autolabeler: true
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [published]
7+
8+
env:
9+
COMPONENT_DIR: nilan_connect
10+
11+
jobs:
12+
release_zip_file:
13+
name: Prepare release asset
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check out repository
17+
uses: actions/checkout@v4
18+
- name: Update manifest.json version to ${{ github.event.release.tag_name }}
19+
run: |
20+
python3 ${{ github.workspace }}/.github/scripts/update_hacs_manifest.py --version ${{ github.event.release.tag_name }} --path /custom_components/nilan_connect/
21+
- name: Commit manifest update
22+
run: |
23+
git config user.name github-actions
24+
git config user.email github-actions@github.com
25+
git add ./custom_components/nilan_connect/manifest.json
26+
git commit -m "Updated manifest.json"
27+
git push origin HEAD:main
28+
- name: Create zip
29+
run: |
30+
cd custom_components/nilan_connect
31+
zip nilan_connect.zip -r ./
32+
- name: Upload zip to release
33+
uses: svenstaro/upload-release-action@v2
34+
with:
35+
repo_token: ${{ secrets.GITHUB_TOKEN }}
36+
file: ./custom_components/nilan_connect/nilan_connect.zip
37+
asset_name: nilan_connect.zip
38+
tag: ${{ github.ref }}
39+
overwrite: true

0 commit comments

Comments
 (0)