1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-06 13:22:19 +01:00

Add multicast support to udp component (#8051)

This commit is contained in:
Jimmy Hedman
2025-01-29 11:00:18 +01:00
committed by GitHub
parent a23ce416ea
commit 9957840dfc
6 changed files with 39 additions and 0 deletions

View File

@@ -1168,6 +1168,15 @@ def ipv4address(value):
return address
def ipv4address_multi_broadcast(value):
address = ipv4address(value)
if not (address.is_multicast or (address == IPv4Address("255.255.255.255"))):
raise Invalid(
f"{value} is not a multicasst address nor local broadcast address"
)
return address
def ipaddress(value):
try:
address = ip_address(value)