mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
Update dhcp to use stdlib ipaddress methods (#100625)
This commit is contained in:
parent
33f748493e
commit
06c7f0959c
@ -58,7 +58,6 @@ from homeassistant.helpers.event import (
|
|||||||
from homeassistant.helpers.typing import ConfigType, EventType
|
from homeassistant.helpers.typing import ConfigType, EventType
|
||||||
from homeassistant.loader import DHCPMatcher, async_get_dhcp
|
from homeassistant.loader import DHCPMatcher, async_get_dhcp
|
||||||
from homeassistant.util.async_ import run_callback_threadsafe
|
from homeassistant.util.async_ import run_callback_threadsafe
|
||||||
from homeassistant.util.network import is_invalid, is_link_local, is_loopback
|
|
||||||
|
|
||||||
from .const import DOMAIN
|
from .const import DOMAIN
|
||||||
|
|
||||||
@ -162,9 +161,9 @@ class WatcherBase(ABC):
|
|||||||
made_ip_address = make_ip_address(ip_address)
|
made_ip_address = make_ip_address(ip_address)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
is_link_local(made_ip_address)
|
made_ip_address.is_link_local
|
||||||
or is_loopback(made_ip_address)
|
or made_ip_address.is_loopback
|
||||||
or is_invalid(made_ip_address)
|
or made_ip_address.is_unspecified
|
||||||
):
|
):
|
||||||
# Ignore self assigned addresses, loopback, invalid
|
# Ignore self assigned addresses, loopback, invalid
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user