Set Device Run Analytics
Description
Update a device.
Function Signature:
def set_device_run_analytics(ws_config: WebServiceConfig, device_id: int, run_analytics: int) -> StandardResult:
Parameters
- ws_config (WebServiceConfig): Configuration for the web service connection.
- device_id (int): Device identifier.
- run_analytics (int): Input value for
run_analytics.
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/")
device_id = 1
run_analytics = 1
result = set_device_run_analytics(ws_config, device_id, run_analytics)
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.