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