mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Add Lock capability to SmartThings platform (#20977)
* 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
This commit is contained in:
@@ -126,7 +126,7 @@ async def test_update_from_signal(hass, device_factory):
|
||||
async def test_unload_config_entry(hass, device_factory):
|
||||
"""Test the switch is removed when the config entry is unloaded."""
|
||||
# Arrange
|
||||
device = device_factory('Switch', [Capability.switch],
|
||||
device = device_factory('Switch 1', [Capability.switch],
|
||||
{Attribute.switch: 'on'})
|
||||
config_entry = await _setup_platform(hass, device)
|
||||
# Act
|
||||
|
||||
Reference in New Issue
Block a user