Skip to content

Commit fa7a10d

Browse files
committed
Fix ZeroconfServiceInfo for upcoming HA-core and attempt at fixing building for HA dev branch
1 parent 8ddb3d2 commit fa7a10d

File tree

9 files changed

+71
-14
lines changed

9 files changed

+71
-14
lines changed

.github/workflows/test.yml

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,22 @@ jobs:
5858
SKIP: local-test-core-prep,local-test-pip-prep,local-testing,local-quality
5959

6060
# Prepare default python version environment
61-
ha-core-prepare:
61+
ha-core-release:
6262
runs-on: ubuntu-latest
63-
name: Setup for HA-core (release)
63+
name: Setup for HA-core (release/master)
6464
needs:
6565
- pre-commit
6666
steps:
6767
- name: Check out committed code
6868
uses: actions/[email protected]
69+
- name: Determine Branch Test Mode
70+
id: determine_mode
71+
run: |
72+
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'require-dev-pass') }}" == "true" ]]; then
73+
echo "STRICT_DEV=true" >> $GITHUB_ENV
74+
else
75+
echo "STRICT_DEV=false" >> $GITHUB_ENV
76+
fi
6977
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
7078
id: python
7179
uses: actions/[email protected]
@@ -75,7 +83,7 @@ jobs:
7583
id: cache-hacore
7684
uses: actions/[email protected]
7785
env:
78-
cache-name: cache-hacore
86+
cache-name: cache-hacore-release
7987
with:
8088
path: ./
8189
key: >-
@@ -89,8 +97,52 @@ jobs:
8997
${{ env.CACHE_VERSION}}-${{ runner.os }}
9098
${{ env.CACHE_VERSION}}
9199
- name: Test through HA-core (master/release)
100+
continue-on-error: ${{ env.STRICT_DEV == 'true' }} # Allow master failures only if dev is strict
101+
run: |
102+
GITHUB_ACTIONS="" scripts/core-testing.sh
103+
104+
ha-core-dev:
105+
runs-on: ubuntu-latest
106+
name: Setup for HA-core (dev)
107+
needs:
108+
- pre-commit
109+
steps:
110+
- name: Check out committed code
111+
uses: actions/[email protected]
112+
- name: Determine Branch Test Mode
113+
id: determine_mode
114+
run: |
115+
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'require-dev-pass') }}" == "true" ]]; then
116+
echo "STRICT_DEV=true" >> $GITHUB_ENV
117+
else
118+
echo "STRICT_DEV=false" >> $GITHUB_ENV
119+
fi
120+
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
121+
id: python
122+
uses: actions/[email protected]
123+
with:
124+
python-version: ${{ env.DEFAULT_PYTHON }}
125+
- name: Restore base HA-core Python ${{ env.DEFAULT_PYTHON }} environment
126+
id: cache-hacore
127+
uses: actions/[email protected]
128+
env:
129+
cache-name: cache-hacore-dev
130+
with:
131+
path: ./
132+
key: >-
133+
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-hacore-${{
134+
steps.python.outputs.python-version }}-${{
135+
hashFiles('./custom_components/plugwise/manifest.json') }}-${{
136+
hashFiles('./ha-core/.git/plugwise-tracking') }}
137+
restore-keys: |
138+
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-hacore-${{ steps.python.outputs.python-version }}-
139+
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-hacore
140+
${{ env.CACHE_VERSION}}-${{ runner.os }}
141+
${{ env.CACHE_VERSION}}
142+
- name: Test through HA-core (dev)
143+
continue-on-error: ${{ env.STRICT_DEV == 'false' }} # Allow dev failures unless strict
92144
run: |
93-
GITHUB_ACTIONS="" BRANCH="master" scripts/core-testing.sh
145+
GITHUB_ACTIONS="" BRANCH="dev" scripts/core-testing.sh
94146
95147
shellcheck:
96148
name: Shellcheck

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ venv
88
*.orig
99
node_modules
1010
manual_clone_ha
11+
package-lock.json

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,30 +75,30 @@ repos:
7575
hooks:
7676
- id: local-test-core-prep
7777
# yamllint disable-line rule:line-length
78-
name: "Home Assistant Core Testing - Cloning/updating HA core#master - patience!"
78+
name: "Home Assistant Core Testing - Cloning/updating HA core - patience!"
7979
# yamllint disable-line rule:line-length
80-
entry: /usr/bin/env bash -c 'exec env GITHUB_ACTIONS="1" scripts/core-testing.sh core_prep'
80+
entry: /usr/bin/env bash -c 'exec env GITHUB_ACTIONS="1" BRANCH="${BRANCH:-}" scripts/core-testing.sh core_prep'
8181
language: script
8282
pass_filenames: false
8383
- id: local-test-pip-prep
8484
# yamllint disable-line rule:line-length
8585
name: "Home Assistant Core Testing - Installing dependencies - patience!"
8686
# yamllint disable-line rule:line-length
87-
entry: /usr/bin/env bash -c 'exec env GITHUB_ACTIONS="1" scripts/core-testing.sh pip_prep'
87+
entry: /usr/bin/env bash -c 'exec env GITHUB_ACTIONS="1" BRANCH="${BRANCH:-}" scripts/core-testing.sh pip_prep'
8888
language: script
8989
pass_filenames: false
9090
- id: local-testing
9191
# yamllint disable-line rule:line-length
9292
name: "Home Assistant Core Testing - Performing Tests"
9393
# yamllint disable-line rule:line-length
94-
entry: /usr/bin/env bash -c 'exec env GITHUB_ACTIONS="1" scripts/core-testing.sh testing'
94+
entry: /usr/bin/env bash -c 'exec env GITHUB_ACTIONS="1" BRANCH="${BRANCH:-}" scripts/core-testing.sh testing'
9595
language: script
9696
pass_filenames: false
9797
- id: local-quality
9898
# yamllint disable-line rule:line-length
9999
name: "Home Assistant Core Testing - Quality checks - might need patience"
100100
# yamllint disable-line rule:line-length
101-
entry: /usr/bin/env bash -c 'exec env GITHUB_ACTIONS="1" scripts/core-testing.sh quality'
101+
entry: /usr/bin/env bash -c 'exec env GITHUB_ACTIONS="1" BRANCH="${BRANCH:-}" scripts/core-testing.sh quality'
102102
language: script
103103
pass_filenames: false
104104
- repo: https://github.com/igorshubovych/markdownlint-cli

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Versions from 0.40 and up
44

