Commit 11ac19f0 authored by unknown's avatar unknown
Browse files

delegate update of status history to BKC API

parent 382cc095
...@@ -73,17 +73,9 @@ class BuildingGeneric: ...@@ -73,17 +73,9 @@ class BuildingGeneric:
Update the history. Update the history.
Note: the retries for conflict error are managed within BKC API Note: the retries for conflict error are managed within BKC API
""" """
payload = {"operation_history": status}
if self._building.get("operation_history") is None: url = "/".join([self.settings.base_url, self._uid, "history"])
operation_history = [status] # Init the history if did not already exist return self._req(method="put", url=url, json=payload)
else:
operation_history = [*self._building.get("operation_history"), status]
payload = {
"operation_history": operation_history
}
self._req("put", "/".join([self.settings.base_url, self._uid]), json={**payload})
def register_error_for_building(self, error_code: str): def register_error_for_building(self, error_code: str):
""" """
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment