Move imports in melissa component (#28021)
* Move imports in melissa component * Fix tox testspull/28139/head
parent
734704c1f7
commit
6025630772
|
@ -1,9 +1,10 @@
|
|||
"""Support for Melissa climate."""
|
||||
import logging
|
||||
|
||||
import melissa
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.const import CONF_USERNAME, CONF_PASSWORD
|
||||
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.discovery import async_load_platform
|
||||
|
||||
|
@ -28,8 +29,6 @@ CONFIG_SCHEMA = vol.Schema(
|
|||
|
||||
async def async_setup(hass, config):
|
||||
"""Set up the Melissa Climate component."""
|
||||
import melissa
|
||||
|
||||
conf = config[DOMAIN]
|
||||
username = conf.get(CONF_USERNAME)
|
||||
password = conf.get(CONF_PASSWORD)
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
"""The test for the Melissa Climate component."""
|
||||
from tests.common import MockDependency, mock_coro_func
|
||||
|
||||
from homeassistant.components import melissa
|
||||
|
||||
from tests.common import MockDependency, mock_coro_func
|
||||
|
||||
VALID_CONFIG = {"melissa": {"username": "********", "password": "********"}}
|
||||
|
||||
|
||||
async def test_setup(hass):
|
||||
"""Test setting up the Melissa component."""
|
||||
with MockDependency("melissa") as mocked_melissa:
|
||||
melissa.melissa = mocked_melissa
|
||||
mocked_melissa.AsyncMelissa().async_connect = mock_coro_func()
|
||||
await melissa.async_setup(hass, VALID_CONFIG)
|
||||
|
||||
|
|
Loading…
Reference in New Issue