Skip to content

Commit c6e970a

Browse files
committed
Merge remote-tracking branch 'blueprint/dev' into dev
# Conflicts: # LICENSE.md # README.md # custom_components/integration_blueprint/__init__.py # custom_components/integration_blueprint/binary_sensor.py # custom_components/integration_blueprint/config_flow.py # custom_components/integration_blueprint/const.py # custom_components/integration_blueprint/sensor.py # custom_components/integration_blueprint/switch.py # hacs.json # tests/const.py # tests/test_config_flow.py # tests/test_switch.py
2 parents dcbcfc4 + f1a647f commit c6e970a

19 files changed

+298
-70
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ jobs:
4848
# If you wish to specify custom queries, you can do so here or in a config file.
4949
# By default, queries listed here will override any specified in a config file.
5050
# Prefix the list here with "+" to use these queries and those in the config file.
51-
51+
5252
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
5353
# queries: security-extended,security-and-quality
5454

55-
55+
5656
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5757
# If this step fails, then you should remove it and run the build manually (see below)
5858
- name: Autobuild
@@ -61,7 +61,7 @@ jobs:
6161
# ℹ️ Command-line programs to run using the OS shell.
6262
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
6363

64-
# If the Autobuild fails above, remove it and uncomment the following three lines.
64+
# If the Autobuild fails above, remove it and uncomment the following three lines.
6565
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
6666

6767
# - run: |

.github/workflows/issue-lock.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,20 @@ name: Lock Inactive Threads
33
on:
44
schedule:
55
- cron: '0 5 * * *'
6+
workflow_dispatch:
7+
8+
permissions:
9+
issues: write
10+
pull-requests: write
11+
12+
concurrency:
13+
group: lock
614

715
jobs:
816
lock:
917
runs-on: ubuntu-latest
1018
steps:
11-
- uses: dessant/lock-threads@v3
19+
- uses: dessant/lock-threads@v4
1220
with:
1321
github-token: ${{ github.token }}
1422
issue-lock-inactive-days: 30

.github/workflows/py-dead-code.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
echo "package=$(ls -F | grep \/$ | grep -v "bin\|examples\|tests" | sed -n "s/\///g;1p")" >> $GITHUB_ENV
1616
1717
- name: "Set up Python"
18-
uses: actions/setup-python@v3
18+
uses: actions/setup-python@v4
1919
with:
2020
python-version: '3.9'
2121

.github/workflows/py-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
echo "package=$(ls -F | grep \/$ | grep -v "bin\|examples\|tests" | sed -n "s/\///g;1p")" >> $GITHUB_ENV
2424
2525
- name: "Set up Python"
26-
uses: actions/setup-python@v3
26+
uses: actions/setup-python@v4
2727
with:
2828
python-version: '3.9'
2929

@@ -72,7 +72,7 @@ jobs:
7272
uses: actions/checkout@v3
7373

7474
- name: Set up Python ${{ matrix.python-version }}
75-
uses: actions/setup-python@v3
75+
uses: actions/setup-python@v4
7676
with:
7777
python-version: ${{ matrix.python-version }}
7878

.github/workflows/release.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ on:
77
- "[v0-9]+.[0-9]+*"
88

99
jobs:
10-
release_zip_file:
11-
name: "Prepare release asset"
10+
release:
11+
name: "Publish new release"
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: "Check out repository"
@@ -17,7 +17,7 @@ jobs:
1717
- working-directory: ./custom_components
1818
run: |
1919
echo "package=$(ls -F | grep \/$ | sed -n "s/\///g;1p")" >> $GITHUB_ENV
20-
echo "release_version=$(git describe --abbrev=0 | sed s/v//)" >> $GITHUB_ENV
20+
echo "release_version=$(git describe --tags | sed s/v//)" >> $GITHUB_ENV
2121
- working-directory: ./custom_components
2222
run: |
2323
echo "basedir=$(pwd)/${{ env.package }}" >> $GITHUB_ENV
@@ -34,34 +34,32 @@ jobs:
3434
run: |
3535
zip ${{ env.package }}.zip -r ./
3636
37-
- name: "Upload zip to release"
37+
- name: "Release"
3838
if: env.release_version != '' && success()
39-
uses: svenstaro/upload-release-action@v2
39+
uses: softprops/action-gh-release@v1
4040
with:
41-
repo_token: ${{ secrets.GITHUB_TOKEN }}
42-
file: ${{ env.basedir }}/${{ env.package }}.zip
43-
asset_name: ${{ env.package }}.zip
44-
tag: ${{ env.release_version }}
45-
overwrite: true
41+
files: ${{ env.basedir }}/${{ env.package }}.zip
4642

