Move SmartThings imports to top (#24878)
* Move imports to top * use lib constants * Add missing three_axis mapping
This commit is contained in:
1 parent
7d651e2b7a
commit
7db4eeaf7f
12 files changed
+176
-191
No files matched your search
@@ -1,6 +1,8 @@
|
||||
"""Support for locks through the SmartThings cloud API."""
|
||||
from typing import Optional, Sequence
|
||||
|
||||
from pysmartthings import Attribute, Capability
|
||||
|
||||
from homeassistant.components.lock import LockDevice
|
||||
|
||||
from . import SmartThingsEntity
|
||||
@@ -33,8 +35,6 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
|
||||
def get_capabilities(capabilities: Sequence[str]) -> Optional[Sequence[str]]:
|
||||
"""Return all capabilities supported if minimum required are present."""
|
||||
from pysmartthings import Capability
|
||||
|
||||
if Capability.lock in capabilities:
|
||||
return [Capability.lock]
|
||||
return None
|
||||
@@ -61,7 +61,6 @@ class SmartThingsLock(SmartThingsEntity, LockDevice):
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
"""Return device specific state attributes."""
|
||||
from pysmartthings import Attribute
|
||||
state_attrs = {}
|
||||
status = self._device.status.attributes[Attribute.lock]
|
||||
if status.value:
|
||||
|
||||
Reference in new issue
Block a user