Sort imports according to PEP8 for components starting with "B" (#29762)

This commit is contained in:
Bas Nijholt 2019-12-09 13:52:18 +01:00 committed by Franck Nijhof
parent df74272ba6
commit 73de69896b
23 changed files with 59 additions and 61 deletions

View file

@ -4,8 +4,8 @@ import logging
import voluptuous as vol
from homeassistant.components import bbb_gpio
from homeassistant.components.binary_sensor import BinarySensorDevice, PLATFORM_SCHEMA
from homeassistant.const import DEVICE_DEFAULT_NAME, CONF_NAME
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.const import CONF_NAME, DEVICE_DEFAULT_NAME
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__)

View file

@ -3,11 +3,11 @@ import logging
import voluptuous as vol
from homeassistant.components.switch import PLATFORM_SCHEMA
from homeassistant.components import bbb_gpio
from homeassistant.const import DEVICE_DEFAULT_NAME, CONF_NAME
from homeassistant.helpers.entity import ToggleEntity
from homeassistant.components.switch import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME, DEVICE_DEFAULT_NAME
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import ToggleEntity
_LOGGER = logging.getLogger(__name__)

View file

@ -5,7 +5,6 @@ import logging
from typing import List
import pybbox
import voluptuous as vol
from homeassistant.components.device_tracker import (

View file

@ -1,20 +1,19 @@
"""Support for Bbox Bouygues Modem Router."""
import logging
from datetime import timedelta
import logging
import requests
import pybbox
import requests
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_NAME,
CONF_MONITORED_VARIABLES,
ATTR_ATTRIBUTION,
CONF_MONITORED_VARIABLES,
CONF_NAME,
DEVICE_CLASS_TIMESTAMP,
)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
from homeassistant.util.dt import utcnow

View file

@ -5,15 +5,15 @@ from beewi_smartclim import BeewiSmartClimPoller
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
import homeassistant.helpers.config_validation as cv
from homeassistant.const import (
CONF_NAME,
CONF_MAC,
TEMP_CELSIUS,
CONF_NAME,
DEVICE_CLASS_BATTERY,
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_TEMPERATURE,
DEVICE_CLASS_BATTERY,
TEMP_CELSIUS,
)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__)

View file

@ -2,14 +2,13 @@
from functools import partial
import logging
import smbus # pylint: disable=import-error
from i2csense.bh1750 import BH1750 # pylint: disable=import-error
import smbus # pylint: disable=import-error
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
import homeassistant.helpers.config_validation as cv
from homeassistant.const import CONF_NAME, DEVICE_CLASS_ILLUMINANCE
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__)

View file

@ -2,15 +2,14 @@
import logging
import voluptuous as vol
from bizkaibus.bizkaibus import BizkaibusData
import homeassistant.helpers.config_validation as cv
import voluptuous as vol
from homeassistant.const import CONF_NAME
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__)
ATTR_DUE_IN = "Due in"

View file

@ -22,6 +22,7 @@ from homeassistant.const import (
STATE_ON,
)
import homeassistant.helpers.config_validation as cv
from .const import DOMAIN, SERVICE_SETALLZONES
_LOGGER = logging.getLogger(__name__)

View file

@ -4,16 +4,16 @@ import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
SUPPORT_BRIGHTNESS,
ATTR_HS_COLOR,
PLATFORM_SCHEMA,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
Light,
PLATFORM_SCHEMA,
)
from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv
import homeassistant.util.color as color_util
_LOGGER = logging.getLogger(__name__)

View file

@ -3,7 +3,7 @@ import logging
import voluptuous as vol
from homeassistant.components.binary_sensor import BinarySensorDevice, PLATFORM_SCHEMA
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.const import CONF_MONITORED_CONDITIONS
import homeassistant.helpers.config_validation as cv

View file

@ -4,9 +4,9 @@ import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import TEMP_FAHRENHEIT, TEMP_CELSIUS, CONF_MONITORED_CONDITIONS
from homeassistant.helpers.entity import Entity
from homeassistant.const import CONF_MONITORED_CONDITIONS, TEMP_CELSIUS, TEMP_FAHRENHEIT
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from . import BLOOMSKY

View file

