mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Sort imports according to PEP8 for google_assistant (#29633)
* sort imports and fix flake8 issue for google * add isort:skip to EVENT_SYNC_RECEIVED
This commit is contained in:
parent
bc3b7ed06b
commit
7f948594eb
@ -29,10 +29,11 @@ from .const import (
|
||||
DOMAIN,
|
||||
SERVICE_REQUEST_SYNC,
|
||||
)
|
||||
from .const import EVENT_COMMAND_RECEIVED, EVENT_SYNC_RECEIVED # noqa: F401
|
||||
from .const import EVENT_QUERY_RECEIVED # noqa: F401
|
||||
from .http import GoogleAssistantView, GoogleConfig
|
||||
|
||||
from .const import EVENT_COMMAND_RECEIVED, EVENT_SYNC_RECEIVED # noqa: F401, isort:skip
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
ENTITY_SCHEMA = vol.Schema(
|
||||
|
@ -1,5 +1,6 @@
|
||||
"""Tests for the Google Assistant integration."""
|
||||
from asynctest.mock import MagicMock
|
||||
|
||||
from homeassistant.components.google_assistant import helpers
|
||||
|
||||
|
||||
|
@ -6,19 +6,19 @@ import json
|
||||
from aiohttp.hdrs import AUTHORIZATION
|
||||
import pytest
|
||||
|
||||
from homeassistant import core, const, setup
|
||||
from homeassistant import const, core, setup
|
||||
from homeassistant.components import (
|
||||
fan,
|
||||
alarm_control_panel,
|
||||
cover,
|
||||
fan,
|
||||
google_assistant as ga,
|
||||
light,
|
||||
switch,
|
||||
lock,
|
||||
media_player,
|
||||
alarm_control_panel,
|
||||
switch,
|
||||
)
|
||||
from homeassistant.components.climate import const as climate
|
||||
from homeassistant.const import CLOUD_NEVER_EXPOSED_ENTITIES
|
||||
from homeassistant.components import google_assistant as ga
|
||||
|
||||
from . import DEMO_DEVICES
|
||||
|
||||
|
@ -1,17 +1,22 @@
|
||||
"""Test Google Assistant helpers."""
|
||||
from asynctest.mock import Mock, patch, call
|
||||
from datetime import timedelta
|
||||
|
||||
from asynctest.mock import Mock, call, patch
|
||||
import pytest
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from homeassistant.components.google_assistant import helpers
|
||||
from homeassistant.components.google_assistant.const import EVENT_COMMAND_RECEIVED
|
||||
from homeassistant.components.google_assistant.const import ( # noqa: F401
|
||||
EVENT_COMMAND_RECEIVED,
|
||||
)
|
||||
from homeassistant.setup import async_setup_component
|
||||
from homeassistant.util import dt
|
||||
|
||||
from . import MockConfig
|
||||
|
||||
from tests.common import (
|
||||
async_capture_events,
|
||||
async_mock_service,
|
||||
async_fire_time_changed,
|
||||
async_mock_service,
|
||||
)
|
||||
|
||||
|
||||
|
@ -1,17 +1,18 @@
|
||||
"""Test Google http services."""
|
||||
from datetime import datetime, timezone, timedelta
|
||||
from asynctest import patch, ANY
|
||||
from datetime import datetime, timedelta, timezone
|
||||
|
||||
from asynctest import ANY, patch
|
||||
|
||||
from homeassistant.components.google_assistant import GOOGLE_ASSISTANT_SCHEMA
|
||||
from homeassistant.components.google_assistant.const import (
|
||||
HOMEGRAPH_TOKEN_URL,
|
||||
REPORT_STATE_BASE_URL,
|
||||
)
|
||||
from homeassistant.components.google_assistant.http import (
|
||||
GoogleConfig,
|
||||
_get_homegraph_jwt,
|
||||
_get_homegraph_token,
|
||||
)
|
||||
from homeassistant.components.google_assistant import GOOGLE_ASSISTANT_SCHEMA
|
||||
from homeassistant.components.google_assistant.const import (
|
||||
REPORT_STATE_BASE_URL,
|
||||
HOMEGRAPH_TOKEN_URL,
|
||||
)
|
||||
|
||||
DUMMY_CONFIG = GOOGLE_ASSISTANT_SCHEMA(
|
||||
{
|
||||
|
@ -1,9 +1,9 @@
|
||||
"""The tests for google-assistant init."""
|
||||
import asyncio
|
||||
|
||||
from homeassistant.components import google_assistant as ga
|
||||
from homeassistant.core import Context
|
||||
from homeassistant.setup import async_setup_component
|
||||
from homeassistant.components import google_assistant as ga
|
||||
|
||||
GA_API_KEY = "Agdgjsj399sdfkosd932ksd"
|
||||
|
||||
|
@ -1,13 +1,12 @@
|
||||
"""Test Google report state."""
|
||||
from unittest.mock import patch
|
||||
|
||||
from homeassistant.components.google_assistant import report_state, error
|
||||
from homeassistant.components.google_assistant import error, report_state
|
||||
from homeassistant.util.dt import utcnow
|
||||
|
||||
from . import BASIC_CONFIG
|
||||
|
||||
|
||||
from tests.common import mock_coro, async_fire_time_changed
|
||||
from tests.common import async_fire_time_changed, mock_coro
|
||||
|
||||
|
||||
async def test_report_state(hass, caplog):
|
||||
|
@ -1,40 +1,41 @@
|
||||
"""Test Google Smart Home."""
|
||||
from unittest.mock import patch, Mock
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant.core import State, EVENT_CALL_SERVICE
|
||||
from homeassistant.const import ATTR_UNIT_OF_MEASUREMENT, TEMP_CELSIUS, __version__
|
||||
from homeassistant.setup import async_setup_component
|
||||
from homeassistant.components import camera
|
||||
from homeassistant.components.climate.const import (
|
||||
ATTR_MIN_TEMP,
|
||||
ATTR_MAX_TEMP,
|
||||
ATTR_MIN_TEMP,
|
||||
HVAC_MODE_HEAT,
|
||||
)
|
||||
from homeassistant.components.google_assistant import (
|
||||
const,
|
||||
trait,
|
||||
smart_home as sh,
|
||||
EVENT_COMMAND_RECEIVED,
|
||||
EVENT_QUERY_RECEIVED,
|
||||
EVENT_SYNC_RECEIVED,
|
||||
)
|
||||
from homeassistant.components.demo.binary_sensor import DemoBinarySensor
|
||||
from homeassistant.components.demo.cover import DemoCover
|
||||
from homeassistant.components.demo.light import DemoLight
|
||||
from homeassistant.components.demo.media_player import AbstractDemoPlayer
|
||||
from homeassistant.components.demo.switch import DemoSwitch
|
||||
|
||||
from homeassistant.helpers import device_registry
|
||||
from tests.common import (
|
||||
mock_device_registry,
|
||||
mock_registry,
|
||||
mock_area_registry,
|
||||
mock_coro,
|
||||
from homeassistant.components.google_assistant import (
|
||||
EVENT_COMMAND_RECEIVED,
|
||||
EVENT_QUERY_RECEIVED,
|
||||
EVENT_SYNC_RECEIVED,
|
||||
const,
|
||||
smart_home as sh,
|
||||
trait,
|
||||
)
|
||||
from homeassistant.const import ATTR_UNIT_OF_MEASUREMENT, TEMP_CELSIUS, __version__
|
||||
from homeassistant.core import EVENT_CALL_SERVICE, State
|
||||
from homeassistant.helpers import device_registry
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from . import BASIC_CONFIG, MockConfig
|
||||
|
||||
from tests.common import (
|
||||
mock_area_registry,
|
||||
mock_coro,
|
||||
mock_device_registry,
|
||||
mock_registry,
|
||||
)
|
||||
|
||||
REQ_ID = "ff36a3cc-ec34-11e6-b1a0-64510650abcf"
|
||||
|
||||
|
||||
|
@ -1,13 +1,16 @@
|
||||
"""Tests for the Google Assistant traits."""
|
||||
from unittest.mock import patch, Mock
|
||||
import logging
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant.components import (
|
||||
alarm_control_panel,
|
||||
binary_sensor,
|
||||
camera,
|
||||
cover,
|
||||
fan,
|
||||
group,
|
||||
input_boolean,
|
||||
light,
|
||||
lock,
|
||||
@ -17,33 +20,33 @@ from homeassistant.components import (
|
||||
sensor,
|
||||
switch,
|
||||
vacuum,
|
||||
group,
|
||||
alarm_control_panel,
|
||||
)
|
||||
from homeassistant.components.climate import const as climate
|
||||
from homeassistant.components.google_assistant import trait, helpers, const, error
|
||||
from homeassistant.components.google_assistant import const, error, helpers, trait
|
||||
from homeassistant.const import (
|
||||
STATE_ON,
|
||||
STATE_OFF,
|
||||
ATTR_ASSUMED_STATE,
|
||||
ATTR_DEVICE_CLASS,
|
||||
ATTR_ENTITY_ID,
|
||||
ATTR_SUPPORTED_FEATURES,
|
||||
ATTR_TEMPERATURE,
|
||||
SERVICE_TURN_OFF,
|
||||
SERVICE_TURN_ON,
|
||||
STATE_ALARM_ARMED_AWAY,
|
||||
STATE_ALARM_DISARMED,
|
||||
STATE_ALARM_PENDING,
|
||||
ATTR_ENTITY_ID,
|
||||
SERVICE_TURN_ON,
|
||||
SERVICE_TURN_OFF,
|
||||
STATE_OFF,
|
||||
STATE_ON,
|
||||
STATE_UNKNOWN,
|
||||
TEMP_CELSIUS,
|
||||
TEMP_FAHRENHEIT,
|
||||
ATTR_SUPPORTED_FEATURES,
|
||||
ATTR_TEMPERATURE,
|
||||
ATTR_DEVICE_CLASS,
|
||||
ATTR_ASSUMED_STATE,
|
||||
STATE_UNKNOWN,
|
||||
)
|
||||
from homeassistant.core import State, DOMAIN as HA_DOMAIN, EVENT_CALL_SERVICE
|
||||
from homeassistant.core import DOMAIN as HA_DOMAIN, EVENT_CALL_SERVICE, State
|
||||
from homeassistant.util import color
|
||||
from tests.common import async_mock_service, mock_coro
|
||||
|
||||
from . import BASIC_CONFIG, MockConfig
|
||||
|
||||
from tests.common import async_mock_service, mock_coro
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
REQ_ID = "ff36a3cc-ec34-11e6-b1a0-64510650abcf"
|
||||
|
Loading…
x
Reference in New Issue
Block a user