mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-13 20:26:29 +00:00
Make network connection setting behave like NetworkManager
Update the current settings with the new ones instead of overwriting them. That is how NetworkManager seems to behave.
This commit is contained in:
parent
540ba4b6e4
commit
c13e1e91ce
@ -3,6 +3,7 @@
|
||||
from ipaddress import IPv6Address
|
||||
from dbus_fast import Variant
|
||||
from dbus_fast.service import PropertyAccess, dbus_property, signal
|
||||
from copy import deepcopy
|
||||
|
||||
from .base import DBusServiceMock, dbus_method
|
||||
|
||||
@ -103,7 +104,7 @@ class ConnectionSettings(DBusServiceMock):
|
||||
"""Initialize object."""
|
||||
super().__init__()
|
||||
self.object_path = object_path
|
||||
self.settings = SETINGS_FIXTURES[object_path]
|
||||
self.settings = deepcopy(SETINGS_FIXTURES[object_path])
|
||||
|
||||
@dbus_property(access=PropertyAccess.READ)
|
||||
def Unsaved(self) -> "b":
|
||||
@ -131,7 +132,11 @@ class ConnectionSettings(DBusServiceMock):
|
||||
@dbus_method()
|
||||
def Update(self, properties: "a{sa{sv}}") -> None:
|
||||
"""Do Update method."""
|
||||
self.settings = properties
|
||||
for k, v in properties.items():
|
||||
if k in self.settings:
|
||||
self.settings[k].update(v)
|
||||
else:
|
||||
self.settings[k] = v
|
||||
self.Updated()
|
||||
|
||||
@dbus_method()
|
||||
|
Loading…
x
Reference in New Issue
Block a user