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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user