2019-01-31 01:31:59 +00:00
|
|
|
"""Constants used by the SmartThings component and platforms."""
|
2019-02-22 19:35:12 +00:00
|
|
|
from datetime import timedelta
|
2019-01-31 01:31:59 +00:00
|
|
|
import re
|
|
|
|
|
2019-02-22 19:35:12 +00:00
|
|
|
APP_OAUTH_CLIENT_NAME = "Home Assistant"
|
2019-07-31 19:25:30 +00:00
|
|
|
APP_OAUTH_SCOPES = ["r:devices:*"]
|
|
|
|
APP_NAME_PREFIX = "homeassistant."
|
|
|
|
CONF_APP_ID = "app_id"
|
|
|
|
CONF_CLOUDHOOK_URL = "cloudhook_url"
|
|
|
|
CONF_INSTALLED_APP_ID = "installed_app_id"
|
|
|
|
CONF_INSTALLED_APPS = "installed_apps"
|
|
|
|
CONF_INSTANCE_ID = "instance_id"
|
|
|
|
CONF_LOCATION_ID = "location_id"
|
|
|
|
CONF_OAUTH_CLIENT_ID = "client_id"
|
|
|
|
CONF_OAUTH_CLIENT_SECRET = "client_secret"
|
|
|
|
CONF_REFRESH_TOKEN = "refresh_token"
|
|
|
|
DATA_MANAGER = "manager"
|
|
|
|
DATA_BROKERS = "brokers"
|
|
|
|
DOMAIN = "smartthings"
|
2019-02-03 06:08:37 +00:00
|
|
|
EVENT_BUTTON = "smartthings.button"
|
2019-07-31 19:25:30 +00:00
|
|
|
SIGNAL_SMARTTHINGS_UPDATE = "smartthings_update"
|
|
|
|
SIGNAL_SMARTAPP_PREFIX = "smartthings_smartap_"
|
2019-01-31 01:31:59 +00:00
|
|
|
SETTINGS_INSTANCE_ID = "hassInstanceId"
|
|
|
|
STORAGE_KEY = DOMAIN
|
|
|
|
STORAGE_VERSION = 1
|
2019-02-15 16:40:54 +00:00
|
|
|
# Ordered 'specific to least-specific platform' in order for capabilities
|
2019-02-25 18:13:34 +00:00
|
|
|
# to be drawn-down and represented by the most appropriate platform.
|
2019-01-31 01:31:59 +00:00
|
|
|
SUPPORTED_PLATFORMS = [
|
2019-07-31 19:25:30 +00:00
|
|
|
"climate",
|
|
|
|
"fan",
|
|
|
|
"light",
|
|
|
|
"lock",
|
|
|
|
"cover",
|
|
|
|
"switch",
|
|
|
|
"binary_sensor",
|
|
|
|
"sensor",
|
|
|
|
"scene",
|
2019-01-31 01:31:59 +00:00
|
|
|
]
|
2019-02-22 19:35:12 +00:00
|
|
|
TOKEN_REFRESH_INTERVAL = timedelta(days=14)
|
2019-07-31 19:25:30 +00:00
|
|
|
VAL_UID = (
|
|
|
|
"^(?:([0-9a-fA-F]{32})|([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]"
|
|
|
|
"{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}))$"
|
|
|
|
)
|
2019-01-31 01:31:59 +00:00
|
|
|
VAL_UID_MATCHER = re.compile(VAL_UID)
|