5+
## v0.56.1 / ONGOING
6+
7+
- Config_flow: follow [Core PR](https://github.com/home-assistant/core/pull/135653) movement of ZeroconfServiceInfo
8+
59
## v0.56.0
610

711
- Internal: Fixes for the CI process

custom_components/plugwise/config_flow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
)
1818
import voluptuous as vol
1919

20-
from homeassistant.components.zeroconf import ZeroconfServiceInfo
2120
from homeassistant.config_entries import (
2221
SOURCE_USER,
2322
ConfigEntry,
@@ -42,6 +41,7 @@
4241
from homeassistant.core import HomeAssistant, callback
4342
from homeassistant.helpers import config_validation as cv
4443
from homeassistant.helpers.aiohttp_client import async_get_clientsession
44+
from homeassistant.helpers.service_info.zeroconf import ZeroconfServiceInfo
4545

4646
from .const import (
4747
ANNA_WITH_ADAM,

custom_components/plugwise/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
"iot_class": "local_polling",
99
"loggers": ["plugwise"],
1010
"requirements": ["plugwise==1.7.0"],
11-
"version": "0.56.0",
11+
"version": "0.56.1a0",
1212
"zeroconf": ["_plugwise._tcp.local."]
1313
}

hacs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"sensor",
1010
"switch"
1111
],
12-
"homeassistant": "2024.12.0b2",
12+
"homeassistant": "2025.2.0",
1313
"render_readme": true
1414
}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "plugwise-beta"
3-
version = "0.55.4"
3+
version = "0.56.1a0"
44
description = "Plugwise beta custom-component"
55
readme = "README.md"
66
requires-python = ">=3.12"

tests/components/plugwise/test_config_flow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
DEFAULT_PORT,
2020
DOMAIN,
2121
)
22-
from homeassistant.components.zeroconf import ZeroconfServiceInfo
2322
from homeassistant.config_entries import SOURCE_USER, SOURCE_ZEROCONF, ConfigFlowResult
2423
from homeassistant.const import (
2524
CONF_HOST,
@@ -33,6 +32,7 @@
3332
)
3433
from homeassistant.core import HomeAssistant
3534
from homeassistant.data_entry_flow import FlowResultType
35+
from homeassistant.helpers.service_info.zeroconf import ZeroconfServiceInfo
3636
from packaging.version import Version
3737

3838
from tests.common import MockConfigEntry

0 commit comments

Comments
 (0)