Notification module

Notification module handling /notification/ API calls.

class rachiopy.notification.Notification(authtoken: str, http_session=None, timeout=25)

Notification class with methods for /notification/ API calls.

add(dev_id: str, external_id: str, url: str, event_types)

Add a webhook to a device.

externalId can be used as opaque data that is tied to your company, and passed back in each webhook event response.

For more info of the content in the response see: https://rachio.readme.io/docs/publicnotificationwebhook

Parameters:
  • dev_id (str) – Device’s unique id

  • external_id – External company ID

  • url (str) – External webhook URL

  • event_type (Object[]) – Event types

Returns:

The return value is a tuple of (response, content), the first being and instance of the httplib2.Response class, the second being a string that contains the response entity body.

Return type:

tuple

delete(hook_id: str)

Remove a webhook.

For more info of the content in the response see: https://rachio.readme.io/docs/publicnotificationwebhookid

Parameters:

hook_id (str) – Webhook’s unique id

Returns:

The return value is a tuple of (response, content), the first being and instance of the httplib2.Response class, the second being a string that contains the response entity body.

Return type:

tuple

get(hook_id: str)

Get a webhook.

For more info of the content in the response see: https://rachio.readme.io/docs/publicnotificationdeviceidwebhook

Parameters:

hook_id (str) – Webhook’s unique id

Returns:

The return value is a tuple of (response, content), the first being and instance of the httplib2.Response class, the second being a string that contains the response entity body.

Return type:

tuple

get_device_webhook(dev_id: str)

Retrieve all webhooks for a device.

For more info of the content in the response see: https://rachio.readme.io/docs/publicnotificationdeviceidwebhook

Parameters:

dev_id (str) – Device’s unique id

Returns:

The return value is a tuple of (response, content), the first being and instance of the httplib2.Response class, the second being a string that contains the response entity body.

Return type:

tuple

get_webhook_event_type()

Retrieve the list of events types.

Event types that are available to any webhook for subscription.

For more info of the content in the response see: https://rachio.readme.io/docs/publicnotificationwebhook_event_type

Returns:

The return value is a tuple of (response, content), the first being and instance of the httplib2.Response class, the second being a string that contains the response entity body.

Return type:

tuple

update(hook_id: str, external_id: str, url: str, event_types)

Update a webhook.

For more info of the content in the response see: https://rachio.readme.io/docs/publicnotificationwebhook-1

Parameters:
  • hook_id (str) – Webhook’s unique id

  • external_id – External company ID

  • url (str) – External webhook URL

  • event_type (Object[]) – Event types

Returns:

The return value is a tuple of (response, content), the first being and instance of the httplib2.Response class, the second being a string that contains the response entity body.

Return type:

tuple