From 28e7b0a212d255b45fef035abe98cbf3ad133b9c Mon Sep 17 00:00:00 2001 From: patman15 <14628713+patman15@users.noreply.github.com> Date: Fri, 20 Dec 2024 20:26:00 +0100 Subject: [PATCH 1/5] add workflows --- .github/workflows/hassfest.yaml | 16 ++++++++++++++++ .github/workflows/stale.yaml | 22 ++++++++++++++++++++++ .github/workflows/validate.yaml | 19 +++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 .github/workflows/hassfest.yaml create mode 100644 .github/workflows/stale.yaml create mode 100644 .github/workflows/validate.yaml diff --git a/.github/workflows/hassfest.yaml b/.github/workflows/hassfest.yaml new file mode 100644 index 0000000..21a14df --- /dev/null +++ b/.github/workflows/hassfest.yaml @@ -0,0 +1,16 @@ +name: Validate with hassfest + +on: + push: + pull_request: + workflow_dispatch: + schedule: + - cron: '0 6 * * 6' + +jobs: + validate-hassfest: + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v4" + - name: HA validation + uses: "home-assistant/actions/hassfest@master" diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml new file mode 100644 index 0000000..963cb60 --- /dev/null +++ b/.github/workflows/stale.yaml @@ -0,0 +1,22 @@ +name: 'Close stale issues and PR' +on: + schedule: + - cron: '01 2 * * *' + +jobs: + stale: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - uses: actions/stale@v9 + with: + stale-issue-message: 'This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 8 days.' + stale-pr-message: 'This PR is stale because it has been open 45 days with no activity.' + close-issue-message: 'This issue was closed because it has been stalled for 15 days with no activity.' + exempt-issue-labels: 'bug' + exempt-all-assignees: true + days-before-stale: 45 + days-before-close: 15 + days-before-pr-close: -1 diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml new file mode 100644 index 0000000..df59ded --- /dev/null +++ b/.github/workflows/validate.yaml @@ -0,0 +1,19 @@ +name: Validate with HACS + +on: + push: + pull_request: + workflow_dispatch: + schedule: + - cron: '0 5 * * 6' + +jobs: + validate-hacs: + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v4" + - name: HACS validation + uses: "hacs/action@main" + with: + category: "integration" + From 88f467d7475a9594b61e2da91038c73a852ab1c3 Mon Sep 17 00:00:00 2001 From: Patrick <14628713+patman15@users.noreply.github.com> Date: Fri, 20 Dec 2024 20:49:35 +0100 Subject: [PATCH 2/5] disable HACS validation HACS requires brand repository to be populated --- .github/workflows/{validate.yaml => _validate.bak} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{validate.yaml => _validate.bak} (100%) diff --git a/.github/workflows/validate.yaml b/.github/workflows/_validate.bak similarity index 100% rename from .github/workflows/validate.yaml rename to .github/workflows/_validate.bak From 57bb36b3172dfd0d89ca05ec5ca06e36402a41c7 Mon Sep 17 00:00:00 2001 From: patman15 <14628713+patman15@users.noreply.github.com> Date: Fri, 20 Dec 2024 20:54:42 +0100 Subject: [PATCH 3/5] Update manifest.json --- custom_components/hunterdouglas_powerview_ble/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/hunterdouglas_powerview_ble/manifest.json b/custom_components/hunterdouglas_powerview_ble/manifest.json index 0038dc6..4011766 100644 --- a/custom_components/hunterdouglas_powerview_ble/manifest.json +++ b/custom_components/hunterdouglas_powerview_ble/manifest.json @@ -17,5 +17,5 @@ "issue_tracker": "https://github.com/patman15/hdpv_ble/issues", "loggers": ["hunterdouglas_powerview_ble"], "requirements": ["cryptography>=43.0.0"], - "version": 0.21 + "version": "0.21" } From 6301253c9b09d46b469f5f86604360ae88e6264b Mon Sep 17 00:00:00 2001 From: patman15 <14628713+patman15@users.noreply.github.com> Date: Fri, 20 Dec 2024 21:15:04 +0100 Subject: [PATCH 4/5] update requirements to HA 2024.11 --- requirements.txt | 2 +- requirements_test.txt | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/requirements.txt b/requirements.txt index fd1987d..bf8d48b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -homeassistant==2024.8.0 +homeassistant==2024.11.0 pip>=21.3.1 ruff==0.6.8 diff --git a/requirements_test.txt b/requirements_test.txt index ef103e2..3ca9df3 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,13 +1,13 @@ -pip>=21.3.1 -homeassistant==2024.6.0 +-r requirements.txt + wheel home-assistant-bluetooth -habluetooth>=2.4.0 +habluetooth>=3.6.0 bluetooth-adapters -pytest>=8.0.2 -pytest-cov>=4.0.0 -pytest-socket>=0.5.0 -pytest-asyncio +pytest>=8.3.3 +pytest-cov>=5.0.0 +pytest-socket>=0.7.0 +pytest-asyncio>=0.24.0 sqlalchemy freezegun requests-mock @@ -16,10 +16,10 @@ aiohttp aiohttp_cors aiohttp-fast-url-dispatcher aiohttp-zlib-ng -bleak>=0.19.0 -bleak-retry-connector>=3.3.0 +bleak>=0.22.3 +bleak-retry-connector>=3.6.0 bluetooth-data-tools pyserial-asyncio pyudev -pytest-homeassistant-custom-component==0.13.132 +pytest-homeassistant-custom-component==0.13.181 From 438201bdbf82621581596ae1983380f0f3c48ec4 Mon Sep 17 00:00:00 2001 From: patman15 <14628713+patman15@users.noreply.github.com> Date: Fri, 20 Dec 2024 21:15:09 +0100 Subject: [PATCH 5/5] Create lint.yml --- .github/workflows/lint.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..d0084f0 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,28 @@ +name: "Lint the code" + +on: + push: + pull_request: + workflow_dispatch: + schedule: + - cron: '0 5 * * 6' + +jobs: + ruff: + name: "Ruff" + runs-on: "ubuntu-latest" + steps: + - name: "Checkout the repository" + uses: "actions/checkout@main" + + - name: "Set up Python" + uses: actions/setup-python@main + with: + python-version: "3.12" + cache: "pip" + + - name: "Install requirements" + run: python3 -m pip install -r requirements.txt + + - name: "Run Ruff" + run: python3 -m ruff check .