@ -49,6 +49,7 @@ import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import async_track_time_interval
from homeassistant.util import Throttle
import homeassistant.util.dt as dt_util
from .const import (
DOMAIN,
SERVICE_CLEAR_TIMER,

View file

@ -4,18 +4,18 @@ import logging
import pygatt # pylint: disable=import-error
from homeassistant.helpers.event import track_point_in_utc_time
from homeassistant.components.device_tracker.const import (
CONF_SCAN_INTERVAL,
CONF_TRACK_NEW,
SCAN_INTERVAL,
SOURCE_TYPE_BLUETOOTH_LE,
)
from homeassistant.components.device_tracker.legacy import (
YAML_DEVICES,
async_load_config,
)
from homeassistant.components.device_tracker.const import (
CONF_TRACK_NEW,
CONF_SCAN_INTERVAL,
SCAN_INTERVAL,
SOURCE_TYPE_BLUETOOTH_LE,
)
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from homeassistant.helpers.event import track_point_in_utc_time
import homeassistant.util.dt as dt_util
_LOGGER = logging.getLogger(__name__)

View file

@ -1,7 +1,7 @@
"""Tracking for bluetooth devices."""
import asyncio
import logging
from typing import List, Set, Tuple, Optional
from typing import List, Optional, Set, Tuple
# pylint: disable=import-error
import bluetooth

View file

@ -3,14 +3,13 @@ from datetime import timedelta
from functools import partial
import logging
import smbus # pylint: disable=import-error
from i2csense.bme280 import BME280 # pylint: disable=import-error
import smbus # pylint: disable=import-error
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_MONITORED_CONDITIONS, CONF_NAME, TEMP_FAHRENHEIT
import homeassistant.helpers.config_validation as cv
from homeassistant.const import TEMP_FAHRENHEIT, CONF_NAME, CONF_MONITORED_CONDITIONS
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
from homeassistant.util.temperature import celsius_to_fahrenheit

View file

@ -3,8 +3,8 @@ import logging
import threading
from time import sleep, time
from smbus import SMBus # pylint: disable=import-error
import bme680 # pylint: disable=import-error
from smbus import SMBus # pylint: disable=import-error
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA

View file

@ -12,19 +12,19 @@ import zipfile
import requests
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
import homeassistant.util.dt as dt_util
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_MONITORED_CONDITIONS,
TEMP_CELSIUS,
CONF_NAME,
ATTR_ATTRIBUTION,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_MONITORED_CONDITIONS,
CONF_NAME,
TEMP_CELSIUS,
)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
import homeassistant.util.dt as dt_util
_RESOURCE = "http://www.bom.gov.au/fwo/{}/{}.{}.json"
_LOGGER = logging.getLogger(__name__)

View file

@ -5,7 +5,6 @@ import logging
import uuid
import brottsplatskartan
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA

View file

@ -1,5 +1,6 @@
"""Support for launching a web browser on the host machine."""
import webbrowser
import voluptuous as vol
ATTR_URL = "url"

View file

@ -2,16 +2,15 @@
import logging
import bthomehub5_devicelist
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.device_tracker import (
DOMAIN,
PLATFORM_SCHEMA,
DeviceScanner,
)
from homeassistant.const import CONF_HOST
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__)

View file

@ -1,8 +1,8 @@
"""The test for the bayesian sensor platform."""
import unittest
from homeassistant.setup import setup_component
from homeassistant.components.bayesian import binary_sensor as bayesian
from homeassistant.setup import setup_component
from tests.common import get_test_home_assistant

View file

@ -1,24 +1,25 @@
"""The tests for the Monoprice Blackbird media player platform."""
from collections import defaultdict
import unittest
from unittest import mock
import pytest
import voluptuous as vol
from collections import defaultdict
from homeassistant.components.media_player.const import (
SUPPORT_TURN_ON,
SUPPORT_TURN_OFF,
SUPPORT_SELECT_SOURCE,
)
from homeassistant.const import STATE_ON, STATE_OFF
import tests.common
from homeassistant.components.blackbird.const import DOMAIN, SERVICE_SETALLZONES
from homeassistant.components.blackbird.media_player import (
DATA_BLACKBIRD,
PLATFORM_SCHEMA,
setup_platform,
)
from homeassistant.components.blackbird.const import DOMAIN, SERVICE_SETALLZONES
import pytest
from homeassistant.components.media_player.const import (
SUPPORT_SELECT_SOURCE,
SUPPORT_TURN_OFF,
SUPPORT_TURN_ON,
)
from homeassistant.const import STATE_OFF, STATE_ON
import tests.common
class AttrDict(dict):

View file

@ -10,6 +10,7 @@ import requests
from homeassistant.components import sensor
from homeassistant.components.bom.sensor import BOMCurrentData
from homeassistant.setup import setup_component
from tests.common import assert_setup_component, get_test_home_assistant, load_fixture
VALID_CONFIG = {