Low-level Cloud API calls

Module for handling Cozify Cloud API 1:1 functions

cozify.cloud_api.cloudBase

str – API endpoint including version

cozify.cloud_api.emaillogin(email, otp)[source]

Raw Cloud API call, request cloud token with email address & OTP.

Parameters:
  • email (str) – Email address connected to Cozify account.
  • otp (int) – One time passcode.
Returns:

cloud token

Return type:

str

cozify.cloud_api.hubkeys(cloud_token)[source]

1:1 implementation of user/hubkeys

Parameters:cloud_token (str) –
Returns:Map of hub_id: hub_token pairs.
Return type:dict
cozify.cloud_api.lan_ip()[source]

1:1 implementation of hub/lan_ip

This call will fail with an APIError if the requesting source address is not the same as that of the hub, i.e. if they’re not in the same NAT network. The above is based on observation and may only be partially true.

Returns:List of Hub ip addresses.
Return type:list
cozify.cloud_api.refreshsession(cloud_token)[source]

1:1 implementation of user/refreshsession

Parameters:cloud_token (str) –
Returns:New cloud remote authentication token. Not automatically stored into state.
Return type:str
cozify.cloud_api.remote(cloud_token, hub_token, apicall, payload=None, **kwargs)[source]

1:1 implementation of ‘hub/remote’

Parameters:
  • cloud_token (str) – Cloud remote authentication token.
  • hub_token (str) – Hub authentication token.
  • apicall (str) – Full API call that would normally go directly to hub, e.g. ‘/cc/1.6/hub/colors’
  • payload (str) – json string to use as payload, changes method to PUT.
Returns:

Requests response object.

Return type:

requests.response

cozify.cloud_api.requestlogin(email)[source]

Raw Cloud API call, request OTP to be sent to account email address.

Parameters:email (str) – Email address connected to Cozify account.