Adjust root-import in google-assistant tests (#78768)
This commit is contained in:
parent
52a377ca9d
commit
7ffac12de7
2 changed files with 20 additions and 20 deletions
|
@ -10,16 +10,16 @@ import pytest
|
||||||
from homeassistant import const, core, setup
|
from homeassistant import const, core, setup
|
||||||
from homeassistant.components import (
|
from homeassistant.components import (
|
||||||
alarm_control_panel,
|
alarm_control_panel,
|
||||||
|
climate,
|
||||||
cover,
|
cover,
|
||||||
fan,
|
fan,
|
||||||
google_assistant as ga,
|
google_assistant as ga,
|
||||||
|
humidifier,
|
||||||
light,
|
light,
|
||||||
lock,
|
lock,
|
||||||
media_player,
|
media_player,
|
||||||
switch,
|
switch,
|
||||||
)
|
)
|
||||||
from homeassistant.components.climate import const as climate
|
|
||||||
from homeassistant.components.humidifier import const as humidifier
|
|
||||||
from homeassistant.const import CLOUD_NEVER_EXPOSED_ENTITIES
|
from homeassistant.const import CLOUD_NEVER_EXPOSED_ENTITIES
|
||||||
from homeassistant.helpers import entity_registry as er
|
from homeassistant.helpers import entity_registry as er
|
||||||
from homeassistant.helpers.entity import EntityCategory
|
from homeassistant.helpers.entity import EntityCategory
|
||||||
|
|
|
@ -9,9 +9,11 @@ from homeassistant.components import (
|
||||||
binary_sensor,
|
binary_sensor,
|
||||||
button,
|
button,
|
||||||
camera,
|
camera,
|
||||||
|
climate,
|
||||||
cover,
|
cover,
|
||||||
fan,
|
fan,
|
||||||
group,
|
group,
|
||||||
|
humidifier,
|
||||||
input_boolean,
|
input_boolean,
|
||||||
input_button,
|
input_button,
|
||||||
input_select,
|
input_select,
|
||||||
|
@ -25,10 +27,8 @@ from homeassistant.components import (
|
||||||
switch,
|
switch,
|
||||||
vacuum,
|
vacuum,
|
||||||
)
|
)
|
||||||
from homeassistant.components.climate import const as climate
|
|
||||||
from homeassistant.components.google_assistant import const, error, helpers, trait
|
from homeassistant.components.google_assistant import const, error, helpers, trait
|
||||||
from homeassistant.components.google_assistant.error import SmartHomeError
|
from homeassistant.components.google_assistant.error import SmartHomeError
|
||||||
from homeassistant.components.humidifier import const as humidifier
|
|
||||||
from homeassistant.components.media_player.const import (
|
from homeassistant.components.media_player.const import (
|
||||||
MEDIA_TYPE_CHANNEL,
|
MEDIA_TYPE_CHANNEL,
|
||||||
SERVICE_PLAY_MEDIA,
|
SERVICE_PLAY_MEDIA,
|
||||||
|
@ -842,14 +842,14 @@ async def test_temperature_setting_climate_onoff(hass):
|
||||||
hass,
|
hass,
|
||||||
State(
|
State(
|
||||||
"climate.bla",
|
"climate.bla",
|
||||||
climate.HVAC_MODE_AUTO,
|
climate.HVACMode.AUTO,
|
||||||
{
|
{
|
||||||
ATTR_SUPPORTED_FEATURES: climate.SUPPORT_TARGET_TEMPERATURE_RANGE,
|
ATTR_SUPPORTED_FEATURES: climate.SUPPORT_TARGET_TEMPERATURE_RANGE,
|
||||||
climate.ATTR_HVAC_MODES: [
|
climate.ATTR_HVAC_MODES: [
|
||||||
climate.HVAC_MODE_OFF,
|
climate.HVACMode.OFF,
|
||||||
climate.HVAC_MODE_COOL,
|
climate.HVACMode.COOL,
|
||||||
climate.HVAC_MODE_HEAT,
|
climate.HVACMode.HEAT,
|
||||||
climate.HVAC_MODE_HEAT_COOL,
|
climate.HVACMode.HEAT_COOL,
|
||||||
],
|
],
|
||||||
climate.ATTR_MIN_TEMP: None,
|
climate.ATTR_MIN_TEMP: None,
|
||||||
climate.ATTR_MAX_TEMP: None,
|
climate.ATTR_MAX_TEMP: None,
|
||||||
|
@ -887,7 +887,7 @@ async def test_temperature_setting_climate_no_modes(hass):
|
||||||
hass,
|
hass,
|
||||||
State(
|
State(
|
||||||
"climate.bla",
|
"climate.bla",
|
||||||
climate.HVAC_MODE_AUTO,
|
climate.HVACMode.AUTO,
|
||||||
{
|
{
|
||||||
climate.ATTR_HVAC_MODES: [],
|
climate.ATTR_HVAC_MODES: [],
|
||||||
climate.ATTR_MIN_TEMP: None,
|
climate.ATTR_MIN_TEMP: None,
|
||||||
|
@ -913,16 +913,16 @@ async def test_temperature_setting_climate_range(hass):
|
||||||
hass,
|
hass,
|
||||||
State(
|
State(
|
||||||
"climate.bla",
|
"climate.bla",
|
||||||
climate.HVAC_MODE_AUTO,
|
climate.HVACMode.AUTO,
|
||||||
{
|
{
|
||||||
climate.ATTR_CURRENT_TEMPERATURE: 70,
|
climate.ATTR_CURRENT_TEMPERATURE: 70,
|
||||||
climate.ATTR_CURRENT_HUMIDITY: 25,
|
climate.ATTR_CURRENT_HUMIDITY: 25,
|
||||||
ATTR_SUPPORTED_FEATURES: climate.SUPPORT_TARGET_TEMPERATURE_RANGE,
|
ATTR_SUPPORTED_FEATURES: climate.SUPPORT_TARGET_TEMPERATURE_RANGE,
|
||||||
climate.ATTR_HVAC_MODES: [
|
climate.ATTR_HVAC_MODES: [
|
||||||
STATE_OFF,
|
STATE_OFF,
|
||||||
climate.HVAC_MODE_COOL,
|
climate.HVACMode.COOL,
|
||||||
climate.HVAC_MODE_HEAT,
|
climate.HVACMode.HEAT,
|
||||||
climate.HVAC_MODE_AUTO,
|
climate.HVACMode.AUTO,
|
||||||
],
|
],
|
||||||
climate.ATTR_TARGET_TEMP_HIGH: 75,
|
climate.ATTR_TARGET_TEMP_HIGH: 75,
|
||||||
climate.ATTR_TARGET_TEMP_LOW: 65,
|
climate.ATTR_TARGET_TEMP_LOW: 65,
|
||||||
|
@ -970,7 +970,7 @@ async def test_temperature_setting_climate_range(hass):
|
||||||
assert len(calls) == 1
|
assert len(calls) == 1
|
||||||
assert calls[0].data == {
|
assert calls[0].data == {
|
||||||
ATTR_ENTITY_ID: "climate.bla",
|
ATTR_ENTITY_ID: "climate.bla",
|
||||||
climate.ATTR_HVAC_MODE: climate.HVAC_MODE_COOL,
|
climate.ATTR_HVAC_MODE: climate.HVACMode.COOL,
|
||||||
}
|
}
|
||||||
|
|
||||||
with pytest.raises(helpers.SmartHomeError) as err:
|
with pytest.raises(helpers.SmartHomeError) as err:
|
||||||
|
@ -995,9 +995,9 @@ async def test_temperature_setting_climate_setpoint(hass):
|
||||||
hass,
|
hass,
|
||||||
State(
|
State(
|
||||||
"climate.bla",
|
"climate.bla",
|
||||||
climate.HVAC_MODE_COOL,
|
climate.HVACMode.COOL,
|
||||||
{
|
{
|
||||||
climate.ATTR_HVAC_MODES: [STATE_OFF, climate.HVAC_MODE_COOL],
|
climate.ATTR_HVAC_MODES: [STATE_OFF, climate.HVACMode.COOL],
|
||||||
climate.ATTR_MIN_TEMP: 10,
|
climate.ATTR_MIN_TEMP: 10,
|
||||||
climate.ATTR_MAX_TEMP: 30,
|
climate.ATTR_MAX_TEMP: 30,
|
||||||
ATTR_TEMPERATURE: 18,
|
ATTR_TEMPERATURE: 18,
|
||||||
|
@ -1050,11 +1050,11 @@ async def test_temperature_setting_climate_setpoint_auto(hass):
|
||||||
hass,
|
hass,
|
||||||
State(
|
State(
|
||||||
"climate.bla",
|
"climate.bla",
|
||||||
climate.HVAC_MODE_HEAT_COOL,
|
climate.HVACMode.HEAT_COOL,
|
||||||
{
|
{
|
||||||
climate.ATTR_HVAC_MODES: [
|
climate.ATTR_HVAC_MODES: [
|
||||||
climate.HVAC_MODE_OFF,
|
climate.HVACMode.OFF,
|
||||||
climate.HVAC_MODE_HEAT_COOL,
|
climate.HVACMode.HEAT_COOL,
|
||||||
],
|
],
|
||||||
climate.ATTR_MIN_TEMP: 10,
|
climate.ATTR_MIN_TEMP: 10,
|
||||||
climate.ATTR_MAX_TEMP: 30,
|
climate.ATTR_MAX_TEMP: 30,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue