Move SmartThings imports to top (#24878)

* Move imports to top

* use lib constants

* Add missing three_axis mapping
This commit is contained in:
Andrew Sayre 2019-06-30 22:29:21 -04:00 committed by GitHub
parent 7d651e2b7a
commit 7db4eeaf7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 176 additions and 191 deletions

View file

@ -1,6 +1,8 @@
"""Support for fans through the SmartThings cloud API."""
from typing import Optional, Sequence
from pysmartthings import Capability
from homeassistant.components.fan import (
SPEED_HIGH, SPEED_LOW, SPEED_MEDIUM, SPEED_OFF, SUPPORT_SET_SPEED,
FanEntity)
@ -34,8 +36,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
supported = [Capability.switch, Capability.fan_speed]
# Must have switch and fan_speed
if all(capability in capabilities for capability in supported):