Update Event Progress
Description
Updates event progress via the web service.
Function Signature:
def update_event_progress(ws_config: WebServiceConfig, event_id: int, device_serial: str, percent_complete: float) -> StandardResult:
Parameters
- ws_config (WebServiceConfig): Configuration for the web service connection.
- event_id (int): Event identifier.
- device_serial (str): Device serial number.
- percent_complete (float): Completion percentage.
Returns
- StandardResult: A result object containing:
code: HTTP status code (200 for success,-1for exceptions).description: Response body or error message.
Example Usage
# Example usage
ws_config = WebServiceConfig(access_key="key", secret_key="secret", base_url="https://api.example.com/")
event_id = 1
device_serial = "example"
percent_complete = 0.0
result = update_event_progress(ws_config, event_id, device_serial, percent_complete)
print(result)
Behavior
- Sends a signed request to the web service.
- On success, returns the computed value or result object.
Error Handling
- Exceptions set the result code to
-1and include an error message when implemented.