diff --git a/supervisor/dbus/network/interface.py b/supervisor/dbus/network/interface.py index 5803df246..fadecacef 100644 --- a/supervisor/dbus/network/interface.py +++ b/supervisor/dbus/network/interface.py @@ -59,6 +59,11 @@ class NetworkInterface: """Return the interface id.""" return self.connection.id + @property + def uuid(self) -> str: + """Return the interface uuid.""" + return self.connection.uuid + @property def method(self) -> InterfaceMethod: """Return the interface method.""" diff --git a/supervisor/dbus/payloads/interface_update.tmpl b/supervisor/dbus/payloads/interface_update.tmpl index 927b893d0..11eb95dfb 100644 --- a/supervisor/dbus/payloads/interface_update.tmpl +++ b/supervisor/dbus/payloads/interface_update.tmpl @@ -2,7 +2,8 @@ 'connection': { 'id': <'{{interface.id}}'>, - 'type': <'{{interface.type}}'> + 'type': <'{{interface.type}}'>, + 'uuid': <'{{interface.uuid}}'> }, {% if options.get("method") == "auto" %} diff --git a/tests/dbus/payloads/test_interface_update_payload.py b/tests/dbus/payloads/test_interface_update_payload.py index 8a9634628..10e6b67ef 100644 --- a/tests/dbus/payloads/test_interface_update_payload.py +++ b/tests/dbus/payloads/test_interface_update_payload.py @@ -18,6 +18,10 @@ async def test_interface_update_payload_ethernet(network_interface): assert DBus.parse_gvariant(data)["ipv4"]["method"] == "manual" assert DBus.parse_gvariant(data)["ipv4"]["address-data"][0]["address"] == "1.1.1.1" assert DBus.parse_gvariant(data)["ipv4"]["dns"] == [16843009, 16777217] + assert ( + DBus.parse_gvariant(data)["connection"]["uuid"] + == "0c23631e-2118-355c-bbb0-8943229cb0d6" + ) @pytest.mark.asyncio