2020-03-14 05:46:17 +00:00
|
|
|
"""Constants for rachio."""
|
|
|
|
|
|
|
|
import http.client
|
|
|
|
import ssl
|
|
|
|
|
|
|
|
DEFAULT_NAME = "Rachio"
|
|
|
|
|
|
|
|
DOMAIN = "rachio"
|
|
|
|
|
|
|
|
CONF_CUSTOM_URL = "hass_url_override"
|
|
|
|
# Manual run length
|
|
|
|
CONF_MANUAL_RUN_MINS = "manual_run_mins"
|
|
|
|
DEFAULT_MANUAL_RUN_MINS = 10
|
|
|
|
|
|
|
|
# Keys used in the API JSON
|
|
|
|
KEY_DEVICE_ID = "deviceId"
|
|
|
|
KEY_IMAGE_URL = "imageUrl"
|
|
|
|
KEY_DEVICES = "devices"
|
|
|
|
KEY_ENABLED = "enabled"
|
|
|
|
KEY_EXTERNAL_ID = "externalId"
|
|
|
|
KEY_ID = "id"
|
|
|
|
KEY_NAME = "name"
|
2020-03-16 02:01:41 +00:00
|
|
|
KEY_MODEL = "model"
|
2020-03-14 05:46:17 +00:00
|
|
|
KEY_ON = "on"
|
2020-04-01 19:27:56 +00:00
|
|
|
KEY_DURATION = "totalDuration"
|
2020-04-27 17:23:16 +00:00
|
|
|
KEY_RAIN_DELAY = "rainDelayExpirationDate"
|
2020-03-14 05:46:17 +00:00
|
|
|
KEY_STATUS = "status"
|
|
|
|
KEY_SUBTYPE = "subType"
|
|
|
|
KEY_SUMMARY = "summary"
|
|
|
|
KEY_SERIAL_NUMBER = "serialNumber"
|
|
|
|
KEY_MAC_ADDRESS = "macAddress"
|
|
|
|
KEY_TYPE = "type"
|
|
|
|
KEY_URL = "url"
|
|
|
|
KEY_USERNAME = "username"
|
|
|
|
KEY_ZONE_ID = "zoneId"
|
|
|
|
KEY_ZONE_NUMBER = "zoneNumber"
|
|
|
|
KEY_ZONES = "zones"
|
2020-04-01 19:27:56 +00:00
|
|
|
KEY_SCHEDULES = "scheduleRules"
|
2020-04-02 18:43:40 +00:00
|
|
|
KEY_FLEX_SCHEDULES = "flexScheduleRules"
|
2020-04-01 19:27:56 +00:00
|
|
|
KEY_SCHEDULE_ID = "scheduleId"
|
2020-03-31 21:46:30 +00:00
|
|
|
KEY_CUSTOM_SHADE = "customShade"
|
|
|
|
KEY_CUSTOM_CROP = "customCrop"
|
|
|
|
|
|
|
|
ATTR_ZONE_TYPE = "type"
|
|
|
|
ATTR_ZONE_SHADE = "shade"
|
2020-03-14 05:46:17 +00:00
|
|
|
|
|
|
|
# Yes we really do get all these exceptions (hopefully rachiopy switches to requests)
|
|
|
|
RACHIO_API_EXCEPTIONS = (
|
|
|
|
http.client.HTTPException,
|
|
|
|
ssl.SSLError,
|
|
|
|
OSError,
|
|
|
|
AssertionError,
|
|
|
|
)
|
2020-03-31 21:46:30 +00:00
|
|
|
|
|
|
|
STATUS_ONLINE = "ONLINE"
|
|
|
|
|
2020-04-05 14:01:41 +00:00
|
|
|
SIGNAL_RACHIO_UPDATE = f"{DOMAIN}_update"
|
|
|
|
SIGNAL_RACHIO_CONTROLLER_UPDATE = f"{SIGNAL_RACHIO_UPDATE}_controller"
|
2020-04-27 17:23:16 +00:00
|
|
|
SIGNAL_RACHIO_RAIN_DELAY_UPDATE = f"{SIGNAL_RACHIO_UPDATE}_rain_delay"
|
2020-04-05 14:01:41 +00:00
|
|
|
SIGNAL_RACHIO_ZONE_UPDATE = f"{SIGNAL_RACHIO_UPDATE}_zone"
|
|
|
|
SIGNAL_RACHIO_SCHEDULE_UPDATE = f"{SIGNAL_RACHIO_UPDATE}_schedule"
|
2020-04-05 22:47:27 +00:00
|
|
|
|
|
|
|
CONF_WEBHOOK_ID = "webhook_id"
|
|
|
|
CONF_CLOUDHOOK_URL = "cloudhook_url"
|