47-
releasenotes:
48-
name: "Prepare releasenotes"
43+
release-notes:
44+
name: "Compose release notes"
45+
needs: release
4946
runs-on: ubuntu-latest
5047
steps:
5148
- name: "Check out repository"
5249
uses: actions/checkout@v3
5350

5451
- working-directory: ./custom_components
5552
run: |
56-
echo "release_version=$(git describe --abbrev=0 | sed s/v//)" >> $GITHUB_ENV
53+
echo "release_version=$(git describe --tags | sed s/v//)" >> $GITHUB_ENV
5754
5855
- name: "Set up Python"
5956
if: env.release_version != '' && success()
60-
uses: actions/setup-python@v3
57+
uses: actions/setup-python@v4
6158
with:
6259
python-version: 3.9
6360

6461
- name: "Cache pip"
62+
if: env.release_version != '' && success()
6563
uses: actions/cache@v3
6664
with:
6765
# This path is specific to Ubuntu

.pre-commit-config.yaml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,39 @@ repos:
55
name: Update manifest.json
66
entry: bin/update_manifest
77
language: script
8-
files: ^custom_components/.+/const\.py$
8+
files: ^(custom_components/.+/const\.py|requirements\.txt)$
9+
- repo: https://github.com/charliermarsh/ruff-pre-commit
10+
rev: v0.0.241
11+
hooks:
12+
- id: ruff
13+
args:
14+
- --fix
15+
files: ^(custom_components|bin|tests)/.+\.py$
916
- repo: https://github.com/asottile/pyupgrade
10-
rev: v2.7.4
17+
rev: v3.3.1
1118
hooks:
1219
- id: pyupgrade
13-
args: [--py37-plus]
20+
args: [ --py310-plus ]
21+
stages: [manual]
1422
- repo: https://github.com/psf/black
15-
rev: 22.3.0
23+
rev: 23.1.0
1624
hooks:
1725
- id: black
1826
args:
1927
- --safe
2028
- --quiet
2129
files: ^(custom_components|bin|tests)/.+\.py$
22-
- repo: https://gitlab.com/pycqa/flake8
23-
rev: 3.8.1
30+
- repo: https://github.com/pycqa/flake8.git
31+
rev: 6.0.0
2432
hooks:
2533
- id: flake8
2634
additional_dependencies:
2735
- flake8-docstrings==1.5.0
2836
- pydocstyle==5.0.2
2937
files: ^(custom_components|bin|tests)/.+\.py$
38+
stages: [manual]
3039
- repo: https://github.com/PyCQA/bandit
31-
rev: 1.7.0
40+
rev: 1.7.4
3241
hooks:
3342
- id: bandit
3443
args:
@@ -37,11 +46,11 @@ repos:
3746
- --configfile=tests/bandit.yaml
3847
files: ^(custom_components|bin|tests)/.+\.py$
3948
- repo: https://github.com/pre-commit/mirrors-isort
40-
rev: v5.6.4
49+
rev: v5.10.1
4150
hooks:
4251
- id: isort
4352
- repo: https://github.com/pre-commit/pre-commit-hooks
44-
rev: v2.5.0
53+
rev: v4.4.0
4554
hooks:
4655
- id: check-executables-have-shebangs
4756
stages: [manual]

.vscode/launch.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,3 @@
3232
}
3333
]
3434
}
35-

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ The original setup of this component is by [Andrey "Limych" Khrolenok](https://g
183183
For a full list of all authors and contributors,
184184
check [the contributor's page][contributors].
185185

186+
This Home Assistant custom component was created and is updated using the [HA-Blueprint template](https://github.com/Limych/ha-blueprint). You can use this template to maintain your own Home Assistant custom components.
187+
186188
## License
187189

188190
MIT License

bin/release

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ log.info "Commit tagged as v$new"
119119
if echo "${new}" | grep -q "-"; then
120120
dev=$(bump_prerel "${new}")
121121
else
122-
dev="$(echo "${new}" | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.)-alpha"
122+
dev="$(echo "${new}" | awk -F. '/[0-9]+\./{($NF)++;print}' OFS=.)-alpha"
123123
fi
124124

125125
log.info "Patch files to version '${dev}'..."

bin/setup

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ source ./bin/_common
1414

1515
if [ ! -d "venv" ]; then
1616
log.info "Initializing the virtual environment..."
17-
${python} -m venv venv
17+
# For error 'executable `python` not found' run
18+
# rm -Rf ~/.local/share/virtualenv
19+
${python} -m venv ./venv
1820
source ./venv/bin/activate
1921
python="${ROOT}/venv/bin/python3"
2022
fi

0 commit comments

Comments
 (0)