We use RESTful API to provide basic manipulation of the Sesame smart lock, including: * Get Sesame lock/unlock status * Get battery status * Lock and unlock Sesame * Sync Sesame status * Get results for lock, unlock, and sync commands
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 3.0.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
Python 2.7 and 3.4+
If the python package is hosted on Github, you can install directly from Github
pip install git+https://github.com/sesame-app/sesame-python-client.git
(you may need to run pip
with root permission: sudo pip install git+https://github.com/sesame-app/sesame-python-client.git
)
Then import the package:
import sesame_client
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
Then import the package:
import sesame_client
Please follow the installation procedure and then run the following:
from __future__ import print_function
import time
import sesame_client
from sesame_client.rest import ApiException
from pprint import pprint
configuration = sesame_client.Configuration()
# Configure API key authorization: api_key
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# Defining host is optional and default to https://api.candyhouse.co/public
configuration.host = "https://api.candyhouse.co/public"
# Create an instance of the API class
api_instance = sesame_client.DefaultApi(sesame_client.ApiClient(configuration))
task_id = 'task_id_example' # str | Task ID from command result.
try:
# Query Execution Result
api_response = api_instance.action_result_get(task_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->action_result_get: %s\n" % e)
All URIs are relative to https://api.candyhouse.co/public
Class | Method | HTTP request | Description |
---|---|---|---|
DefaultApi | action_result_get | GET /action-result | Query Execution Result |
DefaultApi | sesame_device_id_get | GET /sesame/{device_id} | Get Sesame status |
DefaultApi | sesame_device_id_post | POST /sesame/{device_id} | Control Sesame |
DefaultApi | sesames_get | GET /sesames | Get Sesame list |
- BadRequestResponse
- ControlSesameRequest
- ControlSesameResponse
- GetSesameResponse
- GetSesameStatusResponse
- QueryExecutionResultResponse
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header