Home Assistant Unofficial Reference 2024.12.1
const.py
Go to the documentation of this file.
1 """Constants used by the SmartThings component and platforms."""
2 
3 from datetime import timedelta
4 import re
5 
6 from homeassistant.const import Platform
7 
8 DOMAIN = "smartthings"
9 
10 APP_OAUTH_CLIENT_NAME = "Home Assistant"
11 APP_OAUTH_SCOPES = ["r:devices:*"]
12 APP_NAME_PREFIX = "homeassistant."
13 
14 CONF_APP_ID = "app_id"
15 CONF_CLOUDHOOK_URL = "cloudhook_url"
16 CONF_INSTALLED_APP_ID = "installed_app_id"
17 CONF_INSTANCE_ID = "instance_id"
18 CONF_LOCATION_ID = "location_id"
19 CONF_REFRESH_TOKEN = "refresh_token"
20 
21 DATA_MANAGER = "manager"
22 DATA_BROKERS = "brokers"
23 EVENT_BUTTON = "smartthings.button"
24 
25 SIGNAL_SMARTTHINGS_UPDATE = "smartthings_update"
26 SIGNAL_SMARTAPP_PREFIX = "smartthings_smartap_"
27 
28 SETTINGS_INSTANCE_ID = "hassInstanceId"
29 
30 SUBSCRIPTION_WARNING_LIMIT = 40
31 
32 STORAGE_KEY = DOMAIN
33 STORAGE_VERSION = 1
34 
35 # Ordered 'specific to least-specific platform' in order for capabilities
36 # to be drawn-down and represented by the most appropriate platform.
37 PLATFORMS = [
38  Platform.BINARY_SENSOR,
39  Platform.CLIMATE,
40  Platform.COVER,
41  Platform.FAN,
42  Platform.LIGHT,
43  Platform.LOCK,
44  Platform.SCENE,
45  Platform.SENSOR,
46  Platform.SWITCH,
47 ]
48 
49 IGNORED_CAPABILITIES = [
50  "execute",
51  "healthCheck",
52  "ocf",
53 ]
54 
55 TOKEN_REFRESH_INTERVAL = timedelta(days=14)
56 
57 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}))$"
58 VAL_UID_MATCHER = re.compile(VAL_UID)