mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-12-29 17:11:19 +01:00
only update type value in serialized dict if its not a method
This commit is contained in:
@@ -311,8 +311,13 @@ class Server:
|
||||
get_nested_dict_by_path(self._state_manager.cache, full_access_path)
|
||||
)
|
||||
serialized_value = dump(value)
|
||||
|
||||
if cached_value_dict["type"] != "method":
|
||||
cached_value_dict["type"] = serialized_value["type"]
|
||||
else:
|
||||
logger.debug("Got method")
|
||||
|
||||
cached_value_dict["value"] = serialized_value["value"]
|
||||
cached_value_dict["type"] = serialized_value["type"]
|
||||
|
||||
async def notify() -> None:
|
||||
try:
|
||||
|
||||
@@ -259,8 +259,9 @@ def set_nested_value_by_path(
|
||||
# setting the new value
|
||||
serialized_value = dump(value)
|
||||
if "readonly" in current_dict:
|
||||
if current_dict["type"] != "method":
|
||||
current_dict["type"] = serialized_value["type"]
|
||||
current_dict["value"] = serialized_value["value"]
|
||||
current_dict["type"] = serialized_value["type"]
|
||||
else:
|
||||
current_dict.update(serialized_value)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user