* Bumped pysmartthings version to 0.6.1 * Added Lock to supported platforms * Added SmartThings Lock component * Updated lock to eagerly set state * Updated requirements_all.txt & requirements_test_all.txt with pysmartthings==0.6.1 * Added SmartThings Lock tests * Removed inapplicable comment * Removed unused import (STATE_UNLOCKED) * Populated device_state_attributes with values provided by SmartThings * Condensed if_lock assertion function * Updated gathered attributes * Fixed typo * Updated tests to use new setup_platform * Updated assignment of device state attributes * Updated tests to utilise the LOCK_DOMAIN constant where suitable * Fixed false positive for Switch test: (test_unload_config_entry) * Implemented constant to contain expected SmartThings state for is_locked check * Improved allocation of State Attributes * Improved allocation of state attributes * Fixed lint error (was running lint checks against the wrong file, whoops) * Added test for unloading lock config * Use isinstance instead of type() * Updated device state to explicitly check for is not None instead of a truthy value
32 lines
863 B
Python
32 lines
863 B
Python
"""Constants used by the SmartThings component and platforms."""
|
|
import re
|
|
|
|
APP_OAUTH_SCOPES = [
|
|
'r:devices:*'
|
|
]
|
|
APP_NAME_PREFIX = 'homeassistant.'
|
|
CONF_APP_ID = 'app_id'
|
|
CONF_INSTALLED_APP_ID = 'installed_app_id'
|
|
CONF_INSTANCE_ID = 'instance_id'
|
|
CONF_LOCATION_ID = 'location_id'
|
|
DATA_MANAGER = 'manager'
|
|
DATA_BROKERS = 'brokers'
|
|
DOMAIN = 'smartthings'
|
|
EVENT_BUTTON = "smartthings.button"
|
|
SIGNAL_SMARTTHINGS_UPDATE = 'smartthings_update'
|
|
SIGNAL_SMARTAPP_PREFIX = 'smartthings_smartap_'
|
|
SETTINGS_INSTANCE_ID = "hassInstanceId"
|
|
STORAGE_KEY = DOMAIN
|
|
STORAGE_VERSION = 1
|
|
SUPPORTED_PLATFORMS = [
|
|
'binary_sensor',
|
|
'climate',
|
|
'fan',
|
|
'light',
|
|
'lock',
|
|
'sensor',
|
|
'switch'
|
|
]
|
|
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}))$"
|
|
VAL_UID_MATCHER = re.compile(VAL_UID)
|