1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-14 07:43:48 +01:00

Convert IPAddress to use Pythonmodule ipaddress (#8072)

This commit is contained in:
Jimmy Hedman
2025-01-12 20:12:38 +01:00
committed by GitHub
parent fe80750743
commit d69926485c
9 changed files with 65 additions and 75 deletions

View File

@@ -54,16 +54,6 @@ class HexInt(int):
return f"{sign}0x{value:X}"
class IPAddress:
def __init__(self, *args):
if len(args) != 4:
raise ValueError("IPAddress must consist of 4 items")
self.args = args
def __str__(self):
return ".".join(str(x) for x in self.args)
class MACAddress:
def __init__(self, *parts):
if len(parts) != 6: