Skip to content

Commit b09e54c

Browse files
authored
Bump aiohasupervisor to version 0.2.1 (#129574)
1 parent f44b7e2 commit b09e54c

File tree

9 files changed

+19
-15
lines changed

9 files changed

+19
-15
lines changed

homeassistant/components/hassio/discovery.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import asyncio
66
import logging
77
from typing import Any
8+
from uuid import UUID
89

910
from aiohasupervisor import SupervisorError
1011
from aiohasupervisor.models import Discovery
@@ -86,7 +87,7 @@ async def post(self, request: web.Request, uuid: str) -> web.Response:
8687
"""Handle new discovery requests."""
8788
# Fetch discovery data and prevent injections
8889
try:
89-
data = await self._supervisor_client.discovery.get(uuid)
90+
data = await self._supervisor_client.discovery.get(UUID(uuid))
9091
except SupervisorError as err:
9192
_LOGGER.error("Can't read discovery data: %s", err)
9293
raise HTTPServiceUnavailable from None
@@ -104,7 +105,7 @@ async def delete(self, request: web.Request, uuid: str) -> web.Response:
104105
async def async_rediscover(self, uuid: str) -> None:
105106
"""Rediscover add-on when config entry is removed."""
106107
try:
107-
data = await self._supervisor_client.discovery.get(uuid)
108+
data = await self._supervisor_client.discovery.get(UUID(uuid))
108109
except SupervisorError as err:
109110
_LOGGER.debug("Can't read discovery data: %s", err)
110111
else:
@@ -146,7 +147,7 @@ async def async_process_del(self, data: dict[str, Any]) -> None:
146147

147148
# Check if really deletet / prevent injections
148149
try:
149-
data = await self._supervisor_client.discovery.get(uuid)
150+
await self._supervisor_client.discovery.get(UUID(uuid))
150151
except SupervisorError:
151152
pass
152153
else:

homeassistant/components/hassio/handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ def get_supervisor_client(hass: HomeAssistant) -> SupervisorClient:
382382
"""Return supervisor client."""
383383
hassio: HassIO = hass.data[DOMAIN]
384384
return SupervisorClient(
385-
hassio.base_url,
385+
str(hassio.base_url),
386386
os.environ.get("SUPERVISOR_TOKEN", ""),
387387
session=hassio.websession,
388388
)

homeassistant/components/hassio/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
"documentation": "https://www.home-assistant.io/integrations/hassio",
77
"iot_class": "local_polling",
88
"quality_scale": "internal",
9-
"requirements": ["aiohasupervisor==0.2.0"],
9+
"requirements": ["aiohasupervisor==0.2.1"],
1010
"single_config_entry": true
1111
}

homeassistant/package_constraints.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
aiodhcpwatcher==1.0.2
44
aiodiscover==2.1.0
55
aiodns==3.2.0
6-
aiohasupervisor==0.2.0
6+
aiohasupervisor==0.2.1
77
aiohttp-fast-zlib==0.1.1
88
aiohttp==3.10.10
99
aiohttp_cors==0.7.0

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ dependencies = [
2727
# Integrations may depend on hassio integration without listing it to
2828
# change behavior based on presence of supervisor. Deprecated with #127228
2929
# Lib can be removed with 2025.11
30-
"aiohasupervisor==0.2.0",
30+
"aiohasupervisor==0.2.1",
3131
"aiohttp==3.10.10",
3232
"aiohttp_cors==0.7.0",
3333
"aiohttp-fast-zlib==0.1.1",

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Home Assistant Core
66
aiodns==3.2.0
7-
aiohasupervisor==0.2.0
7+
aiohasupervisor==0.2.1
88
aiohttp==3.10.10
99
aiohttp_cors==0.7.0
1010
aiohttp-fast-zlib==0.1.1

requirements_all.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ aioguardian==2022.07.0
259259
aioharmony==0.2.10
260260

261261
# homeassistant.components.hassio
262-
aiohasupervisor==0.2.0
262+
aiohasupervisor==0.2.1
263263

264264
# homeassistant.components.homekit_controller
265265
aiohomekit==3.2.5

requirements_test_all.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ aioguardian==2022.07.0
244244
aioharmony==0.2.10
245245

246246
# homeassistant.components.hassio
247-
aiohasupervisor==0.2.0
247+
aiohasupervisor==0.2.1
248248

249249
# homeassistant.components.homekit_controller
250250
aiohomekit==3.2.5

tests/components/hassio/test_discovery.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ async def test_hassio_discovery_webhook(
181181
addon_installed.return_value.name = "Mosquitto Test"
182182

183183
resp = await hassio_client.post(
184-
"/api/hassio_push/discovery/testuuid",
185-
json={"addon": "mosquitto", "service": "mqtt", "uuid": "testuuid"},
184+
f"/api/hassio_push/discovery/{uuid!s}",
185+
json={"addon": "mosquitto", "service": "mqtt", "uuid": str(uuid)},
186186
)
187187
await hass.async_block_till_done()
188188
hass.bus.async_fire(EVENT_HOMEASSISTANT_STARTED)
@@ -208,6 +208,9 @@ async def test_hassio_discovery_webhook(
208208
)
209209

210210

211+
TEST_UUID = str(uuid4())
212+
213+
211214
@pytest.mark.parametrize(
212215
(
213216
"entry_domain",
@@ -217,13 +220,13 @@ async def test_hassio_discovery_webhook(
217220
# Matching discovery key
218221
(
219222
"mock-domain",
220-
{"hassio": (DiscoveryKey(domain="hassio", key="test", version=1),)},
223+
{"hassio": (DiscoveryKey(domain="hassio", key=TEST_UUID, version=1),)},
221224
),
222225
# Matching discovery key
223226
(
224227
"mock-domain",
225228
{
226-
"hassio": (DiscoveryKey(domain="hassio", key="test", version=1),),
229+
"hassio": (DiscoveryKey(domain="hassio", key=TEST_UUID, version=1),),
227230
"other": (DiscoveryKey(domain="other", key="blah", version=1),),
228231
},
229232
),
@@ -232,7 +235,7 @@ async def test_hassio_discovery_webhook(
232235
# entry. Such a check can be added if needed.
233236
(
234237
"comp",
235-
{"hassio": (DiscoveryKey(domain="hassio", key="test", version=1),)},
238+
{"hassio": (DiscoveryKey(domain="hassio", key=TEST_UUID, version=1),)},
236239
),
237240
],
238241
)

0 commit comments

Comments
 (0)