Set Startup Preset
Description
Sets startup preset via the web service.
Function Signature:
def set_startup_preset(ws_config: WebServiceConfig, event_preset_id: int, offline_preset: bool = False, device_id: int = 0, device_group_id: int = 0) -> StandardResult:
Parameters
- ws_config (WebServiceConfig): Configuration for the web service connection.
- event_preset_id (int): Event preset identifier.
- offline_preset (bool): Input value for
offline_preset. - device_id (int): Device identifier.
- device_group_id (int): Device group identifier.
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_preset_id = 1
offline_preset = False
device_id = 1
device_group_id = 1
result = set_startup_preset(ws_config, event_preset_id, offline_preset, device_id, device_group_id)
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.