mirror of
https://github.com/home-assistant/core.git
synced 2025-08-05 19:48:23 +00:00
Check badly formatted dhcp addresses in tests
This commit is contained in:
parent
c4d742f549
commit
562f47147e
@ -18,3 +18,9 @@ class DhcpServiceInfo(BaseServiceInfo):
|
||||
as a lowercase string without colons.
|
||||
eg. "AA:BB:CC:12:34:56" is stored as "aabbcc123456"
|
||||
"""
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
"""Post-init processing."""
|
||||
# Ensure macaddress is always a lowercase string without colons
|
||||
if self.macaddress != self.macaddress.lower().replace(":", ""):
|
||||
raise ValueError("macaddress is not correctly formatted")
|
||||
|
Loading…
x
Reference in New Issue
Block a user