avoids notifying server when updates are pushed from the server itself

This commit is contained in:
Mose Müller 2024-03-28 18:37:11 +01:00
parent d100bb5fea
commit 19b24f3060

View File

@ -45,14 +45,14 @@ class Client(pydase.DataService):
else: else:
# need to change to avoid overwriting the proxy class # need to change to avoid overwriting the proxy class
data["type"] = "DeviceConnection" data["type"] = "DeviceConnection"
self.proxy._notify_changed("", loads(data)) super(pydase.DataService, self.proxy)._notify_changed("", loads(data))
@self._sio.event @self._sio.event
def notify(data: NotifyDict) -> None: def notify(data: NotifyDict) -> None:
# Notify the DataServiceObserver directly, not going through # Notify the DataServiceObserver directly, not going through
# self._notify_changed as this would trigger the "update_value" event # self._notify_changed as this would trigger the "update_value" event
super(pydase.DataService, self)._notify_changed( super(pydase.DataService, self.proxy)._notify_changed(
f"proxy.{data['data']['full_access_path']}", data["data"]["full_access_path"],
loads(data["data"]["value"]), loads(data["data"]["value"]),
) )