Skip to content

Commit 60d685a

Browse files
committed
Use IPv4Address for ip address
1 parent 301bbac commit 60d685a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

aiohasupervisor/models/homeassistant.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Models for Home Assistant."""
22

33
from dataclasses import dataclass
4+
from ipaddress import IPv4Address
45

56
from .base import DEFAULT, ContainerStats, Options, Request, ResponseData
67

@@ -15,7 +16,7 @@ class HomeAssistantInfo(ResponseData):
1516
version_latest: str | None
1617
update_available: bool
1718
machine: str
18-
ip_address: str
19+
ip_address: IPv4Address
1920
arch: str
2021
image: str
2122
boot: bool

tests/test_homeassistant.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Test Home Assistant supervisor client."""
22

3+
from ipaddress import IPv4Address
4+
35
from aioresponses import aioresponses
46
from yarl import URL
57

@@ -27,6 +29,7 @@ async def test_homeassistant_info(
2729
assert info.ssl is False
2830
assert info.port == 8123
2931
assert info.audio_output is None
32+
assert info.ip_address == IPv4Address("172.30.32.1")
3033

3134

3235
async def test_homeassistant_stats(

0 commit comments

Comments
 (0)