1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-24 12:29:08 +00:00

Use udev path instead of mac or name for nm match (#4476)

This commit is contained in:
Mike Degatano
2023-08-04 17:39:35 -04:00
committed by GitHub
parent a98334ede8
commit 86f004e45a
11 changed files with 33 additions and 83 deletions

View File

@@ -11,6 +11,7 @@ from ..const import (
DBUS_ATTR_DRIVER,
DBUS_ATTR_HWADDRESS,
DBUS_ATTR_MANAGED,
DBUS_ATTR_PATH,
DBUS_IFACE_DEVICE,
DBUS_NAME_NM,
DBUS_OBJECT_BASE,
@@ -74,6 +75,12 @@ class NetworkInterface(DBusInterfaceProxy):
"""Return hardware address (i.e. mac address) of device."""
return self.properties[DBUS_ATTR_HWADDRESS]
@property
@dbus_property
def path(self) -> str:
"""Return The path of the device as exposed by the udev property ID_PATH."""
return self.properties[DBUS_ATTR_PATH]
@property
def connection(self) -> NetworkConnection | None:
"""Return the connection used for this interface."""