Move imports in melissa component (#28021)

* Move imports in melissa component

* Fix tox tests
pull/28139/head
Diefferson Koderer Môro 2019-10-23 06:19:00 +00:00 committed by Paulus Schoutsen
parent 734704c1f7
commit 6025630772
2 changed files with 5 additions and 5 deletions

View File

@ -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)

View File

@ -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)