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
This commit is contained in:
Ville Skyttä 2021-03-02 10:02:04 +02:00 committed by GitHub
parent 38a2f196b8
commit dc880118a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
217 changed files with 237 additions and 306 deletions

View file

@ -28,6 +28,9 @@ repos:
- id: flake8 - id: flake8
additional_dependencies: additional_dependencies:
- flake8-docstrings==1.5.0 - 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 - pydocstyle==5.1.1
files: ^(homeassistant|script|tests)/.+\.py$ files: ^(homeassistant|script|tests)/.+\.py$
- repo: https://github.com/PyCQA/bandit - repo: https://github.com/PyCQA/bandit

View file

@ -4,8 +4,7 @@ from typing import TYPE_CHECKING
import attr import attr
if TYPE_CHECKING: if TYPE_CHECKING:
# pylint: disable=unused-import from homeassistant.helpers import (
from homeassistant.helpers import ( # noqa: F401
device_registry as dev_reg, device_registry as dev_reg,
entity_registry as ent_reg, entity_registry as ent_reg,
) )

View file

@ -59,7 +59,7 @@ from homeassistant.loader import bind_hass
from homeassistant.util.dt import parse_datetime from homeassistant.util.dt import parse_datetime
# Not used except by packages to check config structure # 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 .config import async_validate_config_item
from .const import ( from .const import (
CONF_ACTION, CONF_ACTION,

View file

@ -41,7 +41,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
def setup_platform(hass, config, add_entities, discovery_info=None): def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up an Avion switch.""" """Set up an Avion switch."""
# pylint: disable=no-member
avion = importlib.import_module("avion") avion = importlib.import_module("avion")
lights = [] lights = []
@ -111,7 +110,6 @@ class AvionLight(LightEntity):
def set_state(self, brightness): def set_state(self, brightness):
"""Set the state of this lamp to the provided brightness.""" """Set the state of this lamp to the provided brightness."""
# pylint: disable=no-member
avion = importlib.import_module("avion") avion = importlib.import_module("avion")
# Bluetooth LE is unreliable, and the connection may drop at any # Bluetooth LE is unreliable, and the connection may drop at any

View file

@ -10,7 +10,7 @@ from homeassistant.config_entries import CONN_CLASS_CLOUD_POLL, ConfigFlow
from homeassistant.const import CONF_ACCESS_TOKEN from homeassistant.const import CONF_ACCESS_TOKEN
from homeassistant.helpers.aiohttp_client import async_get_clientsession 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): class AwairFlowHandler(ConfigFlow, domain=DOMAIN):

View file

@ -8,7 +8,6 @@ DOMAIN = "bbb_gpio"
def setup(hass, config): def setup(hass, config):
"""Set up the BeagleBone Black GPIO component.""" """Set up the BeagleBone Black GPIO component."""
# pylint: disable=import-error
def cleanup_gpio(event): def cleanup_gpio(event):
"""Stuff to do before stopping.""" """Stuff to do before stopping."""

View file

@ -3,7 +3,7 @@ from functools import partial
import logging import logging
from i2csense.bh1750 import BH1750 # pylint: disable=import-error from i2csense.bh1750 import BH1750 # pylint: disable=import-error
import smbus # pylint: disable=import-error import smbus
import voluptuous as vol import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.components.sensor import PLATFORM_SCHEMA

View file

@ -26,7 +26,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
def setup_platform(hass, config, add_entities, discovery_info=None): def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Blinkt Light platform.""" """Set up the Blinkt Light platform."""
# pylint: disable=no-member
blinkt = importlib.import_module("blinkt") blinkt = importlib.import_module("blinkt")
# ensure that the lights are off when exiting # ensure that the lights are off when exiting

View file

@ -1,7 +1,7 @@
"""The blueprint integration.""" """The blueprint integration."""
from . import websocket_api from . import websocket_api
from .const import DOMAIN # noqa from .const import DOMAIN # noqa: F401
from .errors import ( # noqa from .errors import ( # noqa: F401
BlueprintException, BlueprintException,
BlueprintWithNameException, BlueprintWithNameException,
FailedToLoad, FailedToLoad,
@ -9,8 +9,8 @@ from .errors import ( # noqa
InvalidBlueprintInputs, InvalidBlueprintInputs,
MissingInput, MissingInput,
) )
from .models import Blueprint, BlueprintInputs, DomainBlueprints # noqa from .models import Blueprint, BlueprintInputs, DomainBlueprints # noqa: F401
from .schemas import is_blueprint_instance_config # noqa from .schemas import is_blueprint_instance_config # noqa: F401
async def async_setup(hass, config): async def async_setup(hass, config):

View file

@ -4,7 +4,7 @@ from datetime import datetime, timedelta
import logging import logging
from uuid import UUID from uuid import UUID
import pygatt # pylint: disable=import-error import pygatt
import voluptuous as vol import voluptuous as vol
from homeassistant.components.device_tracker import PLATFORM_SCHEMA from homeassistant.components.device_tracker import PLATFORM_SCHEMA

View file

@ -3,8 +3,7 @@ import asyncio
import logging import logging
from typing import List, Optional, Set, Tuple from typing import List, Optional, Set, Tuple
# pylint: disable=import-error import bluetooth # pylint: disable=import-error
import bluetooth
from bt_proximity import BluetoothRSSI from bt_proximity import BluetoothRSSI
import voluptuous as vol import voluptuous as vol

View file

@ -4,7 +4,7 @@ from functools import partial
import logging import logging
from i2csense.bme280 import BME280 # pylint: disable=import-error from i2csense.bme280 import BME280 # pylint: disable=import-error
import smbus # pylint: disable=import-error import smbus
import voluptuous as vol import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.components.sensor import PLATFORM_SCHEMA

View file

@ -4,7 +4,7 @@ import threading
from time import monotonic, sleep from time import monotonic, sleep
import bme680 # pylint: disable=import-error import bme680 # pylint: disable=import-error
from smbus import SMBus # pylint: disable=import-error from smbus import SMBus
import voluptuous as vol import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.components.sensor import PLATFORM_SCHEMA
@ -131,7 +131,6 @@ def _setup_bme680(config):
sensor_handler = None sensor_handler = None
sensor = None sensor = None
try: try:
# pylint: disable=no-member
i2c_address = config[CONF_I2C_ADDRESS] i2c_address = config[CONF_I2C_ADDRESS]
bus = SMBus(config[CONF_I2C_BUS]) bus = SMBus(config[CONF_I2C_BUS])
sensor = bme680.BME680(i2c_address, bus) sensor = bme680.BME680(i2c_address, bus)

View file

@ -12,7 +12,7 @@ from homeassistant.const import CONF_HOST, CONF_MAC, CONF_PIN
from homeassistant.core import callback from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from .const import ( # pylint:disable=unused-import from .const import (
ATTR_CID, ATTR_CID,
ATTR_MAC, ATTR_MAC,
ATTR_MODEL, ATTR_MODEL,

View file

@ -19,8 +19,7 @@ def get_cert(host, port):
address = (host, port) address = (host, port)
with socket.create_connection(address, timeout=TIMEOUT) as sock: with socket.create_connection(address, timeout=TIMEOUT) as sock:
with ctx.wrap_socket(sock, server_hostname=address[0]) as ssock: with ctx.wrap_socket(sock, server_hostname=address[0]) as ssock:
# pylint disable: https://github.com/PyCQA/pylint/issues/3166 cert = ssock.getpeercert()
cert = ssock.getpeercert() # pylint: disable=no-member
return cert return cert

View file

@ -98,7 +98,6 @@ class CmusRemote:
class CmusDevice(MediaPlayerEntity): class CmusDevice(MediaPlayerEntity):
"""Representation of a running cmus.""" """Representation of a running cmus."""
# pylint: disable=no-member
def __init__(self, device, name, server): def __init__(self, device, name, server):
"""Initialize the CMUS device.""" """Initialize the CMUS device."""

View file

@ -4,10 +4,8 @@ from functools import wraps
import logging import logging
import time import time
from bluepy.btle import ( # pylint: disable=import-error, no-member, no-name-in-module from bluepy.btle import BTLEException # pylint: disable=import-error
BTLEException, import decora # pylint: disable=import-error
)
import decora # pylint: disable=import-error, no-member
import voluptuous as vol import voluptuous as vol
from homeassistant.components.light import ( from homeassistant.components.light import (

View file

@ -1,16 +1,10 @@
"""Provide functionality to keep track of devices.""" """Provide functionality to keep track of devices."""
from homeassistant.const import ( # noqa: F401 pylint: disable=unused-import from homeassistant.const import ATTR_GPS_ACCURACY, STATE_HOME # noqa: F401
ATTR_GPS_ACCURACY,
STATE_HOME,
)
from homeassistant.helpers.typing import ConfigType, HomeAssistantType from homeassistant.helpers.typing import ConfigType, HomeAssistantType
from homeassistant.loader import bind_hass from homeassistant.loader import bind_hass
from .config_entry import ( # noqa: F401 pylint: disable=unused-import from .config_entry import async_setup_entry, async_unload_entry # noqa: F401
async_setup_entry, from .const import ( # noqa: F401
async_unload_entry,
)
from .const import ( # noqa: F401 pylint: disable=unused-import
ATTR_ATTRIBUTES, ATTR_ATTRIBUTES,
ATTR_BATTERY, ATTR_BATTERY,
ATTR_DEV_ID, ATTR_DEV_ID,
@ -29,7 +23,7 @@ from .const import ( # noqa: F401 pylint: disable=unused-import
SOURCE_TYPE_GPS, SOURCE_TYPE_GPS,
SOURCE_TYPE_ROUTER, SOURCE_TYPE_ROUTER,
) )
from .legacy import ( # noqa: F401 pylint: disable=unused-import from .legacy import ( # noqa: F401
PLATFORM_SCHEMA, PLATFORM_SCHEMA,
PLATFORM_SCHEMA_BASE, PLATFORM_SCHEMA_BASE,
SERVICE_SEE, SERVICE_SEE,

View file

@ -1,7 +1,7 @@
"""Support for the Environment Canada radar imagery.""" """Support for the Environment Canada radar imagery."""
import datetime import datetime
from env_canada import ECRadar # pylint: disable=import-error from env_canada import ECRadar
import voluptuous as vol import voluptuous as vol
from homeassistant.components.camera import PLATFORM_SCHEMA, Camera from homeassistant.components.camera import PLATFORM_SCHEMA, Camera

View file

@ -3,7 +3,7 @@ from datetime import datetime, timedelta
import logging import logging
import re import re
from env_canada import ECData # pylint: disable=import-error from env_canada import ECData
import voluptuous as vol import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.components.sensor import PLATFORM_SCHEMA

View file

@ -2,7 +2,7 @@
import datetime import datetime
import re import re
from env_canada import ECData # pylint: disable=import-error from env_canada import ECData
import voluptuous as vol import voluptuous as vol
from homeassistant.components.weather import ( from homeassistant.components.weather import (

View file

@ -1,7 +1,7 @@
"""Support for eQ-3 Bluetooth Smart thermostats.""" """Support for eQ-3 Bluetooth Smart thermostats."""
import logging 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 eq3bt as eq3 # pylint: disable=import-error
import voluptuous as vol import voluptuous as vol

View file

@ -344,7 +344,6 @@ class FanEntity(ToggleEntity):
"""Turn on the fan.""" """Turn on the fan."""
raise NotImplementedError() raise NotImplementedError()
# pylint: disable=arguments-differ
async def async_turn_on_compat( async def async_turn_on_compat(
self, self,
speed: Optional[str] = None, speed: Optional[str] = None,

View file

@ -175,7 +175,7 @@ def _create_flume_device_coordinator(hass, flume_device):
_LOGGER.debug("Updating Flume data") _LOGGER.debug("Updating Flume data")
try: try:
await hass.async_add_executor_job(flume_device.update_force) 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 raise UpdateFailed(f"Error communicating with flume API: {ex}") from ex
_LOGGER.debug( _LOGGER.debug(
"Flume update details: %s", "Flume update details: %s",

View file

@ -17,8 +17,7 @@ from homeassistant.const import (
) )
from homeassistant.data_entry_flow import AbortFlow from homeassistant.data_entry_flow import AbortFlow
from .const import CONF_RTSP_PORT, CONF_STREAM, LOGGER from .const import CONF_RTSP_PORT, CONF_STREAM, DOMAIN, LOGGER
from .const import DOMAIN # pylint:disable=unused-import
STREAMS = ["Main", "Sub"] STREAMS = ["Main", "Sub"]

View file

@ -13,7 +13,6 @@ from homeassistant.components.ssdp import (
) )
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
# pylint:disable=unused-import
from .const import DEFAULT_HOST, DEFAULT_USERNAME, DOMAIN from .const import DEFAULT_HOST, DEFAULT_USERNAME, DOMAIN
DATA_SCHEMA_USER = vol.Schema( DATA_SCHEMA_USER = vol.Schema(

View file

@ -25,7 +25,6 @@ CONFIG_SCHEMA = vol.Schema(
) )
# pylint: disable=no-member
def setup(hass, base_config): def setup(hass, base_config):
"""Set up the gc100 component.""" """Set up the gc100 component."""
config = base_config[DOMAIN] config = base_config[DOMAIN]

View file

@ -173,7 +173,6 @@ class GeniusBroker:
@property @property
def hub_uid(self) -> int: def hub_uid(self) -> int:
"""Return the Hub UID (MAC address).""" """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 return self._hub_uid if self._hub_uid is not None else self.client.uid
async def async_update(self, now, **kwargs) -> None: async def async_update(self, now, **kwargs) -> None:

View file

@ -3,7 +3,7 @@ import copy
from datetime import timedelta from datetime import timedelta
import logging import logging
from httplib2 import ServerNotFoundError # pylint: disable=import-error from httplib2 import ServerNotFoundError
from homeassistant.components.calendar import ( from homeassistant.components.calendar import (
ENTITY_ID_FORMAT, ENTITY_ID_FORMAT,

View file

@ -57,9 +57,7 @@ def setup(hass: HomeAssistant, yaml_config: Dict[str, Any]):
service_principal_path service_principal_path
) )
topic_path = publisher.topic_path( # pylint: disable=no-member topic_path = publisher.topic_path(project_id, topic_name)
project_id, topic_name
)
encoder = DateTimeJSONEncoder() encoder = DateTimeJSONEncoder()

View file

@ -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 # because we want a handy alias

View file

@ -3,7 +3,7 @@ import logging
from homeassistant import config_entries from homeassistant import config_entries
from . import DOMAIN # pylint:disable=unused-import from . import DOMAIN
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -4,13 +4,9 @@ from functools import reduce
import logging import logging
import multiprocessing import multiprocessing
from pycec.cec import CecAdapter # pylint: disable=import-error from pycec.cec import CecAdapter
from pycec.commands import ( # pylint: disable=import-error from pycec.commands import CecCommand, KeyPressCommand, KeyReleaseCommand
CecCommand, from pycec.const import (
KeyPressCommand,
KeyReleaseCommand,
)
from pycec.const import ( # pylint: disable=import-error
ADDR_AUDIOSYSTEM, ADDR_AUDIOSYSTEM,
ADDR_BROADCAST, ADDR_BROADCAST,
ADDR_UNREGISTERED, ADDR_UNREGISTERED,
@ -25,8 +21,8 @@ from pycec.const import ( # pylint: disable=import-error
STATUS_STILL, STATUS_STILL,
STATUS_STOP, STATUS_STOP,
) )
from pycec.network import HDMINetwork, PhysicalAddress # pylint: disable=import-error from pycec.network import HDMINetwork, PhysicalAddress
from pycec.tcp import TcpAdapter # pylint: disable=import-error from pycec.tcp import TcpAdapter
import voluptuous as vol import voluptuous as vol
from homeassistant.components.media_player import DOMAIN as MEDIA_PLAYER from homeassistant.components.media_player import DOMAIN as MEDIA_PLAYER

View file

@ -1,12 +1,8 @@
"""Support for HDMI CEC devices as media players.""" """Support for HDMI CEC devices as media players."""
import logging import logging
from pycec.commands import ( # pylint: disable=import-error from pycec.commands import CecCommand, KeyPressCommand, KeyReleaseCommand
CecCommand, from pycec.const import (
KeyPressCommand,
KeyReleaseCommand,
)
from pycec.const import ( # pylint: disable=import-error
KEY_BACKWARD, KEY_BACKWARD,
KEY_FORWARD, KEY_FORWARD,
KEY_MUTE_TOGGLE, KEY_MUTE_TOGGLE,

View file

@ -457,11 +457,9 @@ class HERETravelTimeData:
_LOGGER.debug("Raw response is: %s", response.response) _LOGGER.debug("Raw response is: %s", response.response)
# pylint: disable=no-member
source_attribution = response.response.get("sourceAttribution") source_attribution = response.response.get("sourceAttribution")
if source_attribution is not None: if source_attribution is not None:
self.attribution = self._build_hass_attribution(source_attribution) self.attribution = self._build_hass_attribution(source_attribution)
# pylint: disable=no-member
route = response.response["route"] route = response.response["route"]
summary = route[0]["summary"] summary = route[0]["summary"]
waypoint = route[0]["waypoint"] waypoint = route[0]["waypoint"]
@ -477,7 +475,6 @@ class HERETravelTimeData:
else: else:
# Convert to kilometers # Convert to kilometers
self.distance = distance / 1000 self.distance = distance / 1000
# pylint: disable=no-member
self.route = response.route_short self.route = response.route_short
self.origin_name = waypoint[0]["mappedRoadName"] self.origin_name = waypoint[0]["mappedRoadName"]
self.destination_name = waypoint[1]["mappedRoadName"] self.destination_name = waypoint[1]["mappedRoadName"]

View file

@ -42,7 +42,6 @@ from homeassistant.helpers.reload import async_integration_yaml_config
from homeassistant.loader import IntegrationNotFound, async_get_integration from homeassistant.loader import IntegrationNotFound, async_get_integration
from homeassistant.util import get_local_ip from homeassistant.util import get_local_ip
# pylint: disable=unused-import
from . import ( # noqa: F401 from . import ( # noqa: F401
type_cameras, type_cameras,
type_covers, type_covers,

View file

@ -36,13 +36,13 @@ from .const import (
DEFAULT_AUTO_START, DEFAULT_AUTO_START,
DEFAULT_CONFIG_FLOW_PORT, DEFAULT_CONFIG_FLOW_PORT,
DEFAULT_HOMEKIT_MODE, DEFAULT_HOMEKIT_MODE,
DOMAIN,
HOMEKIT_MODE_ACCESSORY, HOMEKIT_MODE_ACCESSORY,
HOMEKIT_MODE_BRIDGE, HOMEKIT_MODE_BRIDGE,
HOMEKIT_MODES, HOMEKIT_MODES,
SHORT_BRIDGE_NAME, SHORT_BRIDGE_NAME,
VIDEO_CODEC_COPY, VIDEO_CODEC_COPY,
) )
from .const import DOMAIN # pylint:disable=unused-import
from .util import async_find_next_available_port, state_needs_accessory_mode from .util import async_find_next_available_port, state_needs_accessory_mode
CONF_CAMERA_COPY = "camera_copy" CONF_CAMERA_COPY = "camera_copy"

View file

@ -4,7 +4,7 @@ from functools import partial
import logging import logging
from i2csense.htu21d import HTU21D # pylint: disable=import-error from i2csense.htu21d import HTU21D # pylint: disable=import-error
import smbus # pylint: disable=import-error import smbus
import voluptuous as vol import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.components.sensor import PLATFORM_SCHEMA

View file

@ -92,7 +92,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
raise UpdateFailed(f"Authentication failed: {err}") from err raise UpdateFailed(f"Authentication failed: {err}") from err
except ClientConnectorError as err: except ClientConnectorError as err:
raise UpdateFailed(f"Network not available: {err}") from 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 raise UpdateFailed(f"Error occurred while fetching data: {err}") from err
coordinator = DataUpdateCoordinator( coordinator = DataUpdateCoordinator(

View file

@ -11,12 +11,7 @@ from homeassistant.core import callback
from homeassistant.helpers import aiohttp_client from homeassistant.helpers import aiohttp_client
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from .const import ( # pylint:disable=unused-import from .const import CONF_FILTER, CONF_REAL_TIME, CONF_STATION, DOMAIN
CONF_FILTER,
CONF_REAL_TIME,
CONF_STATION,
DOMAIN,
)
from .hub import GTIHub from .hub import GTIHub
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -221,7 +221,6 @@ class HyperionConfigFlow(ConfigFlow, domain=DOMAIN):
return self.async_abort(reason="cannot_connect") return self.async_abort(reason="cannot_connect")
return await self._advance_to_auth_step_if_necessary(hyperion_client) return await self._advance_to_auth_step_if_necessary(hyperion_client)
# pylint: disable=arguments-differ
async def async_step_user( async def async_step_user(
self, self,
user_input: Optional[ConfigType] = None, user_input: Optional[ConfigType] = None,

View file

@ -553,7 +553,6 @@ class HyperionPriorityLight(HyperionBaseLight):
return True return True
return False return False
# pylint: disable=no-self-use
def _allow_priority_update(self, priority: Optional[Dict[str, Any]] = None) -> bool: def _allow_priority_update(self, priority: Optional[Dict[str, Any]] = None) -> bool:
"""Determine whether to allow a Hyperion priority to update entity attributes.""" """Determine whether to allow a Hyperion priority to update entity attributes."""
# Black is treated as 'off' (and Home Assistant does not support selecting black # Black is treated as 'off' (and Home Assistant does not support selecting black

View file

@ -178,12 +178,10 @@ class HyperionComponentSwitch(SwitchEntity):
} }
) )
# pylint: disable=unused-argument
async def async_turn_on(self, **kwargs: Any) -> None: async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn on the switch.""" """Turn on the switch."""
await self._async_send_set_component(True) await self._async_send_set_component(True)
# pylint: disable=unused-argument
async def async_turn_off(self, **kwargs: Any) -> None: async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn off the switch.""" """Turn off the switch."""
await self._async_send_set_component(False) await self._async_send_set_component(False)

View file

@ -21,10 +21,10 @@ from .const import (
DEFAULT_GPS_ACCURACY_THRESHOLD, DEFAULT_GPS_ACCURACY_THRESHOLD,
DEFAULT_MAX_INTERVAL, DEFAULT_MAX_INTERVAL,
DEFAULT_WITH_FAMILY, DEFAULT_WITH_FAMILY,
DOMAIN,
STORAGE_KEY, STORAGE_KEY,
STORAGE_VERSION, STORAGE_VERSION,
) )
from .const import DOMAIN # pylint: disable=unused-import
CONF_TRUSTED_DEVICE = "trusted_device" CONF_TRUSTED_DEVICE = "trusted_device"
CONF_VERIFICATION_CODE = "verification_code" CONF_VERIFICATION_CODE = "verification_code"

View file

@ -29,7 +29,6 @@ ATTR_COUNTER = "counter"
class ColorTempModes(Enum): class ColorTempModes(Enum):
# pylint: disable=invalid-name
"""Color temperature modes for config validation.""" """Color temperature modes for config validation."""
ABSOLUTE = "DPT-7.600" ABSOLUTE = "DPT-7.600"
@ -37,7 +36,6 @@ class ColorTempModes(Enum):
class SupportedPlatforms(Enum): class SupportedPlatforms(Enum):
# pylint: disable=invalid-name
"""Supported platforms.""" """Supported platforms."""
BINARY_SENSOR = "binary_sensor" BINARY_SENSOR = "binary_sensor"

View file

@ -27,7 +27,7 @@ from .const import (
DATA_LCN, DATA_LCN,
DOMAIN, DOMAIN,
) )
from .schemas import CONFIG_SCHEMA # noqa: 401 from .schemas import CONFIG_SCHEMA # noqa: F401
from .services import ( from .services import (
DynText, DynText,
Led, Led,

View file

@ -1,5 +1,5 @@
"""Support for LIRC devices.""" """Support for LIRC devices."""
# pylint: disable=no-member, import-error # pylint: disable=import-error
import logging import logging
import threading import threading
import time import time

View file

@ -34,7 +34,7 @@ from .const import (
STORAGE_DASHBOARD_UPDATE_FIELDS, STORAGE_DASHBOARD_UPDATE_FIELDS,
url_slug, url_slug,
) )
from .system_health import system_health_info # NOQA from .system_health import system_health_info # noqa: F401
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -1,8 +1,8 @@
"""Support for binary sensor using I2C MCP23017 chip.""" """Support for binary sensor using I2C MCP23017 chip."""
from adafruit_mcp230xx.mcp23017 import MCP23017 # pylint: disable=import-error from adafruit_mcp230xx.mcp23017 import MCP23017
import board # pylint: disable=import-error import board
import busio # pylint: disable=import-error import busio
import digitalio # pylint: disable=import-error import digitalio
import voluptuous as vol import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity

View file

@ -1,8 +1,8 @@
"""Support for switch sensor using I2C MCP23017 chip.""" """Support for switch sensor using I2C MCP23017 chip."""
from adafruit_mcp230xx.mcp23017 import MCP23017 # pylint: disable=import-error from adafruit_mcp230xx.mcp23017 import MCP23017
import board # pylint: disable=import-error import board
import busio # pylint: disable=import-error import busio
import digitalio # pylint: disable=import-error import digitalio
import voluptuous as vol import voluptuous as vol
from homeassistant.components.switch import PLATFORM_SCHEMA from homeassistant.components.switch import PLATFORM_SCHEMA

View file

@ -193,7 +193,6 @@ class MeteoFranceRainSensor(MeteoFranceSensor):
class MeteoFranceAlertSensor(MeteoFranceSensor): class MeteoFranceAlertSensor(MeteoFranceSensor):
"""Representation of a Meteo-France alert sensor.""" """Representation of a Meteo-France alert sensor."""
# pylint: disable=super-init-not-called
def __init__(self, sensor_type: str, coordinator: DataUpdateCoordinator): def __init__(self, sensor_type: str, coordinator: DataUpdateCoordinator):
"""Initialize the Meteo-France sensor.""" """Initialize the Meteo-France sensor."""
super().__init__(sensor_type, coordinator) super().__init__(sensor_type, coordinator)

View file

@ -5,7 +5,7 @@ import logging
import btlewrap import btlewrap
from btlewrap import BluetoothBackendException from btlewrap import BluetoothBackendException
from miflora import miflora_poller # pylint: disable=import-error from miflora import miflora_poller
import voluptuous as vol import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.components.sensor import PLATFORM_SCHEMA

View file

@ -144,8 +144,6 @@ class MjpegCamera(Camera):
else: else:
req = requests.get(self._mjpeg_url, stream=True, timeout=10) 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: with closing(req) as response:
return extract_image_from_mjpeg(response.iter_content(102400)) return extract_image_from_mjpeg(response.iter_content(102400))

View file

@ -668,7 +668,7 @@ class MQTT:
will_message = None will_message = None
if will_message is not 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, topic=will_message.topic,
payload=will_message.payload, payload=will_message.payload,
qos=will_message.qos, qos=will_message.qos,
@ -833,7 +833,7 @@ class MQTT:
async def publish_birth_message(birth_message): async def publish_birth_message(birth_message):
await self._ha_started.wait() # Wait for Home Assistant to start await self._ha_started.wait() # Wait for Home Assistant to start
await self._discovery_cooldown() # Wait for MQTT discovery to cool down 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, topic=birth_message.topic,
payload=birth_message.payload, payload=birth_message.payload,
qos=birth_message.qos, qos=birth_message.qos,

View file

@ -242,7 +242,6 @@ class MqttBinarySensor(MqttEntity, BinarySensorEntity):
def available(self) -> bool: def available(self) -> bool:
"""Return true if the device is available and value has not expired.""" """Return true if the device is available and value has not expired."""
expire_after = self._config.get(CONF_EXPIRE_AFTER) expire_after = self._config.get(CONF_EXPIRE_AFTER)
# pylint: disable=no-member
return MqttAvailability.available.fget(self) and ( return MqttAvailability.available.fget(self) and (
expire_after is None or not self._expired expire_after is None or not self._expired
) )

View file

@ -197,7 +197,6 @@ class MqttSensor(MqttEntity, Entity):
def available(self) -> bool: def available(self) -> bool:
"""Return true if the device is available and value has not expired.""" """Return true if the device is available and value has not expired."""
expire_after = self._config.get(CONF_EXPIRE_AFTER) expire_after = self._config.get(CONF_EXPIRE_AFTER)
# pylint: disable=no-member
return MqttAvailability.available.fget(self) and ( return MqttAvailability.available.fget(self) and (
expire_after is None or not self._expired expire_after is None or not self._expired
) )

View file

@ -29,7 +29,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
class MullvadBinarySensor(CoordinatorEntity, BinarySensorEntity): class MullvadBinarySensor(CoordinatorEntity, BinarySensorEntity):
"""Represents a Mullvad binary sensor.""" """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.""" """Initialize the Mullvad binary sensor."""
super().__init__(coordinator) super().__init__(coordinator)
self.id = sensor[CONF_ID] self.id = sensor[CONF_ID]

View file

@ -5,7 +5,7 @@ from mullvad_api import MullvadAPI, MullvadAPIError
from homeassistant import config_entries from homeassistant import config_entries
from .const import DOMAIN # pylint:disable=unused-import from .const import DOMAIN
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -23,8 +23,6 @@ from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import CONF_RETAIN, CONF_VERSION, DEFAULT_VERSION from . import CONF_RETAIN, CONF_VERSION, DEFAULT_VERSION
# pylint: disable=unused-import
from .const import ( from .const import (
CONF_BAUD_RATE, CONF_BAUD_RATE,
CONF_GATEWAY_TYPE, CONF_GATEWAY_TYPE,

View file

@ -8,7 +8,6 @@ from homeassistant import config_entries
from homeassistant.const import CONF_TOKEN from homeassistant.const import CONF_TOKEN
from homeassistant.helpers import config_entry_oauth2_flow from homeassistant.helpers import config_entry_oauth2_flow
# pylint: disable=unused-import
from .const import NEATO_DOMAIN from .const import NEATO_DOMAIN

View file

@ -2,7 +2,7 @@
from datetime import datetime, timedelta from datetime import datetime, timedelta
import logging import logging
import noaa_coops as coops # pylint: disable=import-error import noaa_coops as coops
import requests import requests
import voluptuous as vol import voluptuous as vol

View file

@ -9,7 +9,7 @@ from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import callback from homeassistant.core import callback
from homeassistant.helpers import aiohttp_client 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__) _LOGGER = logging.getLogger(__name__)

View file

@ -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.const import CONF_HOST, CONF_PORT, CONF_TYPE
from homeassistant.helpers.typing import HomeAssistantType from homeassistant.helpers.typing import HomeAssistantType
from .const import ( # pylint: disable=unused-import from .const import (
CONF_MOUNT_DIR, CONF_MOUNT_DIR,
CONF_TYPE_OWFS, CONF_TYPE_OWFS,
CONF_TYPE_OWSERVER, CONF_TYPE_OWSERVER,

View file

@ -4,7 +4,7 @@ import secrets
from homeassistant import config_entries from homeassistant import config_entries
from homeassistant.const import CONF_WEBHOOK_ID 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 from .helper import supports_encryption
CONF_SECRET = "secret" CONF_SECRET = "secret"

View file

@ -7,8 +7,7 @@ from homeassistant import config_entries
from homeassistant.core import callback from homeassistant.core import callback
from homeassistant.data_entry_flow import AbortFlow from homeassistant.data_entry_flow import AbortFlow
from .const import CONF_INTEGRATION_CREATED_ADDON, CONF_USE_ADDON from .const import CONF_INTEGRATION_CREATED_ADDON, CONF_USE_ADDON, DOMAIN
from .const import DOMAIN # pylint:disable=unused-import
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -1,5 +1,5 @@
"""Support for binary sensor using RPi GPIO.""" """Support for binary sensor using RPi GPIO."""
from pi4ioe5v9xxxx import pi4ioe5v9xxxx # pylint: disable=import-error from pi4ioe5v9xxxx import pi4ioe5v9xxxx
import voluptuous as vol import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity

View file

@ -1,5 +1,5 @@
"""Allows to configure a switch using RPi GPIO.""" """Allows to configure a switch using RPi GPIO."""
from pi4ioe5v9xxxx import pi4ioe5v9xxxx # pylint: disable=import-error from pi4ioe5v9xxxx import pi4ioe5v9xxxx
import voluptuous as vol import voluptuous as vol
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity

View file

@ -27,7 +27,7 @@ from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.network import get_url from homeassistant.helpers.network import get_url
from .const import ( # pylint: disable=unused-import from .const import (
AUTH_CALLBACK_NAME, AUTH_CALLBACK_NAME,
AUTH_CALLBACK_PATH, AUTH_CALLBACK_PATH,
AUTOMATIC_SETUP_STRING, AUTOMATIC_SETUP_STRING,

View file

@ -189,7 +189,7 @@ class PlexServer:
_connect_with_url() _connect_with_url()
except requests.exceptions.SSLError as error: except requests.exceptions.SSLError as error:
while error and not isinstance(error, ssl.SSLCertVerificationError): while error and not isinstance(error, ssl.SSLCertVerificationError):
error = error.__context__ # pylint: disable=no-member error = error.__context__
if isinstance(error, ssl.SSLCertVerificationError): if isinstance(error, ssl.SSLCertVerificationError):
domain = urlparse(self._url).netloc.split(":")[0] domain = urlparse(self._url).netloc.split(":")[0]
if domain.endswith("plex.direct") and error.args[0].startswith( if domain.endswith("plex.direct") and error.args[0].startswith(

View file

@ -25,7 +25,7 @@ from homeassistant.helpers.typing import HomeAssistantType
from homeassistant.util import location from homeassistant.util import location
from homeassistant.util.json import load_json, save_json 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 from .const import ATTR_MEDIA_IMAGE_URL, COMMANDS, DOMAIN, GAMES_FILE, PS4_DATA
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -35,7 +35,7 @@ from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
from .const import COORDINATOR, DOMAIN, PLATFORM_IDX, REST, REST_IDX from .const import COORDINATOR, DOMAIN, PLATFORM_IDX, REST, REST_IDX
from .data import RestData 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__) _LOGGER = logging.getLogger(__name__)

View file

@ -45,7 +45,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
) )
# pylint: disable=no-member
def setup_platform(hass, config, add_entities, discovery_info=None): def setup_platform(hass, config, add_entities, discovery_info=None):
"""Find and return switches controlled by a generic RF device via GPIO.""" """Find and return switches controlled by a generic RF device via GPIO."""
rpi_rf = importlib.import_module("rpi_rf") rpi_rf = importlib.import_module("rpi_rf")

View file

@ -99,7 +99,7 @@ class SharkIqUpdateCoordinator(DataUpdateCoordinator):
_LOGGER.debug("Matching flow found") _LOGGER.debug("Matching flow found")
raise UpdateFailed(err) from err raise UpdateFailed(err) from err
except Exception as err: # pylint: disable=broad-except except Exception as err:
_LOGGER.exception("Unexpected error updating SharkIQ") _LOGGER.exception("Unexpected error updating SharkIQ")
raise UpdateFailed(err) from err raise UpdateFailed(err) from err

View file

@ -1,7 +1,7 @@
"""Config flow for SMS integration.""" """Config flow for SMS integration."""
import logging import logging
import gammu # pylint: disable=import-error, no-member import gammu # pylint: disable=import-error
import voluptuous as vol import voluptuous as vol
from homeassistant import config_entries, core, exceptions from homeassistant import config_entries, core, exceptions

View file

@ -1,10 +1,8 @@
"""The sms gateway to interact with a GSM modem.""" """The sms gateway to interact with a GSM modem."""
import logging import logging
import gammu # pylint: disable=import-error, no-member import gammu # pylint: disable=import-error
from gammu.asyncworker import ( # pylint: disable=import-error, no-member from gammu.asyncworker import GammuAsyncWorker # pylint: disable=import-error
GammuAsyncWorker,
)
from homeassistant.core import callback from homeassistant.core import callback
@ -165,6 +163,6 @@ async def create_sms_gateway(config, hass):
gateway = Gateway(worker, hass) gateway = Gateway(worker, hass)
await gateway.init_async() await gateway.init_async()
return gateway return gateway
except gammu.GSMError as exc: # pylint: disable=no-member except gammu.GSMError as exc:
_LOGGER.error("Failed to initialize, error %s", exc) _LOGGER.error("Failed to initialize, error %s", exc)
return None return None

View file

@ -1,7 +1,7 @@
"""Support for SMS notification services.""" """Support for SMS notification services."""
import logging import logging
import gammu # pylint: disable=import-error, no-member import gammu # pylint: disable=import-error
import voluptuous as vol import voluptuous as vol
from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationService
@ -51,8 +51,8 @@ class SMSNotificationService(BaseNotificationService):
} }
try: try:
# Encode messages # Encode messages
encoded = gammu.EncodeSMS(smsinfo) # pylint: disable=no-member encoded = gammu.EncodeSMS(smsinfo)
except gammu.GSMError as exc: # pylint: disable=no-member except gammu.GSMError as exc:
_LOGGER.error("Encoding message %s failed: %s", message, exc) _LOGGER.error("Encoding message %s failed: %s", message, exc)
return return
@ -64,5 +64,5 @@ class SMSNotificationService(BaseNotificationService):
try: try:
# Actually send the message # Actually send the message
await self.gateway.send_sms_async(encoded_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) _LOGGER.error("Sending to %s failed: %s", self.number, exc)

View file

@ -1,7 +1,7 @@
"""Support for SMS dongle sensor.""" """Support for SMS dongle sensor."""
import logging 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.const import DEVICE_CLASS_SIGNAL_STRENGTH, SIGNAL_STRENGTH_DECIBELS
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
@ -71,7 +71,7 @@ class GSMSignalSensor(Entity):
"""Get the latest data from the modem.""" """Get the latest data from the modem."""
try: try:
self._state = await self._gateway.get_signal_quality_async() 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) _LOGGER.error("Failed to read signal quality: %s", exc)
@property @property

View file

@ -19,9 +19,9 @@ from .const import (
CONF_TARGET_ID, CONF_TARGET_ID,
CONF_TARGET_NAME, CONF_TARGET_NAME,
DEFAULT_PORT, DEFAULT_PORT,
DOMAIN,
MYLINK_STATUS, MYLINK_STATUS,
) )
from .const import DOMAIN # pylint:disable=unused-import
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -13,8 +13,8 @@ from .const import (
DEFAULT_NAME, DEFAULT_NAME,
DEFAULT_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL,
DEFAULT_SERVER, DEFAULT_SERVER,
DOMAIN,
) )
from .const import DOMAIN # pylint: disable=unused-import
class SpeedTestFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): class SpeedTestFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):

View file

@ -1,7 +1,7 @@
"""Support for Switchbot.""" """Support for Switchbot."""
from typing import Any, Dict from typing import Any, Dict
# pylint: disable=import-error, no-member # pylint: disable=import-error
import switchbot import switchbot
import voluptuous as vol import voluptuous as vol

View file

@ -1,7 +1,7 @@
"""Support for Switchmate.""" """Support for Switchmate."""
from datetime import timedelta from datetime import timedelta
# pylint: disable=import-error, no-member # pylint: disable=import-error
import switchmate import switchmate
import voluptuous as vol import voluptuous as vol

View file

@ -62,7 +62,6 @@ class SyncThruConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
# Remove trailing " (ip)" if present for consistency with user driven config # Remove trailing " (ip)" if present for consistency with user driven config
self.name = re.sub(r"\s+\([\d.]+\)\s*$", "", self.name) 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} self.context["title_placeholders"] = {CONF_NAME: self.name}
return await self.async_step_confirm() return await self.async_step_confirm()

View file

@ -4,11 +4,7 @@ import voluptuous as vol
from homeassistant import config_entries from homeassistant import config_entries
from homeassistant.components.mqtt import valid_subscribe_topic from homeassistant.components.mqtt import valid_subscribe_topic
from .const import ( # pylint:disable=unused-import from .const import CONF_DISCOVERY_PREFIX, DEFAULT_PREFIX, DOMAIN
CONF_DISCOVERY_PREFIX,
DEFAULT_PREFIX,
DOMAIN,
)
class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN): class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN):

View file

@ -341,9 +341,8 @@ class TensorFlowImageProcessor(ImageProcessingEntity):
start = time.perf_counter() start = time.perf_counter()
try: 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) img = cv2.imdecode(np.asarray(bytearray(image)), cv2.IMREAD_UNCHANGED)
inp = img[:, :, [2, 1, 0]] # BGR->RGB inp = img[:, :, [2, 1, 0]] # BGR->RGB
inp_expanded = inp.reshape(1, inp.shape[0], inp.shape[1], 3) inp_expanded = inp.reshape(1, inp.shape[0], inp.shape[1], 3)

View file

@ -42,11 +42,11 @@ from .const import (
DEFAULT_DISCOVERY_INTERVAL, DEFAULT_DISCOVERY_INTERVAL,
DEFAULT_QUERY_INTERVAL, DEFAULT_QUERY_INTERVAL,
DEFAULT_TUYA_MAX_COLTEMP, DEFAULT_TUYA_MAX_COLTEMP,
DOMAIN,
TUYA_DATA, TUYA_DATA,
TUYA_PLATFORMS, TUYA_PLATFORMS,
TUYA_TYPE_NOT_QUERY, TUYA_TYPE_NOT_QUERY,
) )
from .const import DOMAIN # pylint:disable=unused-import
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -5,7 +5,7 @@ import logging
import async_timeout import async_timeout
from awesomeversion import AwesomeVersion from awesomeversion import AwesomeVersion
from distro import linux_distribution # pylint: disable=import-error from distro import linux_distribution
import voluptuous as vol import voluptuous as vol
from homeassistant.const import __version__ as current_version from homeassistant.const import __version__ as current_version

View file

@ -13,11 +13,7 @@ from homeassistant.const import CONF_EXCLUDE, CONF_LIGHTS, CONF_SOURCE
from homeassistant.core import callback from homeassistant.core import callback
from homeassistant.helpers.entity_registry import EntityRegistry from homeassistant.helpers.entity_registry import EntityRegistry
from .const import ( # pylint: disable=unused-import from .const import CONF_CONTROLLER, CONF_LEGACY_UNIQUE_ID, DOMAIN
CONF_CONTROLLER,
CONF_LEGACY_UNIQUE_ID,
DOMAIN,
)
LIST_REGEX = re.compile("[^0-9]+") LIST_REGEX = re.compile("[^0-9]+")
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -6,9 +6,9 @@ import voluptuous as vol
from homeassistant.core import HomeAssistant, callback from homeassistant.core import HomeAssistant, callback
from homeassistant.loader import bind_hass from homeassistant.loader import bind_hass
from . import commands, connection, const, decorators, http, messages # noqa from . import commands, connection, const, decorators, http, messages # noqa: F401
from .connection import ActiveConnection # noqa from .connection import ActiveConnection # noqa: F401
from .const import ( # noqa from .const import ( # noqa: F401
ERR_HOME_ASSISTANT_ERROR, ERR_HOME_ASSISTANT_ERROR,
ERR_INVALID_FORMAT, ERR_INVALID_FORMAT,
ERR_NOT_FOUND, ERR_NOT_FOUND,
@ -19,13 +19,13 @@ from .const import ( # noqa
ERR_UNKNOWN_COMMAND, ERR_UNKNOWN_COMMAND,
ERR_UNKNOWN_ERROR, ERR_UNKNOWN_ERROR,
) )
from .decorators import ( # noqa from .decorators import ( # noqa: F401
async_response, async_response,
require_admin, require_admin,
websocket_command, websocket_command,
ws_require_user, ws_require_user,
) )
from .messages import ( # noqa from .messages import ( # noqa: F401
BASE_COMMAND_MESSAGE_SCHEMA, BASE_COMMAND_MESSAGE_SCHEMA,
error_message, error_message,
event_message, event_message,

View file

@ -9,7 +9,7 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers.json import JSONEncoder from homeassistant.helpers.json import JSONEncoder
if TYPE_CHECKING: if TYPE_CHECKING:
from .connection import ActiveConnection # noqa from .connection import ActiveConnection
WebSocketCommandHandler = Callable[[HomeAssistant, "ActiveConnection", dict], None] WebSocketCommandHandler = Callable[[HomeAssistant, "ActiveConnection", dict], None]

View file

@ -2,8 +2,7 @@
from dataclasses import dataclass from dataclasses import dataclass
from typing import List, Tuple from typing import List, Tuple
# pylint: disable=no-name-in-module from pydantic.error_wrappers import ValidationError # pylint: disable=no-name-in-module
from pydantic.error_wrappers import ValidationError
from xbox.webapi.api.client import XboxLiveClient from xbox.webapi.api.client import XboxLiveClient
from xbox.webapi.api.provider.catalog.models import FieldsTemplate, Image from xbox.webapi.api.provider.catalog.models import FieldsTemplate, Image
from xbox.webapi.api.provider.gameclips.models import GameclipsResponse from xbox.webapi.api.provider.gameclips.models import GameclipsResponse

View file

@ -1,7 +1,7 @@
"""Support for Xiaomi Mi WiFi Repeater 2.""" """Support for Xiaomi Mi WiFi Repeater 2."""
import logging import logging
from miio import DeviceException, WifiRepeater # pylint: disable=import-error from miio import DeviceException, WifiRepeater
import voluptuous as vol import voluptuous as vol
from homeassistant.components.device_tracker import ( from homeassistant.components.device_tracker import (

View file

@ -4,7 +4,7 @@ from enum import Enum
from functools import partial from functools import partial
import logging import logging
from miio import ( # pylint: disable=import-error from miio import (
AirFresh, AirFresh,
AirHumidifier, AirHumidifier,
AirHumidifierMiot, AirHumidifierMiot,
@ -12,24 +12,24 @@ from miio import ( # pylint: disable=import-error
AirPurifierMiot, AirPurifierMiot,
DeviceException, DeviceException,
) )
from miio.airfresh import ( # pylint: disable=import-error, import-error from miio.airfresh import (
LedBrightness as AirfreshLedBrightness, LedBrightness as AirfreshLedBrightness,
OperationMode as AirfreshOperationMode, OperationMode as AirfreshOperationMode,
) )
from miio.airhumidifier import ( # pylint: disable=import-error, import-error from miio.airhumidifier import (
LedBrightness as AirhumidifierLedBrightness, LedBrightness as AirhumidifierLedBrightness,
OperationMode as AirhumidifierOperationMode, OperationMode as AirhumidifierOperationMode,
) )
from miio.airhumidifier_miot import ( # pylint: disable=import-error, import-error from miio.airhumidifier_miot import (
LedBrightness as AirhumidifierMiotLedBrightness, LedBrightness as AirhumidifierMiotLedBrightness,
OperationMode as AirhumidifierMiotOperationMode, OperationMode as AirhumidifierMiotOperationMode,
PressedButton as AirhumidifierPressedButton, PressedButton as AirhumidifierPressedButton,
) )
from miio.airpurifier import ( # pylint: disable=import-error, import-error from miio.airpurifier import (
LedBrightness as AirpurifierLedBrightness, LedBrightness as AirpurifierLedBrightness,
OperationMode as AirpurifierOperationMode, OperationMode as AirpurifierOperationMode,
) )
from miio.airpurifier_miot import ( # pylint: disable=import-error, import-error from miio.airpurifier_miot import (
LedBrightness as AirpurifierMiotLedBrightness, LedBrightness as AirpurifierMiotLedBrightness,
OperationMode as AirpurifierMiotOperationMode, OperationMode as AirpurifierMiotOperationMode,
) )

View file

@ -6,8 +6,14 @@ from functools import partial
import logging import logging
from math import ceil from math import ceil
from miio import Ceil, DeviceException, PhilipsBulb, PhilipsEyecare, PhilipsMoonlight from miio import (
from miio import Device # pylint: disable=import-error Ceil,
Device,
DeviceException,
PhilipsBulb,
PhilipsEyecare,
PhilipsMoonlight,
)
from miio.gateway import ( from miio.gateway import (
GATEWAY_MODEL_AC_V1, GATEWAY_MODEL_AC_V1,
GATEWAY_MODEL_AC_V2, GATEWAY_MODEL_AC_V2,

View file

@ -4,7 +4,7 @@ from datetime import timedelta
import logging import logging
import time import time
from miio import ChuangmiIr, DeviceException # pylint: disable=import-error from miio import ChuangmiIr, DeviceException
import voluptuous as vol import voluptuous as vol
from homeassistant.components.remote import ( from homeassistant.components.remote import (

View file

@ -2,8 +2,7 @@
from dataclasses import dataclass from dataclasses import dataclass
import logging import logging
from miio import AirQualityMonitor # pylint: disable=import-error from miio import AirQualityMonitor, DeviceException
from miio import DeviceException
from miio.gateway import ( from miio.gateway import (
GATEWAY_MODEL_AC_V1, GATEWAY_MODEL_AC_V1,
GATEWAY_MODEL_AC_V2, GATEWAY_MODEL_AC_V2,

View file

@ -3,9 +3,8 @@ import asyncio
from functools import partial from functools import partial
import logging import logging
from miio import AirConditioningCompanionV3 # pylint: disable=import-error from miio import AirConditioningCompanionV3, ChuangmiPlug, DeviceException, PowerStrip
from miio import ChuangmiPlug, DeviceException, PowerStrip from miio.powerstrip import PowerMode
from miio.powerstrip import PowerMode # pylint: disable=import-error
import voluptuous as vol import voluptuous as vol
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity

View file

@ -2,7 +2,7 @@
from functools import partial from functools import partial
import logging import logging
from miio import DeviceException, Vacuum # pylint: disable=import-error from miio import DeviceException, Vacuum
import voluptuous as vol import voluptuous as vol
from homeassistant.components.vacuum import ( from homeassistant.components.vacuum import (

View file

@ -94,7 +94,7 @@ async def async_setup_entry(hass, config_entry):
if config.get(CONF_ENABLE_QUIRKS, True): if config.get(CONF_ENABLE_QUIRKS, True):
# needs to be done here so that the ZHA module is finished loading # needs to be done here so that the ZHA module is finished loading
# before zhaquirks is imported # 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) zha_gateway = ZHAGateway(hass, config, config_entry)
await zha_gateway.async_initialize() await zha_gateway.async_initialize()

View file

@ -10,7 +10,7 @@ from homeassistant.const import ATTR_DEVICE_ID
from homeassistant.core import callback from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_send from homeassistant.helpers.dispatcher import async_dispatcher_send
from . import ( # noqa: F401 # pylint: disable=unused-import from . import ( # noqa: F401
base, base,
closures, closures,
general, general,

View file

@ -1,5 +1,4 @@
"""Data storage helper for ZHA.""" """Data storage helper for ZHA."""
# pylint: disable=unused-import
from collections import OrderedDict from collections import OrderedDict
import datetime import datetime
import time import time

Some files were not shown because too many files have changed in this diff Show more