Client API

tempoiq.session.get_session(host, key, secret, secure=True, port=None, read_version='v2')[source]

Get a tempoiq.client.Client instance with the given session information.

Parameters:
  • host (String) – Backend’s base URL, in the form “your-host.backend.tempoiq.com”. For legacy reasons, it is also possible to prepend the URL schema, but this will be deprecated in the future.
  • key (String) – API key
  • secret (String) – API secret
Return type:

tempoiq.client.Client

The tempoiq.client module is the main entrypoint into the API. Most user code will only need to interact with the tempoiq.client.Client class in this module.

class tempoiq.client.Client(endpoint, read_version='v2')[source]

Entry point for all TempoIQ API calls.

Parameters:endpoint (tempoiq.endpoint.HTTPEndpoint) – backend and credentials to connect to
create_device(device)[source]

Create a new device

Parameters:device (Device) –
Return type:tempoiq.response.Response with a tempoiq.protocol.device.Device data payload
delete_device(query)[source]

Delete devices that match the provided query.

Parameters:query (tempoiq.protocol.query.builder.QueryBuilder) –
Return type:tempoiq.response.Response
query(object_type)[source]

Begin to build a query on the given object type.

Parameters:object_type – Either Device or Sensor
Return type:QueryBuilder
update_device(device)[source]

Update the attributes of a device.

Parameters:device (Device) –
Return type:tempoiq.response.Response with a tempoiq.protocol.device.Device data payload
write(write_request)[source]

Write data points to one or more devices and sensors.

The write_request argument is a dict which maps device keys to device data.

The device data is itself a dict mapping sensor key to a list of tempoiq.protocol.point.Point

Parameters:write_request (dict) –