Climate const.py move (#20945)

* Move constants to const.py

* Import from const instead of climate
This commit is contained in:
Joakim Plate authored and Fabian Affolter committed 2019-02-14 20:34:43 +01:00
1 parent 3736120c6a
commit c5de32e7b1
72 files changed
+372 -295

No files matched your search

@@ -8,7 +8,8 @@ import pytest
from homeassistant import core, const, setup
from homeassistant.components import (
fan, cover, light, switch, climate, lock, async_setup, media_player)
fan, cover, light, switch, lock, async_setup, media_player)
from homeassistant.components.climate import const as climate
from homeassistant.const import CLOUD_NEVER_EXPOSED_ENTITIES
from homeassistant.components import google_assistant as ga
@@ -3,7 +3,9 @@ from homeassistant.core import State
from homeassistant.const import (
ATTR_SUPPORTED_FEATURES, ATTR_UNIT_OF_MEASUREMENT, TEMP_CELSIUS)
from homeassistant.setup import async_setup_component
from homeassistant.components import climate
from homeassistant.components.climate.const import (
ATTR_MIN_TEMP, ATTR_MAX_TEMP, STATE_HEAT, SUPPORT_OPERATION_MODE
)
from homeassistant.components.google_assistant import (
const, trait, helpers, smart_home as sh)
from homeassistant.components.light.demo import DemoLight
@@ -210,10 +212,10 @@ async def test_execute(hass):
async def test_raising_error_trait(hass):
"""Test raising an error while executing a trait command."""
hass.states.async_set('climate.bla', climate.STATE_HEAT, {
climate.ATTR_MIN_TEMP: 15,
climate.ATTR_MAX_TEMP: 30,
ATTR_SUPPORTED_FEATURES: climate.SUPPORT_OPERATION_MODE,
hass.states.async_set('climate.bla', STATE_HEAT, {
ATTR_MIN_TEMP: 15,
ATTR_MAX_TEMP: 30,
ATTR_SUPPORTED_FEATURES: SUPPORT_OPERATION_MODE,
ATTR_UNIT_OF_MEASUREMENT: TEMP_CELSIUS,
})
result = await sh.async_handle_message(hass, BASIC_CONFIG, {
@@ -2,7 +2,6 @@
import pytest
from homeassistant.components import (
climate,
cover,
fan,
input_boolean,
@@ -15,10 +14,11 @@ from homeassistant.components import (
vacuum,
group,
)
from homeassistant.components.climate import const as climate
from homeassistant.components.google_assistant import trait, helpers, const
from homeassistant.const import (
STATE_ON, STATE_OFF, ATTR_ENTITY_ID, SERVICE_TURN_ON, SERVICE_TURN_OFF,
TEMP_CELSIUS, TEMP_FAHRENHEIT, ATTR_SUPPORTED_FEATURES)
TEMP_CELSIUS, TEMP_FAHRENHEIT, ATTR_SUPPORTED_FEATURES, ATTR_TEMPERATURE)
from homeassistant.core import State, DOMAIN as HA_DOMAIN
from homeassistant.util import color
from tests.common import async_mock_service
@@ -668,7 +668,7 @@ async def test_temperature_setting_climate_range(hass):
climate.ATTR_CURRENT_HUMIDITY: 25,
climate.ATTR_OPERATION_MODE: climate.STATE_AUTO,
climate.ATTR_OPERATION_LIST: [
climate.STATE_OFF,
STATE_OFF,
climate.STATE_COOL,
climate.STATE_HEAT,
climate.STATE_AUTO,
@@ -737,12 +737,12 @@ async def test_temperature_setting_climate_setpoint(hass):
'climate.bla', climate.STATE_AUTO, {
climate.ATTR_OPERATION_MODE: climate.STATE_COOL,
climate.ATTR_OPERATION_LIST: [
climate.STATE_OFF,
STATE_OFF,
climate.STATE_COOL,
],
climate.ATTR_MIN_TEMP: 10,
climate.ATTR_MAX_TEMP: 30,
climate.ATTR_TEMPERATURE: 18,
ATTR_TEMPERATURE: 18,
climate.ATTR_CURRENT_TEMPERATURE: 20
}), BASIC_CONFIG)
assert trt.sync_attributes() == {
@@ -772,7 +772,7 @@ async def test_temperature_setting_climate_setpoint(hass):
assert len(calls) == 1
assert calls[0].data == {
ATTR_ENTITY_ID: 'climate.bla',
climate.ATTR_TEMPERATURE: 19
ATTR_TEMPERATURE: 19
}