From dc880118a40f91be2172e6b07d2597b701555e90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 2 Mar 2021 10:02:04 +0200 Subject: [PATCH] Lint suppression cleanups (#47248) * Unused pylint suppression cleanups * Remove outdated pylint bug references * Add flake8-noqa config and note to run it every now and then * Add codes to noqa's * Unused noqa cleanups --- .pre-commit-config.yaml | 3 +++ homeassistant/auth/permissions/models.py | 3 +-- homeassistant/components/automation/__init__.py | 2 +- homeassistant/components/avion/light.py | 2 -- homeassistant/components/awair/config_flow.py | 2 +- homeassistant/components/bbb_gpio/__init__.py | 1 - homeassistant/components/bh1750/sensor.py | 2 +- homeassistant/components/blinkt/light.py | 1 - homeassistant/components/blueprint/__init__.py | 8 ++++---- .../bluetooth_le_tracker/device_tracker.py | 2 +- .../components/bluetooth_tracker/device_tracker.py | 3 +-- homeassistant/components/bme280/sensor.py | 2 +- homeassistant/components/bme680/sensor.py | 3 +-- homeassistant/components/braviatv/config_flow.py | 2 +- homeassistant/components/cert_expiry/helper.py | 3 +-- homeassistant/components/cmus/media_player.py | 1 - homeassistant/components/decora/light.py | 6 ++---- .../components/device_tracker/__init__.py | 14 ++++---------- .../components/environment_canada/camera.py | 2 +- .../components/environment_canada/sensor.py | 2 +- .../components/environment_canada/weather.py | 2 +- homeassistant/components/eq3btsmart/climate.py | 2 +- homeassistant/components/fan/__init__.py | 1 - homeassistant/components/flume/sensor.py | 2 +- homeassistant/components/foscam/config_flow.py | 3 +-- homeassistant/components/fritzbox/config_flow.py | 1 - homeassistant/components/gc100/__init__.py | 1 - homeassistant/components/geniushub/__init__.py | 1 - homeassistant/components/google/calendar.py | 2 +- homeassistant/components/google_pubsub/__init__.py | 4 +--- homeassistant/components/habitica/__init__.py | 2 +- homeassistant/components/hassio/config_flow.py | 2 +- homeassistant/components/hdmi_cec/__init__.py | 14 +++++--------- homeassistant/components/hdmi_cec/media_player.py | 8 ++------ .../components/here_travel_time/sensor.py | 3 --- homeassistant/components/homekit/__init__.py | 1 - homeassistant/components/homekit/config_flow.py | 2 +- homeassistant/components/htu21d/sensor.py | 2 +- .../components/hvv_departures/binary_sensor.py | 2 +- .../components/hvv_departures/config_flow.py | 7 +------ homeassistant/components/hyperion/config_flow.py | 1 - homeassistant/components/hyperion/light.py | 1 - homeassistant/components/hyperion/switch.py | 2 -- homeassistant/components/icloud/config_flow.py | 2 +- homeassistant/components/knx/const.py | 2 -- homeassistant/components/lcn/__init__.py | 2 +- homeassistant/components/lirc/__init__.py | 2 +- homeassistant/components/lovelace/__init__.py | 2 +- homeassistant/components/mcp23017/binary_sensor.py | 8 ++++---- homeassistant/components/mcp23017/switch.py | 8 ++++---- homeassistant/components/meteo_france/sensor.py | 1 - homeassistant/components/miflora/sensor.py | 2 +- homeassistant/components/mjpeg/camera.py | 2 -- homeassistant/components/mqtt/__init__.py | 4 ++-- homeassistant/components/mqtt/binary_sensor.py | 1 - homeassistant/components/mqtt/sensor.py | 1 - homeassistant/components/mullvad/binary_sensor.py | 2 +- homeassistant/components/mullvad/config_flow.py | 2 +- homeassistant/components/mysensors/config_flow.py | 2 -- homeassistant/components/neato/config_flow.py | 1 - homeassistant/components/noaa_tides/sensor.py | 2 +- homeassistant/components/omnilogic/config_flow.py | 2 +- homeassistant/components/onewire/config_flow.py | 2 +- homeassistant/components/owntracks/config_flow.py | 2 +- homeassistant/components/ozw/config_flow.py | 3 +-- .../components/pi4ioe5v9xxxx/binary_sensor.py | 2 +- homeassistant/components/pi4ioe5v9xxxx/switch.py | 2 +- homeassistant/components/plex/config_flow.py | 2 +- homeassistant/components/plex/server.py | 2 +- homeassistant/components/ps4/__init__.py | 2 +- homeassistant/components/rest/__init__.py | 2 +- homeassistant/components/rpi_rf/switch.py | 1 - .../components/sharkiq/update_coordinator.py | 2 +- homeassistant/components/sms/config_flow.py | 2 +- homeassistant/components/sms/gateway.py | 8 +++----- homeassistant/components/sms/notify.py | 8 ++++---- homeassistant/components/sms/sensor.py | 4 ++-- .../components/somfy_mylink/config_flow.py | 2 +- .../components/speedtestdotnet/config_flow.py | 2 +- homeassistant/components/switchbot/switch.py | 2 +- homeassistant/components/switchmate/switch.py | 2 +- homeassistant/components/syncthru/config_flow.py | 1 - homeassistant/components/tasmota/config_flow.py | 6 +----- .../components/tensorflow/image_processing.py | 3 +-- homeassistant/components/tuya/config_flow.py | 2 +- homeassistant/components/updater/__init__.py | 2 +- homeassistant/components/vera/config_flow.py | 6 +----- homeassistant/components/websocket_api/__init__.py | 10 +++++----- homeassistant/components/websocket_api/const.py | 2 +- homeassistant/components/xbox/media_source.py | 3 +-- .../components/xiaomi_miio/device_tracker.py | 2 +- homeassistant/components/xiaomi_miio/fan.py | 12 ++++++------ homeassistant/components/xiaomi_miio/light.py | 10 ++++++++-- homeassistant/components/xiaomi_miio/remote.py | 2 +- homeassistant/components/xiaomi_miio/sensor.py | 3 +-- homeassistant/components/xiaomi_miio/switch.py | 5 ++--- homeassistant/components/xiaomi_miio/vacuum.py | 2 +- homeassistant/components/zha/__init__.py | 2 +- .../components/zha/core/channels/__init__.py | 2 +- homeassistant/components/zha/core/store.py | 1 - homeassistant/components/zone/config_flow.py | 2 +- homeassistant/components/zwave/__init__.py | 2 -- homeassistant/components/zwave/node_entity.py | 1 - homeassistant/components/zwave_js/discovery.py | 1 - homeassistant/config_entries.py | 5 ++--- homeassistant/core.py | 1 - homeassistant/data_entry_flow.py | 3 +-- homeassistant/exceptions.py | 2 +- homeassistant/helpers/entity_platform.py | 2 +- homeassistant/helpers/entity_registry.py | 2 +- homeassistant/helpers/service.py | 2 +- homeassistant/helpers/sun.py | 2 +- homeassistant/helpers/template.py | 2 +- homeassistant/util/color.py | 3 ++- homeassistant/util/ssl.py | 4 ++-- setup.cfg | 1 + tests/common.py | 2 +- tests/components/abode/conftest.py | 2 +- .../alarm_control_panel/test_device_action.py | 2 +- .../alarm_control_panel/test_device_condition.py | 2 +- .../alarm_control_panel/test_device_trigger.py | 2 +- tests/components/arcam_fmj/test_device_trigger.py | 2 +- tests/components/automation/conftest.py | 2 +- tests/components/axis/conftest.py | 2 +- .../binary_sensor/test_device_condition.py | 2 +- .../binary_sensor/test_device_trigger.py | 2 +- tests/components/blebox/conftest.py | 2 +- tests/components/bond/conftest.py | 2 +- tests/components/climate/test_device_action.py | 2 +- tests/components/climate/test_device_condition.py | 2 +- tests/components/climate/test_device_trigger.py | 2 +- tests/components/config/test_automation.py | 2 +- tests/components/config/test_device_registry.py | 2 +- tests/components/cover/test_device_action.py | 2 +- tests/components/cover/test_device_condition.py | 2 +- tests/components/cover/test_device_trigger.py | 2 +- tests/components/deconz/conftest.py | 2 +- tests/components/deconz/test_device_trigger.py | 2 +- tests/components/default_config/test_init.py | 2 +- tests/components/demo/conftest.py | 2 +- tests/components/device_automation/test_init.py | 2 +- .../device_tracker/test_device_condition.py | 2 +- .../device_tracker/test_device_trigger.py | 2 +- tests/components/dynalite/conftest.py | 2 +- tests/components/elgato/conftest.py | 2 +- tests/components/everlights/conftest.py | 2 +- tests/components/fan/test_device_action.py | 2 +- tests/components/fan/test_device_condition.py | 2 +- tests/components/fan/test_device_trigger.py | 2 +- tests/components/geo_location/test_trigger.py | 2 +- tests/components/google_assistant/test_helpers.py | 2 +- tests/components/group/conftest.py | 2 +- tests/components/hassio/test_websocket_api.py | 2 +- .../components/homeassistant/triggers/conftest.py | 2 +- tests/components/homekit_controller/conftest.py | 2 +- .../homekit_controller/test_device_trigger.py | 2 +- tests/components/homematicip_cloud/conftest.py | 2 +- tests/components/hue/conftest.py | 2 +- tests/components/hue/test_device_trigger.py | 2 +- tests/components/humidifier/test_device_action.py | 2 +- .../components/humidifier/test_device_condition.py | 2 +- tests/components/humidifier/test_device_trigger.py | 2 +- tests/components/hyperion/conftest.py | 2 +- tests/components/kodi/test_device_trigger.py | 2 +- tests/components/light/test_device_action.py | 2 +- tests/components/light/test_device_condition.py | 2 +- tests/components/light/test_device_trigger.py | 2 +- tests/components/litejet/test_trigger.py | 2 +- tests/components/lock/test_device_action.py | 2 +- tests/components/lock/test_device_condition.py | 2 +- tests/components/lock/test_device_trigger.py | 2 +- .../media_player/test_device_condition.py | 2 +- .../components/media_player/test_device_trigger.py | 2 +- tests/components/mochad/conftest.py | 2 +- tests/components/mqtt/conftest.py | 2 +- tests/components/mqtt/test_device_trigger.py | 2 +- tests/components/mqtt/test_trigger.py | 2 +- tests/components/number/test_device_action.py | 2 +- tests/components/ozw/conftest.py | 2 +- tests/components/philips_js/test_device_trigger.py | 2 +- tests/components/remote/test_device_action.py | 2 +- tests/components/remote/test_device_condition.py | 2 +- tests/components/remote/test_device_trigger.py | 2 +- tests/components/rflink/conftest.py | 2 +- tests/components/rfxtrx/conftest.py | 2 +- tests/components/ring/conftest.py | 2 +- tests/components/search/test_init.py | 2 +- tests/components/sensor/test_device_condition.py | 2 +- tests/components/sensor/test_device_trigger.py | 2 +- tests/components/smartthings/conftest.py | 2 +- tests/components/sun/test_trigger.py | 2 +- tests/components/switch/conftest.py | 2 +- tests/components/switch/test_device_action.py | 2 +- tests/components/switch/test_device_condition.py | 2 +- tests/components/switch/test_device_trigger.py | 2 +- tests/components/tag/test_trigger.py | 2 +- tests/components/tasmota/conftest.py | 2 +- tests/components/tasmota/test_device_trigger.py | 2 +- tests/components/template/conftest.py | 2 +- tests/components/template/test_trigger.py | 2 +- tests/components/tplink/conftest.py | 2 +- tests/components/tradfri/conftest.py | 2 +- tests/components/vacuum/test_device_action.py | 2 +- tests/components/vacuum/test_device_condition.py | 2 +- tests/components/vacuum/test_device_trigger.py | 2 +- tests/components/vera/conftest.py | 2 +- .../components/water_heater/test_device_action.py | 2 +- tests/components/webhook/test_trigger.py | 2 +- tests/components/wilight/conftest.py | 2 +- tests/components/wled/conftest.py | 2 +- tests/components/yeelight/conftest.py | 2 +- tests/components/zerproc/conftest.py | 2 +- tests/components/zha/conftest.py | 2 +- tests/components/zha/test_device_action.py | 2 +- tests/components/zha/test_device_trigger.py | 2 +- tests/components/zone/test_trigger.py | 2 +- tests/components/zwave/conftest.py | 2 +- 217 files changed, 237 insertions(+), 306 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6b650ebac79..8e2fb5cb3b3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,6 +28,9 @@ repos: - id: flake8 additional_dependencies: - flake8-docstrings==1.5.0 + # Temporarily every now and then for noqa cleanup; not done by + # default yet due to https://github.com/plinss/flake8-noqa/issues/1 + # - flake8-noqa==1.1.0 - pydocstyle==5.1.1 files: ^(homeassistant|script|tests)/.+\.py$ - repo: https://github.com/PyCQA/bandit diff --git a/homeassistant/auth/permissions/models.py b/homeassistant/auth/permissions/models.py index 2542be14cc6..b2d1955865a 100644 --- a/homeassistant/auth/permissions/models.py +++ b/homeassistant/auth/permissions/models.py @@ -4,8 +4,7 @@ from typing import TYPE_CHECKING import attr if TYPE_CHECKING: - # pylint: disable=unused-import - from homeassistant.helpers import ( # noqa: F401 + from homeassistant.helpers import ( device_registry as dev_reg, entity_registry as ent_reg, ) diff --git a/homeassistant/components/automation/__init__.py b/homeassistant/components/automation/__init__.py index 7f006d929b1..1b1a927d147 100644 --- a/homeassistant/components/automation/__init__.py +++ b/homeassistant/components/automation/__init__.py @@ -59,7 +59,7 @@ from homeassistant.loader import bind_hass from homeassistant.util.dt import parse_datetime # Not used except by packages to check config structure -from .config import PLATFORM_SCHEMA # noqa +from .config import PLATFORM_SCHEMA # noqa: F401 from .config import async_validate_config_item from .const import ( CONF_ACTION, diff --git a/homeassistant/components/avion/light.py b/homeassistant/components/avion/light.py index 0af2f15b34e..0d242b952dd 100644 --- a/homeassistant/components/avion/light.py +++ b/homeassistant/components/avion/light.py @@ -41,7 +41,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( def setup_platform(hass, config, add_entities, discovery_info=None): """Set up an Avion switch.""" - # pylint: disable=no-member avion = importlib.import_module("avion") lights = [] @@ -111,7 +110,6 @@ class AvionLight(LightEntity): def set_state(self, brightness): """Set the state of this lamp to the provided brightness.""" - # pylint: disable=no-member avion = importlib.import_module("avion") # Bluetooth LE is unreliable, and the connection may drop at any diff --git a/homeassistant/components/awair/config_flow.py b/homeassistant/components/awair/config_flow.py index a4768014f96..c28ac55f216 100644 --- a/homeassistant/components/awair/config_flow.py +++ b/homeassistant/components/awair/config_flow.py @@ -10,7 +10,7 @@ from homeassistant.config_entries import CONN_CLASS_CLOUD_POLL, ConfigFlow from homeassistant.const import CONF_ACCESS_TOKEN from homeassistant.helpers.aiohttp_client import async_get_clientsession -from .const import DOMAIN, LOGGER # pylint: disable=unused-import +from .const import DOMAIN, LOGGER class AwairFlowHandler(ConfigFlow, domain=DOMAIN): diff --git a/homeassistant/components/bbb_gpio/__init__.py b/homeassistant/components/bbb_gpio/__init__.py index 61d98c7413e..f7d146e073e 100644 --- a/homeassistant/components/bbb_gpio/__init__.py +++ b/homeassistant/components/bbb_gpio/__init__.py @@ -8,7 +8,6 @@ DOMAIN = "bbb_gpio" def setup(hass, config): """Set up the BeagleBone Black GPIO component.""" - # pylint: disable=import-error def cleanup_gpio(event): """Stuff to do before stopping.""" diff --git a/homeassistant/components/bh1750/sensor.py b/homeassistant/components/bh1750/sensor.py index 7680b8b09ad..eb9bbc2dccc 100644 --- a/homeassistant/components/bh1750/sensor.py +++ b/homeassistant/components/bh1750/sensor.py @@ -3,7 +3,7 @@ from functools import partial import logging from i2csense.bh1750 import BH1750 # pylint: disable=import-error -import smbus # pylint: disable=import-error +import smbus import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA diff --git a/homeassistant/components/blinkt/light.py b/homeassistant/components/blinkt/light.py index 0d1aff7b826..bb9bbf315e4 100644 --- a/homeassistant/components/blinkt/light.py +++ b/homeassistant/components/blinkt/light.py @@ -26,7 +26,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Blinkt Light platform.""" - # pylint: disable=no-member blinkt = importlib.import_module("blinkt") # ensure that the lights are off when exiting diff --git a/homeassistant/components/blueprint/__init__.py b/homeassistant/components/blueprint/__init__.py index 9e8b1260eff..309365710ad 100644 --- a/homeassistant/components/blueprint/__init__.py +++ b/homeassistant/components/blueprint/__init__.py @@ -1,7 +1,7 @@ """The blueprint integration.""" from . import websocket_api -from .const import DOMAIN # noqa -from .errors import ( # noqa +from .const import DOMAIN # noqa: F401 +from .errors import ( # noqa: F401 BlueprintException, BlueprintWithNameException, FailedToLoad, @@ -9,8 +9,8 @@ from .errors import ( # noqa InvalidBlueprintInputs, MissingInput, ) -from .models import Blueprint, BlueprintInputs, DomainBlueprints # noqa -from .schemas import is_blueprint_instance_config # noqa +from .models import Blueprint, BlueprintInputs, DomainBlueprints # noqa: F401 +from .schemas import is_blueprint_instance_config # noqa: F401 async def async_setup(hass, config): diff --git a/homeassistant/components/bluetooth_le_tracker/device_tracker.py b/homeassistant/components/bluetooth_le_tracker/device_tracker.py index 76df4e65ac7..9ac79afde2c 100644 --- a/homeassistant/components/bluetooth_le_tracker/device_tracker.py +++ b/homeassistant/components/bluetooth_le_tracker/device_tracker.py @@ -4,7 +4,7 @@ from datetime import datetime, timedelta import logging from uuid import UUID -import pygatt # pylint: disable=import-error +import pygatt import voluptuous as vol from homeassistant.components.device_tracker import PLATFORM_SCHEMA diff --git a/homeassistant/components/bluetooth_tracker/device_tracker.py b/homeassistant/components/bluetooth_tracker/device_tracker.py index 380d8091bd6..9bc2e630ba0 100644 --- a/homeassistant/components/bluetooth_tracker/device_tracker.py +++ b/homeassistant/components/bluetooth_tracker/device_tracker.py @@ -3,8 +3,7 @@ import asyncio import logging from typing import List, Optional, Set, Tuple -# pylint: disable=import-error -import bluetooth +import bluetooth # pylint: disable=import-error from bt_proximity import BluetoothRSSI import voluptuous as vol diff --git a/homeassistant/components/bme280/sensor.py b/homeassistant/components/bme280/sensor.py index 265ec01b6db..d3d97881035 100644 --- a/homeassistant/components/bme280/sensor.py +++ b/homeassistant/components/bme280/sensor.py @@ -4,7 +4,7 @@ from functools import partial import logging from i2csense.bme280 import BME280 # pylint: disable=import-error -import smbus # pylint: disable=import-error +import smbus import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA diff --git a/homeassistant/components/bme680/sensor.py b/homeassistant/components/bme680/sensor.py index 49d95bbc53b..6af9d46c0bc 100644 --- a/homeassistant/components/bme680/sensor.py +++ b/homeassistant/components/bme680/sensor.py @@ -4,7 +4,7 @@ import threading from time import monotonic, sleep import bme680 # pylint: disable=import-error -from smbus import SMBus # pylint: disable=import-error +from smbus import SMBus import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA @@ -131,7 +131,6 @@ def _setup_bme680(config): sensor_handler = None sensor = None try: - # pylint: disable=no-member i2c_address = config[CONF_I2C_ADDRESS] bus = SMBus(config[CONF_I2C_BUS]) sensor = bme680.BME680(i2c_address, bus) diff --git a/homeassistant/components/braviatv/config_flow.py b/homeassistant/components/braviatv/config_flow.py index d8831dd1494..1ac31972f33 100644 --- a/homeassistant/components/braviatv/config_flow.py +++ b/homeassistant/components/braviatv/config_flow.py @@ -12,7 +12,7 @@ from homeassistant.const import CONF_HOST, CONF_MAC, CONF_PIN from homeassistant.core import callback import homeassistant.helpers.config_validation as cv -from .const import ( # pylint:disable=unused-import +from .const import ( ATTR_CID, ATTR_MAC, ATTR_MODEL, diff --git a/homeassistant/components/cert_expiry/helper.py b/homeassistant/components/cert_expiry/helper.py index 6c49e9e26b9..c00a99c8e86 100644 --- a/homeassistant/components/cert_expiry/helper.py +++ b/homeassistant/components/cert_expiry/helper.py @@ -19,8 +19,7 @@ def get_cert(host, port): address = (host, port) with socket.create_connection(address, timeout=TIMEOUT) as sock: with ctx.wrap_socket(sock, server_hostname=address[0]) as ssock: - # pylint disable: https://github.com/PyCQA/pylint/issues/3166 - cert = ssock.getpeercert() # pylint: disable=no-member + cert = ssock.getpeercert() return cert diff --git a/homeassistant/components/cmus/media_player.py b/homeassistant/components/cmus/media_player.py index 49c10ab92a5..3968ebbe9d7 100644 --- a/homeassistant/components/cmus/media_player.py +++ b/homeassistant/components/cmus/media_player.py @@ -98,7 +98,6 @@ class CmusRemote: class CmusDevice(MediaPlayerEntity): """Representation of a running cmus.""" - # pylint: disable=no-member def __init__(self, device, name, server): """Initialize the CMUS device.""" diff --git a/homeassistant/components/decora/light.py b/homeassistant/components/decora/light.py index 2fc436eda20..96126bfcc98 100644 --- a/homeassistant/components/decora/light.py +++ b/homeassistant/components/decora/light.py @@ -4,10 +4,8 @@ from functools import wraps import logging import time -from bluepy.btle import ( # pylint: disable=import-error, no-member, no-name-in-module - BTLEException, -) -import decora # pylint: disable=import-error, no-member +from bluepy.btle import BTLEException # pylint: disable=import-error +import decora # pylint: disable=import-error import voluptuous as vol from homeassistant.components.light import ( diff --git a/homeassistant/components/device_tracker/__init__.py b/homeassistant/components/device_tracker/__init__.py index d785ee826e8..688213bbcb3 100644 --- a/homeassistant/components/device_tracker/__init__.py +++ b/homeassistant/components/device_tracker/__init__.py @@ -1,16 +1,10 @@ """Provide functionality to keep track of devices.""" -from homeassistant.const import ( # noqa: F401 pylint: disable=unused-import - ATTR_GPS_ACCURACY, - STATE_HOME, -) +from homeassistant.const import ATTR_GPS_ACCURACY, STATE_HOME # noqa: F401 from homeassistant.helpers.typing import ConfigType, HomeAssistantType from homeassistant.loader import bind_hass -from .config_entry import ( # noqa: F401 pylint: disable=unused-import - async_setup_entry, - async_unload_entry, -) -from .const import ( # noqa: F401 pylint: disable=unused-import +from .config_entry import async_setup_entry, async_unload_entry # noqa: F401 +from .const import ( # noqa: F401 ATTR_ATTRIBUTES, ATTR_BATTERY, ATTR_DEV_ID, @@ -29,7 +23,7 @@ from .const import ( # noqa: F401 pylint: disable=unused-import SOURCE_TYPE_GPS, SOURCE_TYPE_ROUTER, ) -from .legacy import ( # noqa: F401 pylint: disable=unused-import +from .legacy import ( # noqa: F401 PLATFORM_SCHEMA, PLATFORM_SCHEMA_BASE, SERVICE_SEE, diff --git a/homeassistant/components/environment_canada/camera.py b/homeassistant/components/environment_canada/camera.py index 66079ac73ff..7021d637cfd 100644 --- a/homeassistant/components/environment_canada/camera.py +++ b/homeassistant/components/environment_canada/camera.py @@ -1,7 +1,7 @@ """Support for the Environment Canada radar imagery.""" import datetime -from env_canada import ECRadar # pylint: disable=import-error +from env_canada import ECRadar import voluptuous as vol from homeassistant.components.camera import PLATFORM_SCHEMA, Camera diff --git a/homeassistant/components/environment_canada/sensor.py b/homeassistant/components/environment_canada/sensor.py index a8772909f68..20eb6fac9ee 100644 --- a/homeassistant/components/environment_canada/sensor.py +++ b/homeassistant/components/environment_canada/sensor.py @@ -3,7 +3,7 @@ from datetime import datetime, timedelta import logging import re -from env_canada import ECData # pylint: disable=import-error +from env_canada import ECData import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA diff --git a/homeassistant/components/environment_canada/weather.py b/homeassistant/components/environment_canada/weather.py index dd2252a585f..9abbc33bc93 100644 --- a/homeassistant/components/environment_canada/weather.py +++ b/homeassistant/components/environment_canada/weather.py @@ -2,7 +2,7 @@ import datetime import re -from env_canada import ECData # pylint: disable=import-error +from env_canada import ECData import voluptuous as vol from homeassistant.components.weather import ( diff --git a/homeassistant/components/eq3btsmart/climate.py b/homeassistant/components/eq3btsmart/climate.py index 737b3fe357a..43c6bd9f35b 100644 --- a/homeassistant/components/eq3btsmart/climate.py +++ b/homeassistant/components/eq3btsmart/climate.py @@ -1,7 +1,7 @@ """Support for eQ-3 Bluetooth Smart thermostats.""" import logging -from bluepy.btle import BTLEException # pylint: disable=import-error, no-name-in-module +from bluepy.btle import BTLEException # pylint: disable=import-error import eq3bt as eq3 # pylint: disable=import-error import voluptuous as vol diff --git a/homeassistant/components/fan/__init__.py b/homeassistant/components/fan/__init__.py index 18f46b3d619..25911eb2d06 100644 --- a/homeassistant/components/fan/__init__.py +++ b/homeassistant/components/fan/__init__.py @@ -344,7 +344,6 @@ class FanEntity(ToggleEntity): """Turn on the fan.""" raise NotImplementedError() - # pylint: disable=arguments-differ async def async_turn_on_compat( self, speed: Optional[str] = None, diff --git a/homeassistant/components/flume/sensor.py b/homeassistant/components/flume/sensor.py index 6b19c9c5476..65584239910 100644 --- a/homeassistant/components/flume/sensor.py +++ b/homeassistant/components/flume/sensor.py @@ -175,7 +175,7 @@ def _create_flume_device_coordinator(hass, flume_device): _LOGGER.debug("Updating Flume data") try: await hass.async_add_executor_job(flume_device.update_force) - except Exception as ex: # pylint: disable=broad-except + except Exception as ex: raise UpdateFailed(f"Error communicating with flume API: {ex}") from ex _LOGGER.debug( "Flume update details: %s", diff --git a/homeassistant/components/foscam/config_flow.py b/homeassistant/components/foscam/config_flow.py index bfeefb9e406..bfd13c730f8 100644 --- a/homeassistant/components/foscam/config_flow.py +++ b/homeassistant/components/foscam/config_flow.py @@ -17,8 +17,7 @@ from homeassistant.const import ( ) from homeassistant.data_entry_flow import AbortFlow -from .const import CONF_RTSP_PORT, CONF_STREAM, LOGGER -from .const import DOMAIN # pylint:disable=unused-import +from .const import CONF_RTSP_PORT, CONF_STREAM, DOMAIN, LOGGER STREAMS = ["Main", "Sub"] diff --git a/homeassistant/components/fritzbox/config_flow.py b/homeassistant/components/fritzbox/config_flow.py index 904081ef99f..a462f885484 100644 --- a/homeassistant/components/fritzbox/config_flow.py +++ b/homeassistant/components/fritzbox/config_flow.py @@ -13,7 +13,6 @@ from homeassistant.components.ssdp import ( ) from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME -# pylint:disable=unused-import from .const import DEFAULT_HOST, DEFAULT_USERNAME, DOMAIN DATA_SCHEMA_USER = vol.Schema( diff --git a/homeassistant/components/gc100/__init__.py b/homeassistant/components/gc100/__init__.py index 77380afc2b5..51abd9d5693 100644 --- a/homeassistant/components/gc100/__init__.py +++ b/homeassistant/components/gc100/__init__.py @@ -25,7 +25,6 @@ CONFIG_SCHEMA = vol.Schema( ) -# pylint: disable=no-member def setup(hass, base_config): """Set up the gc100 component.""" config = base_config[DOMAIN] diff --git a/homeassistant/components/geniushub/__init__.py b/homeassistant/components/geniushub/__init__.py index 909de81521c..def964157e4 100644 --- a/homeassistant/components/geniushub/__init__.py +++ b/homeassistant/components/geniushub/__init__.py @@ -173,7 +173,6 @@ class GeniusBroker: @property def hub_uid(self) -> int: """Return the Hub UID (MAC address).""" - # pylint: disable=no-member return self._hub_uid if self._hub_uid is not None else self.client.uid async def async_update(self, now, **kwargs) -> None: diff --git a/homeassistant/components/google/calendar.py b/homeassistant/components/google/calendar.py index 2fcde78354b..9040d37935d 100644 --- a/homeassistant/components/google/calendar.py +++ b/homeassistant/components/google/calendar.py @@ -3,7 +3,7 @@ import copy from datetime import timedelta import logging -from httplib2 import ServerNotFoundError # pylint: disable=import-error +from httplib2 import ServerNotFoundError from homeassistant.components.calendar import ( ENTITY_ID_FORMAT, diff --git a/homeassistant/components/google_pubsub/__init__.py b/homeassistant/components/google_pubsub/__init__.py index 8d7a675860c..c832c87318c 100644 --- a/homeassistant/components/google_pubsub/__init__.py +++ b/homeassistant/components/google_pubsub/__init__.py @@ -57,9 +57,7 @@ def setup(hass: HomeAssistant, yaml_config: Dict[str, Any]): service_principal_path ) - topic_path = publisher.topic_path( # pylint: disable=no-member - project_id, topic_name - ) + topic_path = publisher.topic_path(project_id, topic_name) encoder = DateTimeJSONEncoder() diff --git a/homeassistant/components/habitica/__init__.py b/homeassistant/components/habitica/__init__.py index 64680a56bb3..c70d374dfe9 100644 --- a/homeassistant/components/habitica/__init__.py +++ b/homeassistant/components/habitica/__init__.py @@ -46,7 +46,7 @@ INSTANCE_SCHEMA = vol.All( ), ) -has_unique_values = vol.Schema(vol.Unique()) # pylint: disable=invalid-name +has_unique_values = vol.Schema(vol.Unique()) # because we want a handy alias diff --git a/homeassistant/components/hassio/config_flow.py b/homeassistant/components/hassio/config_flow.py index 56c7d324a61..8b2c68d752d 100644 --- a/homeassistant/components/hassio/config_flow.py +++ b/homeassistant/components/hassio/config_flow.py @@ -3,7 +3,7 @@ import logging from homeassistant import config_entries -from . import DOMAIN # pylint:disable=unused-import +from . import DOMAIN _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/hdmi_cec/__init__.py b/homeassistant/components/hdmi_cec/__init__.py index c272ad19c8d..c9a5d27a3be 100644 --- a/homeassistant/components/hdmi_cec/__init__.py +++ b/homeassistant/components/hdmi_cec/__init__.py @@ -4,13 +4,9 @@ from functools import reduce import logging import multiprocessing -from pycec.cec import CecAdapter # pylint: disable=import-error -from pycec.commands import ( # pylint: disable=import-error - CecCommand, - KeyPressCommand, - KeyReleaseCommand, -) -from pycec.const import ( # pylint: disable=import-error +from pycec.cec import CecAdapter +from pycec.commands import CecCommand, KeyPressCommand, KeyReleaseCommand +from pycec.const import ( ADDR_AUDIOSYSTEM, ADDR_BROADCAST, ADDR_UNREGISTERED, @@ -25,8 +21,8 @@ from pycec.const import ( # pylint: disable=import-error STATUS_STILL, STATUS_STOP, ) -from pycec.network import HDMINetwork, PhysicalAddress # pylint: disable=import-error -from pycec.tcp import TcpAdapter # pylint: disable=import-error +from pycec.network import HDMINetwork, PhysicalAddress +from pycec.tcp import TcpAdapter import voluptuous as vol from homeassistant.components.media_player import DOMAIN as MEDIA_PLAYER diff --git a/homeassistant/components/hdmi_cec/media_player.py b/homeassistant/components/hdmi_cec/media_player.py index f81ee20afe3..c3cab6a8f98 100644 --- a/homeassistant/components/hdmi_cec/media_player.py +++ b/homeassistant/components/hdmi_cec/media_player.py @@ -1,12 +1,8 @@ """Support for HDMI CEC devices as media players.""" import logging -from pycec.commands import ( # pylint: disable=import-error - CecCommand, - KeyPressCommand, - KeyReleaseCommand, -) -from pycec.const import ( # pylint: disable=import-error +from pycec.commands import CecCommand, KeyPressCommand, KeyReleaseCommand +from pycec.const import ( KEY_BACKWARD, KEY_FORWARD, KEY_MUTE_TOGGLE, diff --git a/homeassistant/components/here_travel_time/sensor.py b/homeassistant/components/here_travel_time/sensor.py index e51e7a067fc..e9506fceed5 100644 --- a/homeassistant/components/here_travel_time/sensor.py +++ b/homeassistant/components/here_travel_time/sensor.py @@ -457,11 +457,9 @@ class HERETravelTimeData: _LOGGER.debug("Raw response is: %s", response.response) - # pylint: disable=no-member source_attribution = response.response.get("sourceAttribution") if source_attribution is not None: self.attribution = self._build_hass_attribution(source_attribution) - # pylint: disable=no-member route = response.response["route"] summary = route[0]["summary"] waypoint = route[0]["waypoint"] @@ -477,7 +475,6 @@ class HERETravelTimeData: else: # Convert to kilometers self.distance = distance / 1000 - # pylint: disable=no-member self.route = response.route_short self.origin_name = waypoint[0]["mappedRoadName"] self.destination_name = waypoint[1]["mappedRoadName"] diff --git a/homeassistant/components/homekit/__init__.py b/homeassistant/components/homekit/__init__.py index c042872f4cd..0dfe7336bcf 100644 --- a/homeassistant/components/homekit/__init__.py +++ b/homeassistant/components/homekit/__init__.py @@ -42,7 +42,6 @@ from homeassistant.helpers.reload import async_integration_yaml_config from homeassistant.loader import IntegrationNotFound, async_get_integration from homeassistant.util import get_local_ip -# pylint: disable=unused-import from . import ( # noqa: F401 type_cameras, type_covers, diff --git a/homeassistant/components/homekit/config_flow.py b/homeassistant/components/homekit/config_flow.py index c21c27fba83..2eabdd98e79 100644 --- a/homeassistant/components/homekit/config_flow.py +++ b/homeassistant/components/homekit/config_flow.py @@ -36,13 +36,13 @@ from .const import ( DEFAULT_AUTO_START, DEFAULT_CONFIG_FLOW_PORT, DEFAULT_HOMEKIT_MODE, + DOMAIN, HOMEKIT_MODE_ACCESSORY, HOMEKIT_MODE_BRIDGE, HOMEKIT_MODES, SHORT_BRIDGE_NAME, VIDEO_CODEC_COPY, ) -from .const import DOMAIN # pylint:disable=unused-import from .util import async_find_next_available_port, state_needs_accessory_mode CONF_CAMERA_COPY = "camera_copy" diff --git a/homeassistant/components/htu21d/sensor.py b/homeassistant/components/htu21d/sensor.py index a9b235faa0b..615177ed6af 100644 --- a/homeassistant/components/htu21d/sensor.py +++ b/homeassistant/components/htu21d/sensor.py @@ -4,7 +4,7 @@ from functools import partial import logging from i2csense.htu21d import HTU21D # pylint: disable=import-error -import smbus # pylint: disable=import-error +import smbus import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA diff --git a/homeassistant/components/hvv_departures/binary_sensor.py b/homeassistant/components/hvv_departures/binary_sensor.py index 7d19fcc8fdf..f625ef7c344 100644 --- a/homeassistant/components/hvv_departures/binary_sensor.py +++ b/homeassistant/components/hvv_departures/binary_sensor.py @@ -92,7 +92,7 @@ async def async_setup_entry(hass, entry, async_add_entities): raise UpdateFailed(f"Authentication failed: {err}") from err except ClientConnectorError as err: raise UpdateFailed(f"Network not available: {err}") from err - except Exception as err: # pylint: disable=broad-except + except Exception as err: raise UpdateFailed(f"Error occurred while fetching data: {err}") from err coordinator = DataUpdateCoordinator( diff --git a/homeassistant/components/hvv_departures/config_flow.py b/homeassistant/components/hvv_departures/config_flow.py index 1a49bffd2f5..556505101eb 100644 --- a/homeassistant/components/hvv_departures/config_flow.py +++ b/homeassistant/components/hvv_departures/config_flow.py @@ -11,12 +11,7 @@ from homeassistant.core import callback from homeassistant.helpers import aiohttp_client import homeassistant.helpers.config_validation as cv -from .const import ( # pylint:disable=unused-import - CONF_FILTER, - CONF_REAL_TIME, - CONF_STATION, - DOMAIN, -) +from .const import CONF_FILTER, CONF_REAL_TIME, CONF_STATION, DOMAIN from .hub import GTIHub _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/hyperion/config_flow.py b/homeassistant/components/hyperion/config_flow.py index 642bc0e93fd..8d02028dc38 100644 --- a/homeassistant/components/hyperion/config_flow.py +++ b/homeassistant/components/hyperion/config_flow.py @@ -221,7 +221,6 @@ class HyperionConfigFlow(ConfigFlow, domain=DOMAIN): return self.async_abort(reason="cannot_connect") return await self._advance_to_auth_step_if_necessary(hyperion_client) - # pylint: disable=arguments-differ async def async_step_user( self, user_input: Optional[ConfigType] = None, diff --git a/homeassistant/components/hyperion/light.py b/homeassistant/components/hyperion/light.py index c49a65b2bfd..838b69cd52b 100644 --- a/homeassistant/components/hyperion/light.py +++ b/homeassistant/components/hyperion/light.py @@ -553,7 +553,6 @@ class HyperionPriorityLight(HyperionBaseLight): return True return False - # pylint: disable=no-self-use def _allow_priority_update(self, priority: Optional[Dict[str, Any]] = None) -> bool: """Determine whether to allow a Hyperion priority to update entity attributes.""" # Black is treated as 'off' (and Home Assistant does not support selecting black diff --git a/homeassistant/components/hyperion/switch.py b/homeassistant/components/hyperion/switch.py index 0412018650a..e2da80e5093 100644 --- a/homeassistant/components/hyperion/switch.py +++ b/homeassistant/components/hyperion/switch.py @@ -178,12 +178,10 @@ class HyperionComponentSwitch(SwitchEntity): } ) - # pylint: disable=unused-argument async def async_turn_on(self, **kwargs: Any) -> None: """Turn on the switch.""" await self._async_send_set_component(True) - # pylint: disable=unused-argument async def async_turn_off(self, **kwargs: Any) -> None: """Turn off the switch.""" await self._async_send_set_component(False) diff --git a/homeassistant/components/icloud/config_flow.py b/homeassistant/components/icloud/config_flow.py index c79024c4f64..28570f3d93c 100644 --- a/homeassistant/components/icloud/config_flow.py +++ b/homeassistant/components/icloud/config_flow.py @@ -21,10 +21,10 @@ from .const import ( DEFAULT_GPS_ACCURACY_THRESHOLD, DEFAULT_MAX_INTERVAL, DEFAULT_WITH_FAMILY, + DOMAIN, STORAGE_KEY, STORAGE_VERSION, ) -from .const import DOMAIN # pylint: disable=unused-import CONF_TRUSTED_DEVICE = "trusted_device" CONF_VERIFICATION_CODE = "verification_code" diff --git a/homeassistant/components/knx/const.py b/homeassistant/components/knx/const.py index 268f766bfc2..dfe357ef33c 100644 --- a/homeassistant/components/knx/const.py +++ b/homeassistant/components/knx/const.py @@ -29,7 +29,6 @@ ATTR_COUNTER = "counter" class ColorTempModes(Enum): - # pylint: disable=invalid-name """Color temperature modes for config validation.""" ABSOLUTE = "DPT-7.600" @@ -37,7 +36,6 @@ class ColorTempModes(Enum): class SupportedPlatforms(Enum): - # pylint: disable=invalid-name """Supported platforms.""" BINARY_SENSOR = "binary_sensor" diff --git a/homeassistant/components/lcn/__init__.py b/homeassistant/components/lcn/__init__.py index cc1e47d71fc..fe9195584ea 100644 --- a/homeassistant/components/lcn/__init__.py +++ b/homeassistant/components/lcn/__init__.py @@ -27,7 +27,7 @@ from .const import ( DATA_LCN, DOMAIN, ) -from .schemas import CONFIG_SCHEMA # noqa: 401 +from .schemas import CONFIG_SCHEMA # noqa: F401 from .services import ( DynText, Led, diff --git a/homeassistant/components/lirc/__init__.py b/homeassistant/components/lirc/__init__.py index bf939fb7535..b52cf3cf107 100644 --- a/homeassistant/components/lirc/__init__.py +++ b/homeassistant/components/lirc/__init__.py @@ -1,5 +1,5 @@ """Support for LIRC devices.""" -# pylint: disable=no-member, import-error +# pylint: disable=import-error import logging import threading import time diff --git a/homeassistant/components/lovelace/__init__.py b/homeassistant/components/lovelace/__init__.py index e673b2a470b..45011239f16 100644 --- a/homeassistant/components/lovelace/__init__.py +++ b/homeassistant/components/lovelace/__init__.py @@ -34,7 +34,7 @@ from .const import ( STORAGE_DASHBOARD_UPDATE_FIELDS, url_slug, ) -from .system_health import system_health_info # NOQA +from .system_health import system_health_info # noqa: F401 _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/mcp23017/binary_sensor.py b/homeassistant/components/mcp23017/binary_sensor.py index f6dafad43ac..c650393a26f 100644 --- a/homeassistant/components/mcp23017/binary_sensor.py +++ b/homeassistant/components/mcp23017/binary_sensor.py @@ -1,8 +1,8 @@ """Support for binary sensor using I2C MCP23017 chip.""" -from adafruit_mcp230xx.mcp23017 import MCP23017 # pylint: disable=import-error -import board # pylint: disable=import-error -import busio # pylint: disable=import-error -import digitalio # pylint: disable=import-error +from adafruit_mcp230xx.mcp23017 import MCP23017 +import board +import busio +import digitalio import voluptuous as vol from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity diff --git a/homeassistant/components/mcp23017/switch.py b/homeassistant/components/mcp23017/switch.py index d22593a4c3e..6b1ced540ae 100644 --- a/homeassistant/components/mcp23017/switch.py +++ b/homeassistant/components/mcp23017/switch.py @@ -1,8 +1,8 @@ """Support for switch sensor using I2C MCP23017 chip.""" -from adafruit_mcp230xx.mcp23017 import MCP23017 # pylint: disable=import-error -import board # pylint: disable=import-error -import busio # pylint: disable=import-error -import digitalio # pylint: disable=import-error +from adafruit_mcp230xx.mcp23017 import MCP23017 +import board +import busio +import digitalio import voluptuous as vol from homeassistant.components.switch import PLATFORM_SCHEMA diff --git a/homeassistant/components/meteo_france/sensor.py b/homeassistant/components/meteo_france/sensor.py index 201cca7ae9d..4802c20c1e5 100644 --- a/homeassistant/components/meteo_france/sensor.py +++ b/homeassistant/components/meteo_france/sensor.py @@ -193,7 +193,6 @@ class MeteoFranceRainSensor(MeteoFranceSensor): class MeteoFranceAlertSensor(MeteoFranceSensor): """Representation of a Meteo-France alert sensor.""" - # pylint: disable=super-init-not-called def __init__(self, sensor_type: str, coordinator: DataUpdateCoordinator): """Initialize the Meteo-France sensor.""" super().__init__(sensor_type, coordinator) diff --git a/homeassistant/components/miflora/sensor.py b/homeassistant/components/miflora/sensor.py index 6583f5f7e0c..fa1d8b57734 100644 --- a/homeassistant/components/miflora/sensor.py +++ b/homeassistant/components/miflora/sensor.py @@ -5,7 +5,7 @@ import logging import btlewrap from btlewrap import BluetoothBackendException -from miflora import miflora_poller # pylint: disable=import-error +from miflora import miflora_poller import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA diff --git a/homeassistant/components/mjpeg/camera.py b/homeassistant/components/mjpeg/camera.py index 1a8b1327093..15f7f5c80bf 100644 --- a/homeassistant/components/mjpeg/camera.py +++ b/homeassistant/components/mjpeg/camera.py @@ -144,8 +144,6 @@ class MjpegCamera(Camera): else: req = requests.get(self._mjpeg_url, stream=True, timeout=10) - # https://github.com/PyCQA/pylint/issues/1437 - # pylint: disable=no-member with closing(req) as response: return extract_image_from_mjpeg(response.iter_content(102400)) diff --git a/homeassistant/components/mqtt/__init__.py b/homeassistant/components/mqtt/__init__.py index 29f7e24da00..503083b0067 100644 --- a/homeassistant/components/mqtt/__init__.py +++ b/homeassistant/components/mqtt/__init__.py @@ -668,7 +668,7 @@ class MQTT: will_message = None if will_message is not None: - self._mqttc.will_set( # pylint: disable=no-value-for-parameter + self._mqttc.will_set( topic=will_message.topic, payload=will_message.payload, qos=will_message.qos, @@ -833,7 +833,7 @@ class MQTT: async def publish_birth_message(birth_message): await self._ha_started.wait() # Wait for Home Assistant to start await self._discovery_cooldown() # Wait for MQTT discovery to cool down - await self.async_publish( # pylint: disable=no-value-for-parameter + await self.async_publish( topic=birth_message.topic, payload=birth_message.payload, qos=birth_message.qos, diff --git a/homeassistant/components/mqtt/binary_sensor.py b/homeassistant/components/mqtt/binary_sensor.py index b9fb297cd5c..a1f13e7873e 100644 --- a/homeassistant/components/mqtt/binary_sensor.py +++ b/homeassistant/components/mqtt/binary_sensor.py @@ -242,7 +242,6 @@ class MqttBinarySensor(MqttEntity, BinarySensorEntity): def available(self) -> bool: """Return true if the device is available and value has not expired.""" expire_after = self._config.get(CONF_EXPIRE_AFTER) - # pylint: disable=no-member return MqttAvailability.available.fget(self) and ( expire_after is None or not self._expired ) diff --git a/homeassistant/components/mqtt/sensor.py b/homeassistant/components/mqtt/sensor.py index d017cb2ce85..cb263febe13 100644 --- a/homeassistant/components/mqtt/sensor.py +++ b/homeassistant/components/mqtt/sensor.py @@ -197,7 +197,6 @@ class MqttSensor(MqttEntity, Entity): def available(self) -> bool: """Return true if the device is available and value has not expired.""" expire_after = self._config.get(CONF_EXPIRE_AFTER) - # pylint: disable=no-member return MqttAvailability.available.fget(self) and ( expire_after is None or not self._expired ) diff --git a/homeassistant/components/mullvad/binary_sensor.py b/homeassistant/components/mullvad/binary_sensor.py index f85820cd7d0..1a91bba2038 100644 --- a/homeassistant/components/mullvad/binary_sensor.py +++ b/homeassistant/components/mullvad/binary_sensor.py @@ -29,7 +29,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities): class MullvadBinarySensor(CoordinatorEntity, BinarySensorEntity): """Represents a Mullvad binary sensor.""" - def __init__(self, coordinator, sensor): # pylint: disable=super-init-not-called + def __init__(self, coordinator, sensor): """Initialize the Mullvad binary sensor.""" super().__init__(coordinator) self.id = sensor[CONF_ID] diff --git a/homeassistant/components/mullvad/config_flow.py b/homeassistant/components/mullvad/config_flow.py index 674308c1d1a..50f67d10e25 100644 --- a/homeassistant/components/mullvad/config_flow.py +++ b/homeassistant/components/mullvad/config_flow.py @@ -5,7 +5,7 @@ from mullvad_api import MullvadAPI, MullvadAPIError from homeassistant import config_entries -from .const import DOMAIN # pylint:disable=unused-import +from .const import DOMAIN _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/mysensors/config_flow.py b/homeassistant/components/mysensors/config_flow.py index d2cd7f3bccd..7bf30e4cab5 100644 --- a/homeassistant/components/mysensors/config_flow.py +++ b/homeassistant/components/mysensors/config_flow.py @@ -23,8 +23,6 @@ from homeassistant.core import callback import homeassistant.helpers.config_validation as cv from . import CONF_RETAIN, CONF_VERSION, DEFAULT_VERSION - -# pylint: disable=unused-import from .const import ( CONF_BAUD_RATE, CONF_GATEWAY_TYPE, diff --git a/homeassistant/components/neato/config_flow.py b/homeassistant/components/neato/config_flow.py index 1f2f575ae50..5f7487fe5cc 100644 --- a/homeassistant/components/neato/config_flow.py +++ b/homeassistant/components/neato/config_flow.py @@ -8,7 +8,6 @@ from homeassistant import config_entries from homeassistant.const import CONF_TOKEN from homeassistant.helpers import config_entry_oauth2_flow -# pylint: disable=unused-import from .const import NEATO_DOMAIN diff --git a/homeassistant/components/noaa_tides/sensor.py b/homeassistant/components/noaa_tides/sensor.py index a0453e3acb1..0759c5093c8 100644 --- a/homeassistant/components/noaa_tides/sensor.py +++ b/homeassistant/components/noaa_tides/sensor.py @@ -2,7 +2,7 @@ from datetime import datetime, timedelta import logging -import noaa_coops as coops # pylint: disable=import-error +import noaa_coops as coops import requests import voluptuous as vol diff --git a/homeassistant/components/omnilogic/config_flow.py b/homeassistant/components/omnilogic/config_flow.py index 641ec5a8d94..f8dffaeda44 100644 --- a/homeassistant/components/omnilogic/config_flow.py +++ b/homeassistant/components/omnilogic/config_flow.py @@ -9,7 +9,7 @@ from homeassistant.const import CONF_PASSWORD, CONF_USERNAME from homeassistant.core import callback from homeassistant.helpers import aiohttp_client -from .const import CONF_SCAN_INTERVAL, DOMAIN # pylint:disable=unused-import +from .const import CONF_SCAN_INTERVAL, DOMAIN _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/onewire/config_flow.py b/homeassistant/components/onewire/config_flow.py index 9ad4d5347f0..fbb1d5debef 100644 --- a/homeassistant/components/onewire/config_flow.py +++ b/homeassistant/components/onewire/config_flow.py @@ -5,7 +5,7 @@ from homeassistant.config_entries import CONN_CLASS_LOCAL_POLL, ConfigFlow from homeassistant.const import CONF_HOST, CONF_PORT, CONF_TYPE from homeassistant.helpers.typing import HomeAssistantType -from .const import ( # pylint: disable=unused-import +from .const import ( CONF_MOUNT_DIR, CONF_TYPE_OWFS, CONF_TYPE_OWSERVER, diff --git a/homeassistant/components/owntracks/config_flow.py b/homeassistant/components/owntracks/config_flow.py index f0838b510ec..2e588ff933a 100644 --- a/homeassistant/components/owntracks/config_flow.py +++ b/homeassistant/components/owntracks/config_flow.py @@ -4,7 +4,7 @@ import secrets from homeassistant import config_entries from homeassistant.const import CONF_WEBHOOK_ID -from .const import DOMAIN # noqa pylint: disable=unused-import +from .const import DOMAIN # pylint: disable=unused-import from .helper import supports_encryption CONF_SECRET = "secret" diff --git a/homeassistant/components/ozw/config_flow.py b/homeassistant/components/ozw/config_flow.py index 00917c0609c..2546a2e0aff 100644 --- a/homeassistant/components/ozw/config_flow.py +++ b/homeassistant/components/ozw/config_flow.py @@ -7,8 +7,7 @@ from homeassistant import config_entries from homeassistant.core import callback from homeassistant.data_entry_flow import AbortFlow -from .const import CONF_INTEGRATION_CREATED_ADDON, CONF_USE_ADDON -from .const import DOMAIN # pylint:disable=unused-import +from .const import CONF_INTEGRATION_CREATED_ADDON, CONF_USE_ADDON, DOMAIN _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/pi4ioe5v9xxxx/binary_sensor.py b/homeassistant/components/pi4ioe5v9xxxx/binary_sensor.py index 61cedb8f063..bdec7714eef 100644 --- a/homeassistant/components/pi4ioe5v9xxxx/binary_sensor.py +++ b/homeassistant/components/pi4ioe5v9xxxx/binary_sensor.py @@ -1,5 +1,5 @@ """Support for binary sensor using RPi GPIO.""" -from pi4ioe5v9xxxx import pi4ioe5v9xxxx # pylint: disable=import-error +from pi4ioe5v9xxxx import pi4ioe5v9xxxx import voluptuous as vol from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity diff --git a/homeassistant/components/pi4ioe5v9xxxx/switch.py b/homeassistant/components/pi4ioe5v9xxxx/switch.py index 81de76c086c..85bde509070 100644 --- a/homeassistant/components/pi4ioe5v9xxxx/switch.py +++ b/homeassistant/components/pi4ioe5v9xxxx/switch.py @@ -1,5 +1,5 @@ """Allows to configure a switch using RPi GPIO.""" -from pi4ioe5v9xxxx import pi4ioe5v9xxxx # pylint: disable=import-error +from pi4ioe5v9xxxx import pi4ioe5v9xxxx import voluptuous as vol from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity diff --git a/homeassistant/components/plex/config_flow.py b/homeassistant/components/plex/config_flow.py index d611c09c43e..d1fa5684cf5 100644 --- a/homeassistant/components/plex/config_flow.py +++ b/homeassistant/components/plex/config_flow.py @@ -27,7 +27,7 @@ from homeassistant.helpers.aiohttp_client import async_get_clientsession import homeassistant.helpers.config_validation as cv from homeassistant.helpers.network import get_url -from .const import ( # pylint: disable=unused-import +from .const import ( AUTH_CALLBACK_NAME, AUTH_CALLBACK_PATH, AUTOMATIC_SETUP_STRING, diff --git a/homeassistant/components/plex/server.py b/homeassistant/components/plex/server.py index 8f9d4d1cc51..c8d383867cf 100644 --- a/homeassistant/components/plex/server.py +++ b/homeassistant/components/plex/server.py @@ -189,7 +189,7 @@ class PlexServer: _connect_with_url() except requests.exceptions.SSLError as error: while error and not isinstance(error, ssl.SSLCertVerificationError): - error = error.__context__ # pylint: disable=no-member + error = error.__context__ if isinstance(error, ssl.SSLCertVerificationError): domain = urlparse(self._url).netloc.split(":")[0] if domain.endswith("plex.direct") and error.args[0].startswith( diff --git a/homeassistant/components/ps4/__init__.py b/homeassistant/components/ps4/__init__.py index 390637c26a3..11d271be543 100644 --- a/homeassistant/components/ps4/__init__.py +++ b/homeassistant/components/ps4/__init__.py @@ -25,7 +25,7 @@ from homeassistant.helpers.typing import HomeAssistantType from homeassistant.util import location from homeassistant.util.json import load_json, save_json -from .config_flow import PlayStation4FlowHandler # noqa: pylint: disable=unused-import +from .config_flow import PlayStation4FlowHandler # noqa: F401 from .const import ATTR_MEDIA_IMAGE_URL, COMMANDS, DOMAIN, GAMES_FILE, PS4_DATA _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/rest/__init__.py b/homeassistant/components/rest/__init__.py index ebeddcfd7c7..233a12f44c8 100644 --- a/homeassistant/components/rest/__init__.py +++ b/homeassistant/components/rest/__init__.py @@ -35,7 +35,7 @@ from homeassistant.helpers.update_coordinator import DataUpdateCoordinator from .const import COORDINATOR, DOMAIN, PLATFORM_IDX, REST, REST_IDX from .data import RestData -from .schema import CONFIG_SCHEMA # noqa:F401 pylint: disable=unused-import +from .schema import CONFIG_SCHEMA # noqa: F401 _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/rpi_rf/switch.py b/homeassistant/components/rpi_rf/switch.py index 4ac7283b194..a374300a264 100644 --- a/homeassistant/components/rpi_rf/switch.py +++ b/homeassistant/components/rpi_rf/switch.py @@ -45,7 +45,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( ) -# pylint: disable=no-member def setup_platform(hass, config, add_entities, discovery_info=None): """Find and return switches controlled by a generic RF device via GPIO.""" rpi_rf = importlib.import_module("rpi_rf") diff --git a/homeassistant/components/sharkiq/update_coordinator.py b/homeassistant/components/sharkiq/update_coordinator.py index eff18064dcc..8675058de86 100644 --- a/homeassistant/components/sharkiq/update_coordinator.py +++ b/homeassistant/components/sharkiq/update_coordinator.py @@ -99,7 +99,7 @@ class SharkIqUpdateCoordinator(DataUpdateCoordinator): _LOGGER.debug("Matching flow found") raise UpdateFailed(err) from err - except Exception as err: # pylint: disable=broad-except + except Exception as err: _LOGGER.exception("Unexpected error updating SharkIQ") raise UpdateFailed(err) from err diff --git a/homeassistant/components/sms/config_flow.py b/homeassistant/components/sms/config_flow.py index 01c1d182c93..da5db672959 100644 --- a/homeassistant/components/sms/config_flow.py +++ b/homeassistant/components/sms/config_flow.py @@ -1,7 +1,7 @@ """Config flow for SMS integration.""" import logging -import gammu # pylint: disable=import-error, no-member +import gammu # pylint: disable=import-error import voluptuous as vol from homeassistant import config_entries, core, exceptions diff --git a/homeassistant/components/sms/gateway.py b/homeassistant/components/sms/gateway.py index 9bdfbad0f55..e28b3947e37 100644 --- a/homeassistant/components/sms/gateway.py +++ b/homeassistant/components/sms/gateway.py @@ -1,10 +1,8 @@ """The sms gateway to interact with a GSM modem.""" import logging -import gammu # pylint: disable=import-error, no-member -from gammu.asyncworker import ( # pylint: disable=import-error, no-member - GammuAsyncWorker, -) +import gammu # pylint: disable=import-error +from gammu.asyncworker import GammuAsyncWorker # pylint: disable=import-error from homeassistant.core import callback @@ -165,6 +163,6 @@ async def create_sms_gateway(config, hass): gateway = Gateway(worker, hass) await gateway.init_async() return gateway - except gammu.GSMError as exc: # pylint: disable=no-member + except gammu.GSMError as exc: _LOGGER.error("Failed to initialize, error %s", exc) return None diff --git a/homeassistant/components/sms/notify.py b/homeassistant/components/sms/notify.py index f030409b6ca..04964c15878 100644 --- a/homeassistant/components/sms/notify.py +++ b/homeassistant/components/sms/notify.py @@ -1,7 +1,7 @@ """Support for SMS notification services.""" import logging -import gammu # pylint: disable=import-error, no-member +import gammu # pylint: disable=import-error import voluptuous as vol from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationService @@ -51,8 +51,8 @@ class SMSNotificationService(BaseNotificationService): } try: # Encode messages - encoded = gammu.EncodeSMS(smsinfo) # pylint: disable=no-member - except gammu.GSMError as exc: # pylint: disable=no-member + encoded = gammu.EncodeSMS(smsinfo) + except gammu.GSMError as exc: _LOGGER.error("Encoding message %s failed: %s", message, exc) return @@ -64,5 +64,5 @@ class SMSNotificationService(BaseNotificationService): try: # Actually send the message await self.gateway.send_sms_async(encoded_message) - except gammu.GSMError as exc: # pylint: disable=no-member + except gammu.GSMError as exc: _LOGGER.error("Sending to %s failed: %s", self.number, exc) diff --git a/homeassistant/components/sms/sensor.py b/homeassistant/components/sms/sensor.py index eaad395eaa6..e775b4a0e05 100644 --- a/homeassistant/components/sms/sensor.py +++ b/homeassistant/components/sms/sensor.py @@ -1,7 +1,7 @@ """Support for SMS dongle sensor.""" import logging -import gammu # pylint: disable=import-error, no-member +import gammu # pylint: disable=import-error from homeassistant.const import DEVICE_CLASS_SIGNAL_STRENGTH, SIGNAL_STRENGTH_DECIBELS from homeassistant.helpers.entity import Entity @@ -71,7 +71,7 @@ class GSMSignalSensor(Entity): """Get the latest data from the modem.""" try: self._state = await self._gateway.get_signal_quality_async() - except gammu.GSMError as exc: # pylint: disable=no-member + except gammu.GSMError as exc: _LOGGER.error("Failed to read signal quality: %s", exc) @property diff --git a/homeassistant/components/somfy_mylink/config_flow.py b/homeassistant/components/somfy_mylink/config_flow.py index b6d647b9a3b..d1a1e19609a 100644 --- a/homeassistant/components/somfy_mylink/config_flow.py +++ b/homeassistant/components/somfy_mylink/config_flow.py @@ -19,9 +19,9 @@ from .const import ( CONF_TARGET_ID, CONF_TARGET_NAME, DEFAULT_PORT, + DOMAIN, MYLINK_STATUS, ) -from .const import DOMAIN # pylint:disable=unused-import _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/speedtestdotnet/config_flow.py b/homeassistant/components/speedtestdotnet/config_flow.py index 5ff405b59a8..84d63ebc33b 100644 --- a/homeassistant/components/speedtestdotnet/config_flow.py +++ b/homeassistant/components/speedtestdotnet/config_flow.py @@ -13,8 +13,8 @@ from .const import ( DEFAULT_NAME, DEFAULT_SCAN_INTERVAL, DEFAULT_SERVER, + DOMAIN, ) -from .const import DOMAIN # pylint: disable=unused-import class SpeedTestFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): diff --git a/homeassistant/components/switchbot/switch.py b/homeassistant/components/switchbot/switch.py index 3dd931abe49..89ba7b5be5e 100644 --- a/homeassistant/components/switchbot/switch.py +++ b/homeassistant/components/switchbot/switch.py @@ -1,7 +1,7 @@ """Support for Switchbot.""" from typing import Any, Dict -# pylint: disable=import-error, no-member +# pylint: disable=import-error import switchbot import voluptuous as vol diff --git a/homeassistant/components/switchmate/switch.py b/homeassistant/components/switchmate/switch.py index a052b9051a1..24b54537dc8 100644 --- a/homeassistant/components/switchmate/switch.py +++ b/homeassistant/components/switchmate/switch.py @@ -1,7 +1,7 @@ """Support for Switchmate.""" from datetime import timedelta -# pylint: disable=import-error, no-member +# pylint: disable=import-error import switchmate import voluptuous as vol diff --git a/homeassistant/components/syncthru/config_flow.py b/homeassistant/components/syncthru/config_flow.py index 83f044d8ebc..2c6eb65e4ce 100644 --- a/homeassistant/components/syncthru/config_flow.py +++ b/homeassistant/components/syncthru/config_flow.py @@ -62,7 +62,6 @@ class SyncThruConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): # Remove trailing " (ip)" if present for consistency with user driven config self.name = re.sub(r"\s+\([\d.]+\)\s*$", "", self.name) - # https://github.com/PyCQA/pylint/issues/3167 self.context["title_placeholders"] = {CONF_NAME: self.name} return await self.async_step_confirm() diff --git a/homeassistant/components/tasmota/config_flow.py b/homeassistant/components/tasmota/config_flow.py index 5d39fa02438..320b4ff2448 100644 --- a/homeassistant/components/tasmota/config_flow.py +++ b/homeassistant/components/tasmota/config_flow.py @@ -4,11 +4,7 @@ import voluptuous as vol from homeassistant import config_entries from homeassistant.components.mqtt import valid_subscribe_topic -from .const import ( # pylint:disable=unused-import - CONF_DISCOVERY_PREFIX, - DEFAULT_PREFIX, - DOMAIN, -) +from .const import CONF_DISCOVERY_PREFIX, DEFAULT_PREFIX, DOMAIN class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN): diff --git a/homeassistant/components/tensorflow/image_processing.py b/homeassistant/components/tensorflow/image_processing.py index e387ae97afe..65240dc04dc 100644 --- a/homeassistant/components/tensorflow/image_processing.py +++ b/homeassistant/components/tensorflow/image_processing.py @@ -341,9 +341,8 @@ class TensorFlowImageProcessor(ImageProcessingEntity): start = time.perf_counter() try: - import cv2 # pylint: disable=import-error, import-outside-toplevel + import cv2 # pylint: disable=import-outside-toplevel - # pylint: disable=no-member img = cv2.imdecode(np.asarray(bytearray(image)), cv2.IMREAD_UNCHANGED) inp = img[:, :, [2, 1, 0]] # BGR->RGB inp_expanded = inp.reshape(1, inp.shape[0], inp.shape[1], 3) diff --git a/homeassistant/components/tuya/config_flow.py b/homeassistant/components/tuya/config_flow.py index b705c2c7c36..18820098a91 100644 --- a/homeassistant/components/tuya/config_flow.py +++ b/homeassistant/components/tuya/config_flow.py @@ -42,11 +42,11 @@ from .const import ( DEFAULT_DISCOVERY_INTERVAL, DEFAULT_QUERY_INTERVAL, DEFAULT_TUYA_MAX_COLTEMP, + DOMAIN, TUYA_DATA, TUYA_PLATFORMS, TUYA_TYPE_NOT_QUERY, ) -from .const import DOMAIN # pylint:disable=unused-import _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/updater/__init__.py b/homeassistant/components/updater/__init__.py index 9d65bb4c5d4..282c477d20d 100644 --- a/homeassistant/components/updater/__init__.py +++ b/homeassistant/components/updater/__init__.py @@ -5,7 +5,7 @@ import logging import async_timeout from awesomeversion import AwesomeVersion -from distro import linux_distribution # pylint: disable=import-error +from distro import linux_distribution import voluptuous as vol from homeassistant.const import __version__ as current_version diff --git a/homeassistant/components/vera/config_flow.py b/homeassistant/components/vera/config_flow.py index 754d2eca542..e62b21c82ea 100644 --- a/homeassistant/components/vera/config_flow.py +++ b/homeassistant/components/vera/config_flow.py @@ -13,11 +13,7 @@ from homeassistant.const import CONF_EXCLUDE, CONF_LIGHTS, CONF_SOURCE from homeassistant.core import callback from homeassistant.helpers.entity_registry import EntityRegistry -from .const import ( # pylint: disable=unused-import - CONF_CONTROLLER, - CONF_LEGACY_UNIQUE_ID, - DOMAIN, -) +from .const import CONF_CONTROLLER, CONF_LEGACY_UNIQUE_ID, DOMAIN LIST_REGEX = re.compile("[^0-9]+") _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/websocket_api/__init__.py b/homeassistant/components/websocket_api/__init__.py index 2d591455eaf..43f5c807770 100644 --- a/homeassistant/components/websocket_api/__init__.py +++ b/homeassistant/components/websocket_api/__init__.py @@ -6,9 +6,9 @@ import voluptuous as vol from homeassistant.core import HomeAssistant, callback from homeassistant.loader import bind_hass -from . import commands, connection, const, decorators, http, messages # noqa -from .connection import ActiveConnection # noqa -from .const import ( # noqa +from . import commands, connection, const, decorators, http, messages # noqa: F401 +from .connection import ActiveConnection # noqa: F401 +from .const import ( # noqa: F401 ERR_HOME_ASSISTANT_ERROR, ERR_INVALID_FORMAT, ERR_NOT_FOUND, @@ -19,13 +19,13 @@ from .const import ( # noqa ERR_UNKNOWN_COMMAND, ERR_UNKNOWN_ERROR, ) -from .decorators import ( # noqa +from .decorators import ( # noqa: F401 async_response, require_admin, websocket_command, ws_require_user, ) -from .messages import ( # noqa +from .messages import ( # noqa: F401 BASE_COMMAND_MESSAGE_SCHEMA, error_message, event_message, diff --git a/homeassistant/components/websocket_api/const.py b/homeassistant/components/websocket_api/const.py index 5f2cfb2257d..7c3f18f856c 100644 --- a/homeassistant/components/websocket_api/const.py +++ b/homeassistant/components/websocket_api/const.py @@ -9,7 +9,7 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.json import JSONEncoder if TYPE_CHECKING: - from .connection import ActiveConnection # noqa + from .connection import ActiveConnection WebSocketCommandHandler = Callable[[HomeAssistant, "ActiveConnection", dict], None] diff --git a/homeassistant/components/xbox/media_source.py b/homeassistant/components/xbox/media_source.py index 750300e49ee..53346f3750d 100644 --- a/homeassistant/components/xbox/media_source.py +++ b/homeassistant/components/xbox/media_source.py @@ -2,8 +2,7 @@ from dataclasses import dataclass from typing import List, Tuple -# pylint: disable=no-name-in-module -from pydantic.error_wrappers import ValidationError +from pydantic.error_wrappers import ValidationError # pylint: disable=no-name-in-module from xbox.webapi.api.client import XboxLiveClient from xbox.webapi.api.provider.catalog.models import FieldsTemplate, Image from xbox.webapi.api.provider.gameclips.models import GameclipsResponse diff --git a/homeassistant/components/xiaomi_miio/device_tracker.py b/homeassistant/components/xiaomi_miio/device_tracker.py index ef527d0aa40..a6c1c7e5a28 100644 --- a/homeassistant/components/xiaomi_miio/device_tracker.py +++ b/homeassistant/components/xiaomi_miio/device_tracker.py @@ -1,7 +1,7 @@ """Support for Xiaomi Mi WiFi Repeater 2.""" import logging -from miio import DeviceException, WifiRepeater # pylint: disable=import-error +from miio import DeviceException, WifiRepeater import voluptuous as vol from homeassistant.components.device_tracker import ( diff --git a/homeassistant/components/xiaomi_miio/fan.py b/homeassistant/components/xiaomi_miio/fan.py index 055690a4264..c8e200516a0 100644 --- a/homeassistant/components/xiaomi_miio/fan.py +++ b/homeassistant/components/xiaomi_miio/fan.py @@ -4,7 +4,7 @@ from enum import Enum from functools import partial import logging -from miio import ( # pylint: disable=import-error +from miio import ( AirFresh, AirHumidifier, AirHumidifierMiot, @@ -12,24 +12,24 @@ from miio import ( # pylint: disable=import-error AirPurifierMiot, DeviceException, ) -from miio.airfresh import ( # pylint: disable=import-error, import-error +from miio.airfresh import ( LedBrightness as AirfreshLedBrightness, OperationMode as AirfreshOperationMode, ) -from miio.airhumidifier import ( # pylint: disable=import-error, import-error +from miio.airhumidifier import ( LedBrightness as AirhumidifierLedBrightness, OperationMode as AirhumidifierOperationMode, ) -from miio.airhumidifier_miot import ( # pylint: disable=import-error, import-error +from miio.airhumidifier_miot import ( LedBrightness as AirhumidifierMiotLedBrightness, OperationMode as AirhumidifierMiotOperationMode, PressedButton as AirhumidifierPressedButton, ) -from miio.airpurifier import ( # pylint: disable=import-error, import-error +from miio.airpurifier import ( LedBrightness as AirpurifierLedBrightness, OperationMode as AirpurifierOperationMode, ) -from miio.airpurifier_miot import ( # pylint: disable=import-error, import-error +from miio.airpurifier_miot import ( LedBrightness as AirpurifierMiotLedBrightness, OperationMode as AirpurifierMiotOperationMode, ) diff --git a/homeassistant/components/xiaomi_miio/light.py b/homeassistant/components/xiaomi_miio/light.py index 7f168cf0e3e..b03aa1b0d2a 100644 --- a/homeassistant/components/xiaomi_miio/light.py +++ b/homeassistant/components/xiaomi_miio/light.py @@ -6,8 +6,14 @@ from functools import partial import logging from math import ceil -from miio import Ceil, DeviceException, PhilipsBulb, PhilipsEyecare, PhilipsMoonlight -from miio import Device # pylint: disable=import-error +from miio import ( + Ceil, + Device, + DeviceException, + PhilipsBulb, + PhilipsEyecare, + PhilipsMoonlight, +) from miio.gateway import ( GATEWAY_MODEL_AC_V1, GATEWAY_MODEL_AC_V2, diff --git a/homeassistant/components/xiaomi_miio/remote.py b/homeassistant/components/xiaomi_miio/remote.py index c946533ab54..7d75e943d4d 100644 --- a/homeassistant/components/xiaomi_miio/remote.py +++ b/homeassistant/components/xiaomi_miio/remote.py @@ -4,7 +4,7 @@ from datetime import timedelta import logging import time -from miio import ChuangmiIr, DeviceException # pylint: disable=import-error +from miio import ChuangmiIr, DeviceException import voluptuous as vol from homeassistant.components.remote import ( diff --git a/homeassistant/components/xiaomi_miio/sensor.py b/homeassistant/components/xiaomi_miio/sensor.py index 821fe164ea9..52cd4fdca5e 100644 --- a/homeassistant/components/xiaomi_miio/sensor.py +++ b/homeassistant/components/xiaomi_miio/sensor.py @@ -2,8 +2,7 @@ from dataclasses import dataclass import logging -from miio import AirQualityMonitor # pylint: disable=import-error -from miio import DeviceException +from miio import AirQualityMonitor, DeviceException from miio.gateway import ( GATEWAY_MODEL_AC_V1, GATEWAY_MODEL_AC_V2, diff --git a/homeassistant/components/xiaomi_miio/switch.py b/homeassistant/components/xiaomi_miio/switch.py index 3cc95572e6c..04bb40ec27d 100644 --- a/homeassistant/components/xiaomi_miio/switch.py +++ b/homeassistant/components/xiaomi_miio/switch.py @@ -3,9 +3,8 @@ import asyncio from functools import partial import logging -from miio import AirConditioningCompanionV3 # pylint: disable=import-error -from miio import ChuangmiPlug, DeviceException, PowerStrip -from miio.powerstrip import PowerMode # pylint: disable=import-error +from miio import AirConditioningCompanionV3, ChuangmiPlug, DeviceException, PowerStrip +from miio.powerstrip import PowerMode import voluptuous as vol from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity diff --git a/homeassistant/components/xiaomi_miio/vacuum.py b/homeassistant/components/xiaomi_miio/vacuum.py index 7bdbfca7bc9..bbb4cfd1b7f 100644 --- a/homeassistant/components/xiaomi_miio/vacuum.py +++ b/homeassistant/components/xiaomi_miio/vacuum.py @@ -2,7 +2,7 @@ from functools import partial import logging -from miio import DeviceException, Vacuum # pylint: disable=import-error +from miio import DeviceException, Vacuum import voluptuous as vol from homeassistant.components.vacuum import ( diff --git a/homeassistant/components/zha/__init__.py b/homeassistant/components/zha/__init__.py index d5f76fa5e23..351fc86a1e5 100644 --- a/homeassistant/components/zha/__init__.py +++ b/homeassistant/components/zha/__init__.py @@ -94,7 +94,7 @@ async def async_setup_entry(hass, config_entry): if config.get(CONF_ENABLE_QUIRKS, True): # needs to be done here so that the ZHA module is finished loading # before zhaquirks is imported - import zhaquirks # noqa: F401 pylint: disable=unused-import, import-outside-toplevel, import-error + import zhaquirks # noqa: F401 pylint: disable=unused-import, import-outside-toplevel zha_gateway = ZHAGateway(hass, config, config_entry) await zha_gateway.async_initialize() diff --git a/homeassistant/components/zha/core/channels/__init__.py b/homeassistant/components/zha/core/channels/__init__.py index 852d576c035..d3de5f7004d 100644 --- a/homeassistant/components/zha/core/channels/__init__.py +++ b/homeassistant/components/zha/core/channels/__init__.py @@ -10,7 +10,7 @@ from homeassistant.const import ATTR_DEVICE_ID from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_send -from . import ( # noqa: F401 # pylint: disable=unused-import +from . import ( # noqa: F401 base, closures, general, diff --git a/homeassistant/components/zha/core/store.py b/homeassistant/components/zha/core/store.py index 051fcaa2925..2db803258bc 100644 --- a/homeassistant/components/zha/core/store.py +++ b/homeassistant/components/zha/core/store.py @@ -1,5 +1,4 @@ """Data storage helper for ZHA.""" -# pylint: disable=unused-import from collections import OrderedDict import datetime import time diff --git a/homeassistant/components/zone/config_flow.py b/homeassistant/components/zone/config_flow.py index bb34a83ad26..a778d71d2e5 100644 --- a/homeassistant/components/zone/config_flow.py +++ b/homeassistant/components/zone/config_flow.py @@ -6,7 +6,7 @@ migrated to the storage collection. """ from homeassistant import config_entries -from .const import DOMAIN # noqa # pylint:disable=unused-import +from .const import DOMAIN # pylint: disable=unused-import class ZoneConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): diff --git a/homeassistant/components/zwave/__init__.py b/homeassistant/components/zwave/__init__.py index 3acf361dd52..8e9889b5fac 100644 --- a/homeassistant/components/zwave/__init__.py +++ b/homeassistant/components/zwave/__init__.py @@ -396,7 +396,6 @@ async def async_setup_entry(hass, config_entry): Will automatically load components to support devices found on the network. """ - # pylint: disable=import-error from openzwave.group import ZWaveGroup from openzwave.network import ZWaveNetwork from openzwave.option import ZWaveOption @@ -1251,7 +1250,6 @@ class ZWaveDeviceEntity(ZWaveBaseEntity): def __init__(self, values, domain): """Initialize the z-Wave device.""" - # pylint: disable=import-error super().__init__() from openzwave.network import ZWaveNetwork from pydispatch import dispatcher diff --git a/homeassistant/components/zwave/node_entity.py b/homeassistant/components/zwave/node_entity.py index faaea30e0ee..05e5951f921 100644 --- a/homeassistant/components/zwave/node_entity.py +++ b/homeassistant/components/zwave/node_entity.py @@ -118,7 +118,6 @@ class ZWaveNodeEntity(ZWaveBaseEntity): def __init__(self, node, network): """Initialize node.""" - # pylint: disable=import-error super().__init__() from openzwave.network import ZWaveNetwork from pydispatch import dispatcher diff --git a/homeassistant/components/zwave_js/discovery.py b/homeassistant/components/zwave_js/discovery.py index f5f3d9e5c5b..804212d310a 100644 --- a/homeassistant/components/zwave_js/discovery.py +++ b/homeassistant/components/zwave_js/discovery.py @@ -380,7 +380,6 @@ DISCOVERY_SCHEMAS = [ @callback def async_discover_values(node: ZwaveNode) -> Generator[ZwaveDiscoveryInfo, None, None]: """Run discovery on ZWave node and return matching (primary) values.""" - # pylint: disable=too-many-nested-blocks for value in node.values.values(): for schema in DISCOVERY_SCHEMAS: # check manufacturer_id diff --git a/homeassistant/config_entries.py b/homeassistant/config_entries.py index b54300faaa7..d45f2b94516 100644 --- a/homeassistant/config_entries.py +++ b/homeassistant/config_entries.py @@ -927,7 +927,6 @@ class ConfigFlow(data_entry_flow.FlowHandler): @property def unique_id(self) -> Optional[str]: """Return unique ID if available.""" - # pylint: disable=no-member if not self.context: return None @@ -976,7 +975,7 @@ class ConfigFlow(data_entry_flow.FlowHandler): Returns optionally existing config entry with same ID. """ if unique_id is None: - self.context["unique_id"] = None # pylint: disable=no-member + self.context["unique_id"] = None return None if raise_on_progress: @@ -984,7 +983,7 @@ class ConfigFlow(data_entry_flow.FlowHandler): if progress["context"].get("unique_id") == unique_id: raise data_entry_flow.AbortFlow("already_in_progress") - self.context["unique_id"] = unique_id # pylint: disable=no-member + self.context["unique_id"] = unique_id # Abort discoveries done using the default discovery unique id if unique_id != DEFAULT_DISCOVERY_UNIQUE_ID: diff --git a/homeassistant/core.py b/homeassistant/core.py index 3483dc96069..b7bb645be36 100644 --- a/homeassistant/core.py +++ b/homeassistant/core.py @@ -642,7 +642,6 @@ class Event: def __repr__(self) -> str: """Return the representation.""" - # pylint: disable=maybe-no-member if self.data: return f"" diff --git a/homeassistant/data_entry_flow.py b/homeassistant/data_entry_flow.py index e8235c9a23c..15ad417c6ad 100644 --- a/homeassistant/data_entry_flow.py +++ b/homeassistant/data_entry_flow.py @@ -266,11 +266,10 @@ class FlowHandler: # Set by flow manager cur_step: Optional[Dict[str, str]] = None - # Ignore types, pylint workaround: https://github.com/PyCQA/pylint/issues/3167 + # Ignore types: https://github.com/PyCQA/pylint/issues/3167 flow_id: str = None # type: ignore hass: HomeAssistant = None # type: ignore handler: str = None # type: ignore - # Pylint workaround: https://github.com/PyCQA/pylint/issues/3167 # Ensure the attribute has a subscriptable, but immutable, default value. context: Dict = MappingProxyType({}) # type: ignore diff --git a/homeassistant/exceptions.py b/homeassistant/exceptions.py index 84ba2cfa348..9a7b3da0f1d 100644 --- a/homeassistant/exceptions.py +++ b/homeassistant/exceptions.py @@ -4,7 +4,7 @@ from typing import TYPE_CHECKING, Generator, Optional, Sequence import attr if TYPE_CHECKING: - from .core import Context # noqa: F401 pylint: disable=unused-import + from .core import Context class HomeAssistantError(Exception): diff --git a/homeassistant/helpers/entity_platform.py b/homeassistant/helpers/entity_platform.py index 2caf7fe46ab..d860a8a3390 100644 --- a/homeassistant/helpers/entity_platform.py +++ b/homeassistant/helpers/entity_platform.py @@ -62,7 +62,7 @@ class EntityPlatform: self.scan_interval = scan_interval self.entity_namespace = entity_namespace self.config_entry: Optional[config_entries.ConfigEntry] = None - self.entities: Dict[str, Entity] = {} # pylint: disable=used-before-assignment + self.entities: Dict[str, Entity] = {} self._tasks: List[asyncio.Future] = [] # Stop tracking tasks after setup is completed self._setup_complete = False diff --git a/homeassistant/helpers/entity_registry.py b/homeassistant/helpers/entity_registry.py index c86bd64d73e..f18dda71529 100644 --- a/homeassistant/helpers/entity_registry.py +++ b/homeassistant/helpers/entity_registry.py @@ -45,7 +45,7 @@ from homeassistant.util.yaml import load_yaml from .typing import UNDEFINED, HomeAssistantType, UndefinedType if TYPE_CHECKING: - from homeassistant.config_entries import ConfigEntry # noqa: F401 + from homeassistant.config_entries import ConfigEntry PATH_REGISTRY = "entity_registry.yaml" DATA_REGISTRY = "entity_registry" diff --git a/homeassistant/helpers/service.py b/homeassistant/helpers/service.py index 932384493f3..85595998a54 100644 --- a/homeassistant/helpers/service.py +++ b/homeassistant/helpers/service.py @@ -62,7 +62,7 @@ from homeassistant.util.yaml import load_yaml from homeassistant.util.yaml.loader import JSON_TYPE if TYPE_CHECKING: - from homeassistant.helpers.entity import Entity # noqa + from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity_platform import EntityPlatform diff --git a/homeassistant/helpers/sun.py b/homeassistant/helpers/sun.py index 2b82e19b8ce..ce0f0598318 100644 --- a/homeassistant/helpers/sun.py +++ b/homeassistant/helpers/sun.py @@ -12,7 +12,7 @@ from homeassistant.util import dt as dt_util from .typing import HomeAssistantType if TYPE_CHECKING: - import astral # pylint: disable=unused-import + import astral DATA_LOCATION_CACHE = "astral_location_cache" diff --git a/homeassistant/helpers/template.py b/homeassistant/helpers/template.py index 7377120af40..8b3f6ec6e59 100644 --- a/homeassistant/helpers/template.py +++ b/homeassistant/helpers/template.py @@ -366,7 +366,7 @@ class Template: try: render_result = compiled.render(kwargs) - except Exception as err: # pylint: disable=broad-except + except Exception as err: raise TemplateError(err) from err render_result = render_result.strip() diff --git a/homeassistant/util/color.py b/homeassistant/util/color.py index 9a5fbdb180f..4a9162707fa 100644 --- a/homeassistant/util/color.py +++ b/homeassistant/util/color.py @@ -195,6 +195,8 @@ def color_name_to_rgb(color_name: str) -> Tuple[int, int, int]: # pylint: disable=invalid-name + + def color_RGB_to_xy( iR: int, iG: int, iB: int, Gamut: Optional[GamutType] = None ) -> Tuple[float, float]: @@ -205,7 +207,6 @@ def color_RGB_to_xy( # Taken from: # http://www.developers.meethue.com/documentation/color-conversions-rgb-xy # License: Code is given as is. Use at your own risk and discretion. -# pylint: disable=invalid-name def color_RGB_to_xy_brightness( iR: int, iG: int, iB: int, Gamut: Optional[GamutType] = None ) -> Tuple[float, float, int]: diff --git a/homeassistant/util/ssl.py b/homeassistant/util/ssl.py index 7b987d8eeb2..4f10809ff21 100644 --- a/homeassistant/util/ssl.py +++ b/homeassistant/util/ssl.py @@ -23,7 +23,7 @@ def server_context_modern() -> ssl.SSLContext: https://wiki.mozilla.org/Security/Server_Side_TLS Modern guidelines are followed. """ - context = ssl.SSLContext(ssl.PROTOCOL_TLS) # pylint: disable=no-member + context = ssl.SSLContext(ssl.PROTOCOL_TLS) context.options |= ( ssl.OP_NO_SSLv2 @@ -53,7 +53,7 @@ def server_context_intermediate() -> ssl.SSLContext: https://wiki.mozilla.org/Security/Server_Side_TLS Intermediate guidelines are followed. """ - context = ssl.SSLContext(ssl.PROTOCOL_TLS) # pylint: disable=no-member + context = ssl.SSLContext(ssl.PROTOCOL_TLS) context.options |= ( ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3 | ssl.OP_CIPHER_SERVER_PREFERENCE diff --git a/setup.cfg b/setup.cfg index 69cf931185e..98a01278838 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,6 +30,7 @@ ignore = E203, D202, W504 +noqa-require-code = True [mypy] python_version = 3.8 diff --git a/tests/common.py b/tests/common.py index 0ae6f7ef5c7..df8f8fd2fea 100644 --- a/tests/common.py +++ b/tests/common.py @@ -18,7 +18,7 @@ from typing import Any, Awaitable, Collection, Optional from unittest.mock import AsyncMock, Mock, patch import uuid -from aiohttp.test_utils import unused_port as get_test_instance_port # noqa +from aiohttp.test_utils import unused_port as get_test_instance_port # noqa: F401 from homeassistant import auth, config_entries, core as ha, loader from homeassistant.auth import ( diff --git a/tests/components/abode/conftest.py b/tests/components/abode/conftest.py index cc18597c56e..21d64a644a9 100644 --- a/tests/components/abode/conftest.py +++ b/tests/components/abode/conftest.py @@ -3,7 +3,7 @@ import abodepy.helpers.constants as CONST import pytest from tests.common import load_fixture -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 @pytest.fixture(autouse=True) diff --git a/tests/components/alarm_control_panel/test_device_action.py b/tests/components/alarm_control_panel/test_device_action.py index 514e8fa81f2..2b50f83fd8d 100644 --- a/tests/components/alarm_control_panel/test_device_action.py +++ b/tests/components/alarm_control_panel/test_device_action.py @@ -23,7 +23,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/alarm_control_panel/test_device_condition.py b/tests/components/alarm_control_panel/test_device_condition.py index 33f717e1893..450393135af 100644 --- a/tests/components/alarm_control_panel/test_device_condition.py +++ b/tests/components/alarm_control_panel/test_device_condition.py @@ -22,7 +22,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/alarm_control_panel/test_device_trigger.py b/tests/components/alarm_control_panel/test_device_trigger.py index 56316026c9a..ca6260863f1 100644 --- a/tests/components/alarm_control_panel/test_device_trigger.py +++ b/tests/components/alarm_control_panel/test_device_trigger.py @@ -22,7 +22,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/arcam_fmj/test_device_trigger.py b/tests/components/arcam_fmj/test_device_trigger.py index 0cae565f7bb..ff3cf55ecd1 100644 --- a/tests/components/arcam_fmj/test_device_trigger.py +++ b/tests/components/arcam_fmj/test_device_trigger.py @@ -12,7 +12,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/automation/conftest.py b/tests/components/automation/conftest.py index a967e0af192..438948e8475 100644 --- a/tests/components/automation/conftest.py +++ b/tests/components/automation/conftest.py @@ -1,3 +1,3 @@ """Conftest for automation tests.""" -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 diff --git a/tests/components/axis/conftest.py b/tests/components/axis/conftest.py index 33ea820f9cf..b3964663767 100644 --- a/tests/components/axis/conftest.py +++ b/tests/components/axis/conftest.py @@ -1,2 +1,2 @@ """axis conftest.""" -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 diff --git a/tests/components/binary_sensor/test_device_condition.py b/tests/components/binary_sensor/test_device_condition.py index f25b529d426..d8c9e1ca894 100644 --- a/tests/components/binary_sensor/test_device_condition.py +++ b/tests/components/binary_sensor/test_device_condition.py @@ -20,7 +20,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/binary_sensor/test_device_trigger.py b/tests/components/binary_sensor/test_device_trigger.py index fef109eb9d5..9b50d52b785 100644 --- a/tests/components/binary_sensor/test_device_trigger.py +++ b/tests/components/binary_sensor/test_device_trigger.py @@ -20,7 +20,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/blebox/conftest.py b/tests/components/blebox/conftest.py index 3b12c682f3f..c603c15c32b 100644 --- a/tests/components/blebox/conftest.py +++ b/tests/components/blebox/conftest.py @@ -10,7 +10,7 @@ from homeassistant.const import CONF_HOST, CONF_PORT from homeassistant.setup import async_setup_component from tests.common import MockConfigEntry -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 def patch_product_identify(path=None, **kwargs): diff --git a/tests/components/bond/conftest.py b/tests/components/bond/conftest.py index 7ab1805cb73..378c3340e29 100644 --- a/tests/components/bond/conftest.py +++ b/tests/components/bond/conftest.py @@ -1,2 +1,2 @@ """bond conftest.""" -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 diff --git a/tests/components/climate/test_device_action.py b/tests/components/climate/test_device_action.py index 4084d37358e..dc956f0738c 100644 --- a/tests/components/climate/test_device_action.py +++ b/tests/components/climate/test_device_action.py @@ -15,7 +15,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/climate/test_device_condition.py b/tests/components/climate/test_device_condition.py index 8e6d5829c41..009d29dab39 100644 --- a/tests/components/climate/test_device_condition.py +++ b/tests/components/climate/test_device_condition.py @@ -15,7 +15,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/climate/test_device_trigger.py b/tests/components/climate/test_device_trigger.py index 69bb4626e49..017385362d1 100644 --- a/tests/components/climate/test_device_trigger.py +++ b/tests/components/climate/test_device_trigger.py @@ -16,7 +16,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/config/test_automation.py b/tests/components/config/test_automation.py index 00c89edeef0..541cd3068d2 100644 --- a/tests/components/config/test_automation.py +++ b/tests/components/config/test_automation.py @@ -5,7 +5,7 @@ from unittest.mock import patch from homeassistant.bootstrap import async_setup_component from homeassistant.components import config -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 async def test_get_device_config(hass, hass_client): diff --git a/tests/components/config/test_device_registry.py b/tests/components/config/test_device_registry.py index b2273d640de..a123a2edb35 100644 --- a/tests/components/config/test_device_registry.py +++ b/tests/components/config/test_device_registry.py @@ -4,7 +4,7 @@ import pytest from homeassistant.components.config import device_registry from tests.common import mock_device_registry -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/cover/test_device_action.py b/tests/components/cover/test_device_action.py index cad6074ff34..5cec3d901e1 100644 --- a/tests/components/cover/test_device_action.py +++ b/tests/components/cover/test_device_action.py @@ -16,7 +16,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/cover/test_device_condition.py b/tests/components/cover/test_device_condition.py index b3098ceeca9..04415661515 100644 --- a/tests/components/cover/test_device_condition.py +++ b/tests/components/cover/test_device_condition.py @@ -22,7 +22,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/cover/test_device_trigger.py b/tests/components/cover/test_device_trigger.py index e8bb3cdc8df..e0f6d6d5fb9 100644 --- a/tests/components/cover/test_device_trigger.py +++ b/tests/components/cover/test_device_trigger.py @@ -22,7 +22,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/deconz/conftest.py b/tests/components/deconz/conftest.py index 4c45d3c912b..5cf122213c4 100644 --- a/tests/components/deconz/conftest.py +++ b/tests/components/deconz/conftest.py @@ -1,2 +1,2 @@ """deconz conftest.""" -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 diff --git a/tests/components/deconz/test_device_trigger.py b/tests/components/deconz/test_device_trigger.py index b9d538588cd..20fd79e9e8c 100644 --- a/tests/components/deconz/test_device_trigger.py +++ b/tests/components/deconz/test_device_trigger.py @@ -19,7 +19,7 @@ from homeassistant.const import ( from .test_gateway import DECONZ_WEB_REQUEST, setup_deconz_integration from tests.common import assert_lists_same, async_get_device_automations -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 SENSORS = { "1": { diff --git a/tests/components/default_config/test_init.py b/tests/components/default_config/test_init.py index 9830d944471..ec2d207a68b 100644 --- a/tests/components/default_config/test_init.py +++ b/tests/components/default_config/test_init.py @@ -5,7 +5,7 @@ import pytest from homeassistant.setup import async_setup_component -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture(autouse=True) diff --git a/tests/components/demo/conftest.py b/tests/components/demo/conftest.py index 666224fb737..13574c50182 100644 --- a/tests/components/demo/conftest.py +++ b/tests/components/demo/conftest.py @@ -1,2 +1,2 @@ """demo conftest.""" -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 diff --git a/tests/components/device_automation/test_init.py b/tests/components/device_automation/test_init.py index 83ec146b53e..a2f042bcd73 100644 --- a/tests/components/device_automation/test_init.py +++ b/tests/components/device_automation/test_init.py @@ -13,7 +13,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/device_tracker/test_device_condition.py b/tests/components/device_tracker/test_device_condition.py index a187f21e954..2cd4aceeb07 100644 --- a/tests/components/device_tracker/test_device_condition.py +++ b/tests/components/device_tracker/test_device_condition.py @@ -15,7 +15,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/device_tracker/test_device_trigger.py b/tests/components/device_tracker/test_device_trigger.py index 2f0ec14ec4b..0ec1ee67d36 100644 --- a/tests/components/device_tracker/test_device_trigger.py +++ b/tests/components/device_tracker/test_device_trigger.py @@ -16,7 +16,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 AWAY_LATITUDE = 32.881011 AWAY_LONGITUDE = -117.234758 diff --git a/tests/components/dynalite/conftest.py b/tests/components/dynalite/conftest.py index 187e4f9cbaa..59f109e7e47 100644 --- a/tests/components/dynalite/conftest.py +++ b/tests/components/dynalite/conftest.py @@ -1,2 +1,2 @@ """dynalite conftest.""" -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 diff --git a/tests/components/elgato/conftest.py b/tests/components/elgato/conftest.py index f2ac45155fb..fe86f26b535 100644 --- a/tests/components/elgato/conftest.py +++ b/tests/components/elgato/conftest.py @@ -1,2 +1,2 @@ """elgato conftest.""" -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 diff --git a/tests/components/everlights/conftest.py b/tests/components/everlights/conftest.py index 31915934b31..5009251b102 100644 --- a/tests/components/everlights/conftest.py +++ b/tests/components/everlights/conftest.py @@ -1,2 +1,2 @@ """everlights conftest.""" -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 diff --git a/tests/components/fan/test_device_action.py b/tests/components/fan/test_device_action.py index d3a9aedcf9c..491e6afab6a 100644 --- a/tests/components/fan/test_device_action.py +++ b/tests/components/fan/test_device_action.py @@ -14,7 +14,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/fan/test_device_condition.py b/tests/components/fan/test_device_condition.py index 6725587aeda..8f11d963ed3 100644 --- a/tests/components/fan/test_device_condition.py +++ b/tests/components/fan/test_device_condition.py @@ -15,7 +15,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/fan/test_device_trigger.py b/tests/components/fan/test_device_trigger.py index d96f0a828f3..59af7666a03 100644 --- a/tests/components/fan/test_device_trigger.py +++ b/tests/components/fan/test_device_trigger.py @@ -15,7 +15,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/geo_location/test_trigger.py b/tests/components/geo_location/test_trigger.py index ab984a2c309..c547cb61230 100644 --- a/tests/components/geo_location/test_trigger.py +++ b/tests/components/geo_location/test_trigger.py @@ -7,7 +7,7 @@ from homeassistant.core import Context from homeassistant.setup import async_setup_component from tests.common import async_mock_service, mock_component -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/google_assistant/test_helpers.py b/tests/components/google_assistant/test_helpers.py index abf2773d67e..d6094a771bd 100644 --- a/tests/components/google_assistant/test_helpers.py +++ b/tests/components/google_assistant/test_helpers.py @@ -5,7 +5,7 @@ from unittest.mock import Mock, call, patch import pytest from homeassistant.components.google_assistant import helpers -from homeassistant.components.google_assistant.const import ( # noqa: F401 +from homeassistant.components.google_assistant.const import ( EVENT_COMMAND_RECEIVED, NOT_EXPOSE_LOCAL, ) diff --git a/tests/components/group/conftest.py b/tests/components/group/conftest.py index 6fe34aca91c..e26e98598e6 100644 --- a/tests/components/group/conftest.py +++ b/tests/components/group/conftest.py @@ -1,2 +1,2 @@ """group conftest.""" -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 diff --git a/tests/components/hassio/test_websocket_api.py b/tests/components/hassio/test_websocket_api.py index 18da5df13ea..dcf6b64d9e2 100644 --- a/tests/components/hassio/test_websocket_api.py +++ b/tests/components/hassio/test_websocket_api.py @@ -14,7 +14,7 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.dispatcher import async_dispatcher_send from homeassistant.setup import async_setup_component -from . import mock_all # noqa +from . import mock_all # noqa: F401 from tests.common import async_mock_signal diff --git a/tests/components/homeassistant/triggers/conftest.py b/tests/components/homeassistant/triggers/conftest.py index 5c983ba698e..77520a1bf68 100644 --- a/tests/components/homeassistant/triggers/conftest.py +++ b/tests/components/homeassistant/triggers/conftest.py @@ -1,3 +1,3 @@ """Conftest for HA triggers.""" -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 diff --git a/tests/components/homekit_controller/conftest.py b/tests/components/homekit_controller/conftest.py index 26adb25df21..4e095b1d2d9 100644 --- a/tests/components/homekit_controller/conftest.py +++ b/tests/components/homekit_controller/conftest.py @@ -8,7 +8,7 @@ import pytest import homeassistant.util.dt as dt_util -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 @pytest.fixture diff --git a/tests/components/homekit_controller/test_device_trigger.py b/tests/components/homekit_controller/test_device_trigger.py index 9de9a30f99f..ce771eac768 100644 --- a/tests/components/homekit_controller/test_device_trigger.py +++ b/tests/components/homekit_controller/test_device_trigger.py @@ -12,7 +12,7 @@ from tests.common import ( async_get_device_automations, async_mock_service, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 from tests.components.homekit_controller.common import setup_test_component diff --git a/tests/components/homematicip_cloud/conftest.py b/tests/components/homematicip_cloud/conftest.py index b05683d2361..aac7f60558c 100644 --- a/tests/components/homematicip_cloud/conftest.py +++ b/tests/components/homematicip_cloud/conftest.py @@ -25,7 +25,7 @@ from homeassistant.helpers.typing import ConfigType, HomeAssistantType from .helper import AUTH_TOKEN, HAPID, HAPPIN, HomeFactory from tests.common import MockConfigEntry -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 @pytest.fixture(name="mock_connection") diff --git a/tests/components/hue/conftest.py b/tests/components/hue/conftest.py index fc42babbb35..db45b9fcd4d 100644 --- a/tests/components/hue/conftest.py +++ b/tests/components/hue/conftest.py @@ -12,7 +12,7 @@ from homeassistant import config_entries from homeassistant.components import hue from homeassistant.components.hue import sensor_base as hue_sensor_base -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 @pytest.fixture(autouse=True) diff --git a/tests/components/hue/test_device_trigger.py b/tests/components/hue/test_device_trigger.py index 178cd7b09f1..5711c36da98 100644 --- a/tests/components/hue/test_device_trigger.py +++ b/tests/components/hue/test_device_trigger.py @@ -15,7 +15,7 @@ from tests.common import ( async_mock_service, mock_device_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 REMOTES_RESPONSE = {"7": HUE_TAP_REMOTE_1, "8": HUE_DIMMER_REMOTE_1} diff --git a/tests/components/humidifier/test_device_action.py b/tests/components/humidifier/test_device_action.py index 93b97408c39..1bf1c110ec6 100644 --- a/tests/components/humidifier/test_device_action.py +++ b/tests/components/humidifier/test_device_action.py @@ -16,7 +16,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/humidifier/test_device_condition.py b/tests/components/humidifier/test_device_condition.py index ad001d52ae0..d72d0e3b70e 100644 --- a/tests/components/humidifier/test_device_condition.py +++ b/tests/components/humidifier/test_device_condition.py @@ -17,7 +17,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/humidifier/test_device_trigger.py b/tests/components/humidifier/test_device_trigger.py index 7cd736b79f4..0b6154a84df 100644 --- a/tests/components/humidifier/test_device_trigger.py +++ b/tests/components/humidifier/test_device_trigger.py @@ -20,7 +20,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/hyperion/conftest.py b/tests/components/hyperion/conftest.py index 4eb59770fae..f971fa3c767 100644 --- a/tests/components/hyperion/conftest.py +++ b/tests/components/hyperion/conftest.py @@ -1,2 +1,2 @@ """hyperion conftest.""" -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 diff --git a/tests/components/kodi/test_device_trigger.py b/tests/components/kodi/test_device_trigger.py index 0dd75b9c357..1edf7da6604 100644 --- a/tests/components/kodi/test_device_trigger.py +++ b/tests/components/kodi/test_device_trigger.py @@ -15,7 +15,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/light/test_device_action.py b/tests/components/light/test_device_action.py index 63670d9bfab..4760dfd1c53 100644 --- a/tests/components/light/test_device_action.py +++ b/tests/components/light/test_device_action.py @@ -21,7 +21,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/light/test_device_condition.py b/tests/components/light/test_device_condition.py index 2a877478b1e..d529c82bfa5 100644 --- a/tests/components/light/test_device_condition.py +++ b/tests/components/light/test_device_condition.py @@ -19,7 +19,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/light/test_device_trigger.py b/tests/components/light/test_device_trigger.py index fad39898467..1c9f6cf1454 100644 --- a/tests/components/light/test_device_trigger.py +++ b/tests/components/light/test_device_trigger.py @@ -19,7 +19,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/litejet/test_trigger.py b/tests/components/litejet/test_trigger.py index 216da9b54ef..50d7fb40715 100644 --- a/tests/components/litejet/test_trigger.py +++ b/tests/components/litejet/test_trigger.py @@ -13,7 +13,7 @@ import homeassistant.util.dt as dt_util from . import async_init_integration from tests.common import async_fire_time_changed, async_mock_service -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 _LOGGER = logging.getLogger(__name__) diff --git a/tests/components/lock/test_device_action.py b/tests/components/lock/test_device_action.py index 91cab9cdaf4..7d484ae96aa 100644 --- a/tests/components/lock/test_device_action.py +++ b/tests/components/lock/test_device_action.py @@ -15,7 +15,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/lock/test_device_condition.py b/tests/components/lock/test_device_condition.py index 949100daa55..b021ef23391 100644 --- a/tests/components/lock/test_device_condition.py +++ b/tests/components/lock/test_device_condition.py @@ -15,7 +15,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/lock/test_device_trigger.py b/tests/components/lock/test_device_trigger.py index 20674c483fd..272cf57bccd 100644 --- a/tests/components/lock/test_device_trigger.py +++ b/tests/components/lock/test_device_trigger.py @@ -15,7 +15,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/media_player/test_device_condition.py b/tests/components/media_player/test_device_condition.py index c7668d748af..63cdb1c55a7 100644 --- a/tests/components/media_player/test_device_condition.py +++ b/tests/components/media_player/test_device_condition.py @@ -21,7 +21,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/media_player/test_device_trigger.py b/tests/components/media_player/test_device_trigger.py index 93d9127f8b8..912edfc9c3c 100644 --- a/tests/components/media_player/test_device_trigger.py +++ b/tests/components/media_player/test_device_trigger.py @@ -21,7 +21,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/mochad/conftest.py b/tests/components/mochad/conftest.py index 9b095046d9c..bd543eae943 100644 --- a/tests/components/mochad/conftest.py +++ b/tests/components/mochad/conftest.py @@ -1,2 +1,2 @@ """mochad conftest.""" -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 diff --git a/tests/components/mqtt/conftest.py b/tests/components/mqtt/conftest.py index 5f0acc3e5c2..6f70a4dbadb 100644 --- a/tests/components/mqtt/conftest.py +++ b/tests/components/mqtt/conftest.py @@ -1,2 +1,2 @@ """Test fixtures for mqtt component.""" -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 diff --git a/tests/components/mqtt/test_device_trigger.py b/tests/components/mqtt/test_device_trigger.py index 210dac19e0c..c1e012a90d6 100644 --- a/tests/components/mqtt/test_device_trigger.py +++ b/tests/components/mqtt/test_device_trigger.py @@ -16,7 +16,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/mqtt/test_trigger.py b/tests/components/mqtt/test_trigger.py index d0a86e08655..70ee5e9327c 100644 --- a/tests/components/mqtt/test_trigger.py +++ b/tests/components/mqtt/test_trigger.py @@ -8,7 +8,7 @@ from homeassistant.const import ATTR_ENTITY_ID, ENTITY_MATCH_ALL, SERVICE_TURN_O from homeassistant.setup import async_setup_component from tests.common import async_fire_mqtt_message, async_mock_service, mock_component -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/number/test_device_action.py b/tests/components/number/test_device_action.py index 21c79a9f741..a981a331e7e 100644 --- a/tests/components/number/test_device_action.py +++ b/tests/components/number/test_device_action.py @@ -15,7 +15,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/ozw/conftest.py b/tests/components/ozw/conftest.py index a59388f118f..1df365054d4 100644 --- a/tests/components/ozw/conftest.py +++ b/tests/components/ozw/conftest.py @@ -9,7 +9,7 @@ from homeassistant.config_entries import ENTRY_STATE_LOADED from .common import MQTTMessage from tests.common import MockConfigEntry, load_fixture -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 @pytest.fixture(name="generic_data", scope="session") diff --git a/tests/components/philips_js/test_device_trigger.py b/tests/components/philips_js/test_device_trigger.py index ebda40f13e5..e0ee10c6abb 100644 --- a/tests/components/philips_js/test_device_trigger.py +++ b/tests/components/philips_js/test_device_trigger.py @@ -10,7 +10,7 @@ from tests.common import ( async_get_device_automations, async_mock_service, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/remote/test_device_action.py b/tests/components/remote/test_device_action.py index 17165639e25..7cd5a632982 100644 --- a/tests/components/remote/test_device_action.py +++ b/tests/components/remote/test_device_action.py @@ -16,7 +16,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/remote/test_device_condition.py b/tests/components/remote/test_device_condition.py index c6a2b3f0c52..12cf0e05493 100644 --- a/tests/components/remote/test_device_condition.py +++ b/tests/components/remote/test_device_condition.py @@ -19,7 +19,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/remote/test_device_trigger.py b/tests/components/remote/test_device_trigger.py index eccf96c04f6..616c356936c 100644 --- a/tests/components/remote/test_device_trigger.py +++ b/tests/components/remote/test_device_trigger.py @@ -19,7 +19,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/rflink/conftest.py b/tests/components/rflink/conftest.py index f33c8ab89db..dcaeb0a5e01 100644 --- a/tests/components/rflink/conftest.py +++ b/tests/components/rflink/conftest.py @@ -1,2 +1,2 @@ """rflink conftest.""" -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 diff --git a/tests/components/rfxtrx/conftest.py b/tests/components/rfxtrx/conftest.py index ee695bee9dd..06e37545d25 100644 --- a/tests/components/rfxtrx/conftest.py +++ b/tests/components/rfxtrx/conftest.py @@ -9,7 +9,7 @@ from homeassistant.components.rfxtrx import DOMAIN from homeassistant.util.dt import utcnow from tests.common import MockConfigEntry, async_fire_time_changed -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 def create_rfx_test_cfg(device="abcd", automatic_add=False, devices=None): diff --git a/tests/components/ring/conftest.py b/tests/components/ring/conftest.py index f2e05189dea..cda662aab64 100644 --- a/tests/components/ring/conftest.py +++ b/tests/components/ring/conftest.py @@ -5,7 +5,7 @@ import pytest import requests_mock from tests.common import load_fixture -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 @pytest.fixture(name="requests_mock") diff --git a/tests/components/search/test_init.py b/tests/components/search/test_init.py index 5710fa04698..6f6a7793981 100644 --- a/tests/components/search/test_init.py +++ b/tests/components/search/test_init.py @@ -3,7 +3,7 @@ from homeassistant.components import search from homeassistant.setup import async_setup_component from tests.common import MockConfigEntry -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 async def test_search(hass): diff --git a/tests/components/sensor/test_device_condition.py b/tests/components/sensor/test_device_condition.py index 9a023d6f5ad..80c20cb8e2d 100644 --- a/tests/components/sensor/test_device_condition.py +++ b/tests/components/sensor/test_device_condition.py @@ -16,7 +16,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 from tests.testing_config.custom_components.test.sensor import DEVICE_CLASSES diff --git a/tests/components/sensor/test_device_trigger.py b/tests/components/sensor/test_device_trigger.py index d5755ac3288..eb38060f0dd 100644 --- a/tests/components/sensor/test_device_trigger.py +++ b/tests/components/sensor/test_device_trigger.py @@ -20,7 +20,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 from tests.testing_config.custom_components.test.sensor import DEVICE_CLASSES diff --git a/tests/components/smartthings/conftest.py b/tests/components/smartthings/conftest.py index b99309bea52..d145e7644a9 100644 --- a/tests/components/smartthings/conftest.py +++ b/tests/components/smartthings/conftest.py @@ -47,7 +47,7 @@ from homeassistant.const import ( from homeassistant.setup import async_setup_component from tests.common import MockConfigEntry -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 COMPONENT_PREFIX = "homeassistant.components.smartthings." diff --git a/tests/components/sun/test_trigger.py b/tests/components/sun/test_trigger.py index a288150517d..fd01daac5b7 100644 --- a/tests/components/sun/test_trigger.py +++ b/tests/components/sun/test_trigger.py @@ -18,7 +18,7 @@ from homeassistant.setup import async_setup_component import homeassistant.util.dt as dt_util from tests.common import async_fire_time_changed, async_mock_service, mock_component -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 ORIG_TIME_ZONE = dt_util.DEFAULT_TIME_ZONE diff --git a/tests/components/switch/conftest.py b/tests/components/switch/conftest.py index d69757a9b1b..11f1563b723 100644 --- a/tests/components/switch/conftest.py +++ b/tests/components/switch/conftest.py @@ -1,2 +1,2 @@ """switch conftest.""" -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 diff --git a/tests/components/switch/test_device_action.py b/tests/components/switch/test_device_action.py index 4da401a215c..2a98cd2fad4 100644 --- a/tests/components/switch/test_device_action.py +++ b/tests/components/switch/test_device_action.py @@ -16,7 +16,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/switch/test_device_condition.py b/tests/components/switch/test_device_condition.py index 67ba3e8e38e..9273610dee9 100644 --- a/tests/components/switch/test_device_condition.py +++ b/tests/components/switch/test_device_condition.py @@ -19,7 +19,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/switch/test_device_trigger.py b/tests/components/switch/test_device_trigger.py index 34817b687f8..d958dd21911 100644 --- a/tests/components/switch/test_device_trigger.py +++ b/tests/components/switch/test_device_trigger.py @@ -19,7 +19,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/tag/test_trigger.py b/tests/components/tag/test_trigger.py index 9a97d95e7d5..5563b5644a4 100644 --- a/tests/components/tag/test_trigger.py +++ b/tests/components/tag/test_trigger.py @@ -9,7 +9,7 @@ from homeassistant.const import ATTR_ENTITY_ID, SERVICE_TURN_OFF from homeassistant.setup import async_setup_component from tests.common import async_mock_service -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/tasmota/conftest.py b/tests/components/tasmota/conftest.py index 3c530a93d1e..5c0b7d315f9 100644 --- a/tests/components/tasmota/conftest.py +++ b/tests/components/tasmota/conftest.py @@ -17,7 +17,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 @pytest.fixture diff --git a/tests/components/tasmota/test_device_trigger.py b/tests/components/tasmota/test_device_trigger.py index ec8744881c5..1fa1c629a33 100644 --- a/tests/components/tasmota/test_device_trigger.py +++ b/tests/components/tasmota/test_device_trigger.py @@ -18,7 +18,7 @@ from tests.common import ( async_fire_mqtt_message, async_get_device_automations, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 async def test_get_triggers_btn(hass, device_reg, entity_reg, mqtt_mock, setup_tasmota): diff --git a/tests/components/template/conftest.py b/tests/components/template/conftest.py index 8e3491b160a..0848200b35d 100644 --- a/tests/components/template/conftest.py +++ b/tests/components/template/conftest.py @@ -1,2 +1,2 @@ """template conftest.""" -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 diff --git a/tests/components/template/test_trigger.py b/tests/components/template/test_trigger.py index 55311005201..b40eee7cab3 100644 --- a/tests/components/template/test_trigger.py +++ b/tests/components/template/test_trigger.py @@ -18,7 +18,7 @@ from tests.common import ( async_mock_service, mock_component, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/tplink/conftest.py b/tests/components/tplink/conftest.py index d1800513486..61b242c5d2e 100644 --- a/tests/components/tplink/conftest.py +++ b/tests/components/tplink/conftest.py @@ -1,2 +1,2 @@ """tplink conftest.""" -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 diff --git a/tests/components/tradfri/conftest.py b/tests/components/tradfri/conftest.py index 93675a9e4d1..54a8625f23c 100644 --- a/tests/components/tradfri/conftest.py +++ b/tests/components/tradfri/conftest.py @@ -5,7 +5,7 @@ import pytest from . import MOCK_GATEWAY_ID -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 # pylint: disable=protected-access diff --git a/tests/components/vacuum/test_device_action.py b/tests/components/vacuum/test_device_action.py index 3edeaba2a41..aa5dc1786f7 100644 --- a/tests/components/vacuum/test_device_action.py +++ b/tests/components/vacuum/test_device_action.py @@ -14,7 +14,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/vacuum/test_device_condition.py b/tests/components/vacuum/test_device_condition.py index 3dc7a628741..84a25d183b8 100644 --- a/tests/components/vacuum/test_device_condition.py +++ b/tests/components/vacuum/test_device_condition.py @@ -19,7 +19,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/vacuum/test_device_trigger.py b/tests/components/vacuum/test_device_trigger.py index e3f615891e6..fd1918b8e69 100644 --- a/tests/components/vacuum/test_device_trigger.py +++ b/tests/components/vacuum/test_device_trigger.py @@ -14,7 +14,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/vera/conftest.py b/tests/components/vera/conftest.py index da027207748..e5d2dac1dbf 100644 --- a/tests/components/vera/conftest.py +++ b/tests/components/vera/conftest.py @@ -5,7 +5,7 @@ import pytest from .common import ComponentFactory -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 @pytest.fixture() diff --git a/tests/components/water_heater/test_device_action.py b/tests/components/water_heater/test_device_action.py index 06bd43ec654..060d9ead29f 100644 --- a/tests/components/water_heater/test_device_action.py +++ b/tests/components/water_heater/test_device_action.py @@ -14,7 +14,7 @@ from tests.common import ( mock_device_registry, mock_registry, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/webhook/test_trigger.py b/tests/components/webhook/test_trigger.py index 2a22c330e14..4909c668dfe 100644 --- a/tests/components/webhook/test_trigger.py +++ b/tests/components/webhook/test_trigger.py @@ -6,7 +6,7 @@ import pytest from homeassistant.core import callback from homeassistant.setup import async_setup_component -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture(autouse=True) diff --git a/tests/components/wilight/conftest.py b/tests/components/wilight/conftest.py index a8fd13553dd..b20a7757e22 100644 --- a/tests/components/wilight/conftest.py +++ b/tests/components/wilight/conftest.py @@ -1,2 +1,2 @@ """wilight conftest.""" -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 diff --git a/tests/components/wled/conftest.py b/tests/components/wled/conftest.py index 31b71a92f19..7b8eb9cd50c 100644 --- a/tests/components/wled/conftest.py +++ b/tests/components/wled/conftest.py @@ -1,2 +1,2 @@ """wled conftest.""" -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 diff --git a/tests/components/yeelight/conftest.py b/tests/components/yeelight/conftest.py index 3e65a60f374..f418e90e848 100644 --- a/tests/components/yeelight/conftest.py +++ b/tests/components/yeelight/conftest.py @@ -1,2 +1,2 @@ """yeelight conftest.""" -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 diff --git a/tests/components/zerproc/conftest.py b/tests/components/zerproc/conftest.py index b4c35bebc71..9d6bd9dea23 100644 --- a/tests/components/zerproc/conftest.py +++ b/tests/components/zerproc/conftest.py @@ -1,2 +1,2 @@ """zerproc conftest.""" -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 diff --git a/tests/components/zha/conftest.py b/tests/components/zha/conftest.py index 57241b9bb74..b3ac4aff16e 100644 --- a/tests/components/zha/conftest.py +++ b/tests/components/zha/conftest.py @@ -16,7 +16,7 @@ from homeassistant.setup import async_setup_component from .common import FakeDevice, FakeEndpoint, get_zha_gateway from tests.common import MockConfigEntry -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 FIXTURE_GRP_ID = 0x1001 FIXTURE_GRP_NAME = "fixture group" diff --git a/tests/components/zha/test_device_action.py b/tests/components/zha/test_device_action.py index 316d475f17f..1160995e8d7 100644 --- a/tests/components/zha/test_device_action.py +++ b/tests/components/zha/test_device_action.py @@ -16,7 +16,7 @@ from homeassistant.helpers.device_registry import async_get_registry from homeassistant.setup import async_setup_component from tests.common import async_mock_service, mock_coro -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 SHORT_PRESS = "remote_button_short_press" COMMAND = "command" diff --git a/tests/components/zha/test_device_trigger.py b/tests/components/zha/test_device_trigger.py index 96ee5520e2a..ec947846801 100644 --- a/tests/components/zha/test_device_trigger.py +++ b/tests/components/zha/test_device_trigger.py @@ -19,7 +19,7 @@ from tests.common import ( async_get_device_automations, async_mock_service, ) -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 ON = 1 OFF = 0 diff --git a/tests/components/zone/test_trigger.py b/tests/components/zone/test_trigger.py index d7f5857b466..52fbb55ba97 100644 --- a/tests/components/zone/test_trigger.py +++ b/tests/components/zone/test_trigger.py @@ -7,7 +7,7 @@ from homeassistant.core import Context from homeassistant.setup import async_setup_component from tests.common import async_mock_service, mock_component -from tests.components.blueprint.conftest import stub_blueprint_populate # noqa +from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401 @pytest.fixture diff --git a/tests/components/zwave/conftest.py b/tests/components/zwave/conftest.py index 13da12c67ff..027d3a82ea2 100644 --- a/tests/components/zwave/conftest.py +++ b/tests/components/zwave/conftest.py @@ -5,7 +5,7 @@ import pytest from homeassistant.components.zwave import const -from tests.components.light.conftest import mock_light_profiles # noqa +from tests.components.light.conftest import mock_light_profiles # noqa: F401 from tests.mock.zwave import MockNetwork, MockNode, MockOption, MockValue