-
Hi, i'm trying to update the location description in our FROST-Server. I am using the FROST-Python client. When i try to execute the
The python code throws the following exception:
Here is a small snippet of how i'm trying to do the update locations = remote_frost.locations().query().list()
for location in locations:
sanitized_description = new_description.replace('/', '-')
print(f"updating location's description to >{sanitized_description}<")
patches = [{'description': sanitized_description }]
remote_frost.patch(entity=location, patches=patches) I'm not sure if there's any issue with my code? The location object is the one i am getting from the server, so it should be complete and have an |
Beta Was this translation helpful? Give feedback.
Answered by
mikedolx
Aug 2, 2023
Replies: 1 comment
-
Nevermind, just found the solution using jsonpatch: import jsonpatch
...
patch = jsonpatch.JsonPatch([{ "op": "replace", "path": "/description", "value": new_description }])
remote_frost.patch(entity=location, patches=patch) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
mikedolx
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nevermind, just found the solution using jsonpatch: