Zone module

Zone module handling /zone/ API calls.

class rachiopy.zone.Zone(authtoken: str, http_session=None, timeout=25)

Zone class with methods for /zone/ API calls.

get(zone_id: str)

Retrieve the information for a zone entity.

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

Parameters:

zone_id (str) – Zone’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 (Python object if it contains JSON).

Return type:

tuple

schedule()

Create an empty zone schedule.

set_moisture_level(zone_id: str, level: Decimal)

Set zone moisture level.

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

Parameters:
  • zone_id (str) – Zone’s unique id

  • level – Soil moisture level in mm (Range is 0 - Maximum Moisture

in mm (depth of water + (10% depth of water)) :type level: Decimal

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 (Python object if it contains JSON).

Return type:

tuple

set_moisture_percent(zone_id: str, percent: Decimal)

Set zone moisture percent.

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

Parameters:
  • zone_id (str) – Zone’s unique id

  • percent (Decimal) – Soil moisture percent (Range is 0 - 1 )

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 (Python object if it contains JSON).

Return type:

tuple

start(zone_id: str, duration: int)

Start a zone.

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

Parameters:
  • zone_id (str) – Zone’s unique id

  • duration (int) – Duration in seconds (Range is 0 - 10800 (3 Hours) )

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 (Python object if it contains JSON).

Return type:

tuple

start_multiple(zones)

Start multiple zones.

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

Parameters:

zones (Object[]) – Zone’s unique id, duration, and sort order

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 (Python object if it contains JSON).

Return type:

tuple

class rachiopy.zone.ZoneSchedule(zone_api: Zone)

Help with starting multiple zones.

enqueue(zone_id: str, duration: int)

Add a zone and duration to the schedule.

Parameters:
  • zone_id (str) – Zone’s unique id

  • duration (int) – Duration in seconds (Range is 0 - 10800 (3 Hours) )

start()

Start the schedule.