Sort imports according to PEP8 for components starting with "G" (#29767)

This commit is contained in:
Bas Nijholt 2019-12-09 14:17:36 +01:00 committed by Franck Nijhof
parent ca0fad2cbb
commit d58e6e924a
22 changed files with 80 additions and 82 deletions

View file

@ -4,19 +4,19 @@ import logging
import requests
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.cover import CoverDevice, PLATFORM_SCHEMA
from homeassistant.helpers.event import track_utc_time_change
from homeassistant.components.cover import PLATFORM_SCHEMA, CoverDevice
from homeassistant.const import (
CONF_DEVICE,
CONF_USERNAME,
CONF_PASSWORD,
CONF_ACCESS_TOKEN,
CONF_COVERS,
CONF_DEVICE,
CONF_NAME,
CONF_PASSWORD,
CONF_USERNAME,
STATE_CLOSED,
STATE_OPEN,
CONF_COVERS,
)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import track_utc_time_change
_LOGGER = logging.getLogger(__name__)

View file

@ -1,15 +1,15 @@
"""Parse prices of a device from geizhals."""
import logging
from datetime import timedelta
import logging
from geizhals import Device, Geizhals
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
import homeassistant.helpers.config_validation as cv
from homeassistant.util import Throttle
from homeassistant.helpers.entity import Entity
from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
_LOGGER = logging.getLogger(__name__)

View file

@ -8,24 +8,24 @@ import requests
from requests.auth import HTTPDigestAuth
import voluptuous as vol
from homeassistant.const import (
CONF_NAME,
CONF_USERNAME,
CONF_PASSWORD,
CONF_AUTHENTICATION,
HTTP_BASIC_AUTHENTICATION,
HTTP_DIGEST_AUTHENTICATION,
CONF_VERIFY_SSL,
)
from homeassistant.exceptions import TemplateError
from homeassistant.components.camera import (
PLATFORM_SCHEMA,
DEFAULT_CONTENT_TYPE,
PLATFORM_SCHEMA,
SUPPORT_STREAM,
Camera,
)
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.const import (
CONF_AUTHENTICATION,
CONF_NAME,
CONF_PASSWORD,
CONF_USERNAME,
CONF_VERIFY_SSL,
HTTP_BASIC_AUTHENTICATION,
HTTP_DIGEST_AUTHENTICATION,
)
from homeassistant.exceptions import TemplateError
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.aiohttp_client import async_get_clientsession
_LOGGER = logging.getLogger(__name__)

View file

@ -15,9 +15,9 @@ from homeassistant.components.climate.const import (
HVAC_MODE_HEAT,
HVAC_MODE_OFF,
PRESET_AWAY,
PRESET_NONE,
SUPPORT_PRESET_MODE,
SUPPORT_TARGET_TEMPERATURE,
PRESET_NONE,
)
from homeassistant.const import (
ATTR_ENTITY_ID,

View file

@ -1,5 +1,5 @@
"""Support for Genius Hub switch/outlet devices."""
from homeassistant.components.switch import SwitchDevice, DEVICE_CLASS_OUTLET
from homeassistant.components.switch import DEVICE_CLASS_OUTLET, SwitchDevice
from homeassistant.helpers.typing import ConfigType, HomeAssistantType
from . import DOMAIN, GeniusZone

View file

@ -11,7 +11,6 @@ from homeassistant.helpers.config_validation import ( # noqa: F401
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.entity_component import EntityComponent
# mypy: allow-untyped-defs, no-check-untyped-defs
_LOGGER = logging.getLogger(__name__)

View file

@ -8,23 +8,23 @@ and grouped by category.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.geo_rss_events/
"""
import logging
from datetime import timedelta
import logging
import voluptuous as vol
from georss_client import UPDATE_OK, UPDATE_OK_NO_DATA
from georss_client.generic_feed import GenericFeed
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_UNIT_OF_MEASUREMENT,
CONF_NAME,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_NAME,
CONF_RADIUS,
CONF_UNIT_OF_MEASUREMENT,
CONF_URL,
)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__)

View file

@ -1,6 +1,7 @@
"""Support for GitHub."""
from datetime import timedelta
import logging
import github
import voluptuous as vol

View file

@ -1,23 +1,22 @@
"""Support for Google - Calendar Event Devices."""
from datetime import timedelta, datetime
from datetime import datetime, timedelta
import logging
import os
import yaml
from googleapiclient import discovery as google_discovery
import httplib2
from oauth2client.client import (
OAuth2WebServerFlow,
OAuth2DeviceCodeError,
FlowExchangeError,
OAuth2DeviceCodeError,
OAuth2WebServerFlow,
)
from oauth2client.file import Storage
from googleapiclient import discovery as google_discovery
import voluptuous as vol
from voluptuous.error import Error as VoluptuousError
import yaml
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers import discovery
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import generate_entity_id
from homeassistant.helpers.event import track_time_change
from homeassistant.util import convert, dt

View file

@ -1,11 +1,11 @@
"""Support for the Google Cloud TTS service."""
import asyncio
import logging
import os
import asyncio
import async_timeout
import voluptuous as vol
from google.cloud import texttospeech
import voluptuous as vol
from homeassistant.components.tts import CONF_LANG, PLATFORM_SCHEMA, Provider
import homeassistant.helpers.config_validation as cv

View file

@ -7,8 +7,8 @@ import aiohttp
import async_timeout
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.const import CONF_DOMAIN, CONF_PASSWORD, CONF_TIMEOUT, CONF_USERNAME
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__)

View file

@ -1,21 +1,20 @@
"""Support for retrieving status info from Google Wifi/OnHub routers."""
import logging
from datetime import timedelta
import logging
import voluptuous as vol
import requests
import voluptuous as vol
from homeassistant.util import dt
import homeassistant.helpers.config_validation as cv
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_NAME,
CONF_HOST,
CONF_MONITORED_CONDITIONS,
CONF_NAME,
STATE_UNKNOWN,
)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
from homeassistant.util import Throttle, dt
_LOGGER = logging.getLogger(__name__)

View file

@ -7,7 +7,6 @@ import time
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.const import (
CONF_HOST,
CONF_PORT,
@ -17,6 +16,7 @@ from homeassistant.const import (
EVENT_STATE_CHANGED,
)
from homeassistant.helpers import state
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__)

View file

@ -1,17 +1,17 @@
"""Read status of growatt inverters."""
import re
import datetime
import json
import logging
import datetime
import re
import growattServer
import voluptuous as vol
from homeassistant.util import Throttle
from homeassistant.helpers.entity import Entity
import homeassistant.helpers.config_validation as cv
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME, CONF_USERNAME, CONF_PASSWORD
from homeassistant.const import CONF_NAME, CONF_PASSWORD, CONF_USERNAME
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
_LOGGER = logging.getLogger(__name__)

View file

@ -1,6 +1,5 @@
"""The tests for generic camera component."""
import asyncio
from unittest import mock
from homeassistant.setup import async_setup_component

View file

@ -1,30 +1,31 @@
"""The tests for the geojson platform."""
from asynctest.mock import patch, MagicMock, call
from asynctest.mock import MagicMock, call, patch
from homeassistant.components import geo_location
from homeassistant.components.geo_location import ATTR_SOURCE
from homeassistant.components.geo_json_events.geo_location import (
SCAN_INTERVAL,
ATTR_EXTERNAL_ID,
SCAN_INTERVAL,
SIGNAL_DELETE_ENTITY,
SIGNAL_UPDATE_ENTITY,
)
from homeassistant.components.geo_location import ATTR_SOURCE
from homeassistant.const import (
CONF_URL,
EVENT_HOMEASSISTANT_START,
CONF_RADIUS,
ATTR_FRIENDLY_NAME,
ATTR_LATITUDE,
ATTR_LONGITUDE,
ATTR_FRIENDLY_NAME,
ATTR_UNIT_OF_MEASUREMENT,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_RADIUS,
CONF_URL,
EVENT_HOMEASSISTANT_START,
)
from homeassistant.helpers.dispatcher import DATA_DISPATCHER
from homeassistant.setup import async_setup_component
from tests.common import assert_setup_component, async_fire_time_changed
import homeassistant.util.dt as dt_util
from tests.common import assert_setup_component, async_fire_time_changed
URL = "http://geo.json.local/geo_json_events.json"
CONFIG = {
geo_location.DOMAIN: [

View file

@ -4,20 +4,21 @@ from unittest import mock
from unittest.mock import MagicMock, patch
from homeassistant.components import sensor
import homeassistant.components.geo_rss_events.sensor as geo_rss_events
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT,
ATTR_FRIENDLY_NAME,
EVENT_HOMEASSISTANT_START,
ATTR_ICON,
ATTR_UNIT_OF_MEASUREMENT,
EVENT_HOMEASSISTANT_START,
)
from homeassistant.setup import setup_component
import homeassistant.util.dt as dt_util
from tests.common import (
get_test_home_assistant,
assert_setup_component,
fire_time_changed,
get_test_home_assistant,
)
import homeassistant.components.geo_rss_events.sensor as geo_rss_events
import homeassistant.util.dt as dt_util
URL = "http://geo.rss.local/geo_rss_events.xml"
VALID_CONFIG_WITH_CATEGORIES = {

View file

@ -25,7 +25,6 @@ import homeassistant.util.dt as dt_util
from tests.common import async_mock_service
GOOGLE_CONFIG = {CONF_CLIENT_ID: "client_id", CONF_CLIENT_SECRET: "client_secret"}
TEST_ENTITY = "calendar.we_are_we_are_a_test_calendar"
TEST_ENTITY_NAME = "We are, we are, a... Test Calendar"

View file

@ -4,8 +4,8 @@ from datetime import timedelta
import pytest
from homeassistant.setup import async_setup_component
from homeassistant.components import google_domains
from homeassistant.setup import async_setup_component
from homeassistant.util.dt import utcnow
from tests.common import async_fire_time_changed

View file

@ -4,16 +4,15 @@ import os
import shutil
from unittest.mock import patch
import homeassistant.components.tts as tts
from homeassistant.components.media_player.const import (
SERVICE_PLAY_MEDIA,
ATTR_MEDIA_CONTENT_ID,
DOMAIN as DOMAIN_MP,
SERVICE_PLAY_MEDIA,
)
import homeassistant.components.tts as tts
from homeassistant.setup import setup_component
from tests.common import get_test_home_assistant, assert_setup_component, mock_service
from tests.common import assert_setup_component, get_test_home_assistant, mock_service
from tests.components.tts.test_init import mutagen_mock # noqa: F401

View file

@ -1,17 +1,17 @@
"""The tests for the Google Wifi platform."""
import unittest
from unittest.mock import patch, Mock
from datetime import datetime, timedelta
import unittest
from unittest.mock import Mock, patch
import requests_mock
from homeassistant import core as ha
from homeassistant.setup import setup_component
import homeassistant.components.google_wifi.sensor as google_wifi
from homeassistant.const import STATE_UNKNOWN
from homeassistant.setup import setup_component
from homeassistant.util import dt as dt_util
from tests.common import get_test_home_assistant, assert_setup_component
from tests.common import assert_setup_component, get_test_home_assistant
NAME = "foo"

View file

@ -4,16 +4,17 @@ import unittest
from unittest import mock
from unittest.mock import patch
from homeassistant.setup import setup_component
import homeassistant.core as ha
import homeassistant.components.graphite as graphite
from homeassistant.const import (
EVENT_STATE_CHANGED,
EVENT_HOMEASSISTANT_START,
EVENT_HOMEASSISTANT_STOP,
STATE_ON,
EVENT_STATE_CHANGED,
STATE_OFF,
STATE_ON,
)
import homeassistant.core as ha
from homeassistant.setup import setup_component
from tests.common import get_test_home_assistant