Lint cleanup ()

* Remove unneeded inline pylint disables

* Remove unneeded noqa's

* Use symbol names instead of message ids in inline pylint disables
pull/15143/head
Ville Skyttä 2018-06-25 20:05:07 +03:00 committed by Paulus Schoutsen
parent 6c0fc65eaf
commit b92350fb55
137 changed files with 58 additions and 209 deletions

View File

@ -123,7 +123,6 @@ async def async_from_config_dict(config: Dict[str, Any],
components.update(hass.config_entries.async_domains())
# setup components
# pylint: disable=not-an-iterable
res = await core_components.async_setup(hass, config)
if not res:
_LOGGER.error("Home Assistant core failed to initialize. "

View File

@ -154,7 +154,6 @@ def async_setup(hass, config):
return True
# pylint: disable=no-self-use
class AlarmControlPanel(Entity):
"""An abstract class for alarm control devices."""

View File

@ -107,7 +107,6 @@ class _DisplayCategory(object):
THERMOSTAT = "THERMOSTAT"
# Indicates the endpoint is a television.
# pylint: disable=invalid-name
TV = "TV"
@ -1474,9 +1473,6 @@ async def async_api_set_thermostat_mode(hass, config, request, entity):
mode = mode if isinstance(mode, str) else mode['value']
operation_list = entity.attributes.get(climate.ATTR_OPERATION_LIST)
# Work around a pylint false positive due to
# https://github.com/PyCQA/pylint/issues/1830
# pylint: disable=stop-iteration-return
ha_mode = next(
(k for k, v in API_THERMOSTAT_MODES.items() if v == mode),
None

View File

@ -81,7 +81,6 @@ class APIEventStream(HomeAssistantView):
async def get(self, request):
"""Provide a streaming interface for the event bus."""
# pylint: disable=no-self-use
hass = request.app['hass']
stop_obj = object()
to_write = asyncio.Queue(loop=hass.loop)

View File

@ -16,7 +16,6 @@ _LOGGER = logging.getLogger(__name__)
DOMAIN = 'bbb_gpio'
# pylint: disable=no-member
def setup(hass, config):
"""Set up the BeagleBone Black GPIO component."""
# pylint: disable=import-error
@ -34,41 +33,39 @@ def setup(hass, config):
return True
# noqa: F821
def setup_output(pin):
"""Set up a GPIO as output."""
# pylint: disable=import-error,undefined-variable
# pylint: disable=import-error
import Adafruit_BBIO.GPIO as GPIO
GPIO.setup(pin, GPIO.OUT)
def setup_input(pin, pull_mode):
"""Set up a GPIO as input."""
# pylint: disable=import-error,undefined-variable
# pylint: disable=import-error
import Adafruit_BBIO.GPIO as GPIO
GPIO.setup(pin, GPIO.IN, # noqa: F821
GPIO.PUD_DOWN if pull_mode == 'DOWN' # noqa: F821
else GPIO.PUD_UP) # noqa: F821
GPIO.setup(pin, GPIO.IN,
GPIO.PUD_DOWN if pull_mode == 'DOWN'
else GPIO.PUD_UP)
def write_output(pin, value):
"""Write a value to a GPIO."""
# pylint: disable=import-error,undefined-variable
# pylint: disable=import-error
import Adafruit_BBIO.GPIO as GPIO
GPIO.output(pin, value)
def read_input(pin):
"""Read a value from a GPIO."""
# pylint: disable=import-error,undefined-variable
# pylint: disable=import-error
import Adafruit_BBIO.GPIO as GPIO
return GPIO.input(pin) is GPIO.HIGH
def edge_detect(pin, event_callback, bounce):
"""Add detection for RISING and FALLING events."""
# pylint: disable=import-error,undefined-variable
# pylint: disable=import-error
import Adafruit_BBIO.GPIO as GPIO
GPIO.add_event_detect(
pin, GPIO.BOTH, callback=event_callback, bouncetime=bounce)

View File

@ -67,7 +67,6 @@ async def async_unload_entry(hass, entry):
return await hass.data[DOMAIN].async_unload_entry(entry)
# pylint: disable=no-self-use
class BinarySensorDevice(Entity):
"""Represent a binary sensor."""

View File

@ -124,11 +124,11 @@ class BMWConnectedDriveSensor(BinarySensorDevice):
result['check_control_messages'] = check_control_messages
elif self._attribute == 'charging_status':
result['charging_status'] = vehicle_state.charging_status.value
# pylint: disable=W0212
# pylint: disable=protected-access
result['last_charging_end_result'] = \
vehicle_state._attributes['lastChargingEndResult']
if self._attribute == 'connection_status':
# pylint: disable=W0212
# pylint: disable=protected-access
result['connection_status'] = \
vehicle_state._attributes['connectionStatus']
@ -166,7 +166,7 @@ class BMWConnectedDriveSensor(BinarySensorDevice):
# device class plug: On means device is plugged in,
# Off means device is unplugged
if self._attribute == 'connection_status':
# pylint: disable=W0212
# pylint: disable=protected-access
self._state = (vehicle_state._attributes['connectionStatus'] ==
'CONNECTED')

View File

@ -39,7 +39,6 @@ class GC100BinarySensor(BinarySensorDevice):
def __init__(self, name, port_addr, gc100):
"""Initialize the GC100 binary sensor."""
# pylint: disable=no-member
self._name = name or DEVICE_DEFAULT_NAME
self._port_addr = port_addr
self._gc100 = gc100

View File

@ -8,7 +8,7 @@ https://home-assistant.io/components/binary_sensor.isy994/
import asyncio
import logging
from datetime import timedelta
from typing import Callable # noqa
from typing import Callable
from homeassistant.core import callback
from homeassistant.components.binary_sensor import BinarySensorDevice, DOMAIN

View File

@ -58,7 +58,6 @@ class RPiGPIOBinarySensor(BinarySensorDevice):
def __init__(self, name, port, pull_mode, bouncetime, invert_logic):
"""Initialize the RPi binary sensor."""
# pylint: disable=no-member
self._name = name or DEVICE_DEFAULT_NAME
self._port = port
self._pull_mode = pull_mode

View File

@ -13,7 +13,6 @@ DEPENDENCIES = ['wemo']
_LOGGER = logging.getLogger(__name__)
# pylint: disable=too-many-function-args
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
"""Register discovered WeMo binary sensors."""
import pywemo.discovery as discovery

View File

@ -89,9 +89,7 @@ class GoogleCalendarData(object):
params['timeMin'] = start_date.isoformat('T')
params['timeMax'] = end_date.isoformat('T')
# pylint: disable=no-member
events = await hass.async_add_job(service.events)
# pylint: enable=no-member
result = await hass.async_add_job(events.list(**params).execute)
items = result.get('items', [])
@ -111,7 +109,7 @@ class GoogleCalendarData(object):
service, params = self._prepare_query()
params['timeMin'] = dt.now().isoformat('T')
events = service.events() # pylint: disable=no-member
events = service.events()
result = events.list(**params).execute()
items = result.get('items', [])

View File

@ -67,8 +67,6 @@ async def async_setup_platform(hass, config, async_add_devices,
]
for cam in config.get(CONF_CAMERAS, []):
# https://github.com/PyCQA/pylint/issues/1830
# pylint: disable=stop-iteration-return
camera = next(
(dc for dc in discovered_cameras
if dc[CONF_IMAGE_NAME] == cam[CONF_IMAGE_NAME]), None)

View File

@ -470,7 +470,6 @@ async def async_unload_entry(hass, entry):
class ClimateDevice(Entity):
"""Representation of a climate device."""
# pylint: disable=no-self-use
@property
def state(self):
"""Return the current state."""

View File

@ -53,7 +53,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
add_devices(devices)
# pylint: disable=import-error, no-name-in-module
# pylint: disable=import-error
class EQ3BTSmartThermostat(ClimateDevice):
"""Representation of an eQ-3 Bluetooth Smart thermostat."""

View File

@ -263,7 +263,6 @@ class GenericThermostat(ClimateDevice):
@property
def min_temp(self):
"""Return the minimum temperature."""
# pylint: disable=no-member
if self._min_temp:
return self._min_temp
@ -273,7 +272,6 @@ class GenericThermostat(ClimateDevice):
@property
def max_temp(self):
"""Return the maximum temperature."""
# pylint: disable=no-member
if self._max_temp:
return self._max_temp

View File

@ -34,7 +34,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
})
# pylint: disable=unused-variable
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up the heatmiser thermostat."""
from heatmiserV3 import heatmiser, connection

View File

@ -638,11 +638,9 @@ class MqttClimate(MqttAvailability, ClimateDevice):
@property
def min_temp(self):
"""Return the minimum temperature."""
# pylint: disable=no-member
return self._min_temp
@property
def max_temp(self):
"""Return the maximum temperature."""
# pylint: disable=no-member
return self._max_temp

View File

@ -5,7 +5,6 @@ For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/climate.zwave/
"""
# Because we do not compile openzwave on CI
# pylint: disable=import-error
import logging
from homeassistant.components.climate import (
DOMAIN, ClimateDevice, SUPPORT_TARGET_TEMPERATURE, SUPPORT_FAN_MODE,

View File

@ -198,7 +198,6 @@ async def async_setup(hass, config):
class CoverDevice(Entity):
"""Representation a cover."""
# pylint: disable=no-self-use
@property
def current_cover_position(self):
"""Return current position of cover.

View File

@ -24,7 +24,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
class DemoCover(CoverDevice):
"""Representation of a demo cover."""
# pylint: disable=no-self-use
def __init__(self, hass, name, position=None, tilt_position=None,
device_class=None, supported_features=None):
"""Initialize the cover."""

View File

@ -73,7 +73,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
class GaradgetCover(CoverDevice):
"""Representation of a Garadget cover."""
# pylint: disable=no-self-use
def __init__(self, hass, args):
"""Initialize the cover."""
self.particle_url = 'https://api.particle.io'

View File

@ -5,7 +5,7 @@ For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/cover.isy994/
"""
import logging
from typing import Callable # noqa
from typing import Callable
from homeassistant.components.cover import CoverDevice, DOMAIN
from homeassistant.components.isy994 import (ISY994_NODES, ISY994_PROGRAMS,

View File

@ -72,7 +72,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
class OpenGarageCover(CoverDevice):
"""Representation of a OpenGarage cover."""
# pylint: disable=no-self-use
def __init__(self, hass, args):
"""Initialize the cover."""
self.opengarage_url = 'http://{}:{}'.format(

View File

@ -42,7 +42,6 @@ class ZwaveRollershutter(zwave.ZWaveDeviceEntity, CoverDevice):
def __init__(self, hass, values, invert_buttons):
"""Initialize the Z-Wave rollershutter."""
ZWaveDeviceEntity.__init__(self, values, DOMAIN)
# pylint: disable=no-member
self._network = hass.data[zwave.const.DATA_NETWORK]
self._open_id = None
self._close_id = None

View File

@ -50,7 +50,6 @@ class CiscoDeviceScanner(DeviceScanner):
self.success_init = self._update_info()
_LOGGER.info('cisco_ios scanner initialized')
# pylint: disable=no-self-use
def get_device_name(self, device):
"""Get the firmware doesn't save the name of the wireless device."""
return None

View File

@ -7,7 +7,7 @@ https://home-assistant.io/components/device_tracker.gpslogger/
import logging
from hmac import compare_digest
from aiohttp.web import Request, HTTPUnauthorized # NOQA
from aiohttp.web import Request, HTTPUnauthorized
import voluptuous as vol
import homeassistant.helpers.config_validation as cv

View File

@ -61,7 +61,6 @@ class LinksysAPDeviceScanner(DeviceScanner):
return self.last_results
# pylint: disable=no-self-use
def get_device_name(self, device):
"""
Return the name (if known) of the device.

View File

@ -74,8 +74,6 @@ class SnmpScanner(DeviceScanner):
return [client['mac'] for client in self.last_results
if client.get('mac')]
# Suppressing no-self-use warning
# pylint: disable=R0201
def get_device_name(self, device):
"""Return the name of the given device or None if we don't know."""
# We have no names
@ -106,7 +104,6 @@ class SnmpScanner(DeviceScanner):
if errindication:
_LOGGER.error("SNMPLIB error: %s", errindication)
return
# pylint: disable=no-member
if errstatus:
_LOGGER.error("SNMP error: %s at %s", errstatus.prettyPrint(),
errindex and restable[int(errindex) - 1][0] or '?')

View File

@ -68,7 +68,6 @@ class TplinkDeviceScanner(DeviceScanner):
self._update_info()
return self.last_results
# pylint: disable=no-self-use
def get_device_name(self, device):
"""Get firmware doesn't save the name of the wireless device."""
return None
@ -103,7 +102,6 @@ class Tplink2DeviceScanner(TplinkDeviceScanner):
self._update_info()
return self.last_results.keys()
# pylint: disable=no-self-use
def get_device_name(self, device):
"""Get firmware doesn't save the name of the wireless device."""
return self.last_results.get(device)
@ -164,7 +162,6 @@ class Tplink3DeviceScanner(TplinkDeviceScanner):
self._log_out()
return self.last_results.keys()
# pylint: disable=no-self-use
def get_device_name(self, device):
"""Get the firmware doesn't save the name of the wireless device.
@ -273,7 +270,6 @@ class Tplink4DeviceScanner(TplinkDeviceScanner):
self._update_info()
return self.last_results
# pylint: disable=no-self-use
def get_device_name(self, device):
"""Get the name of the wireless device."""
return None
@ -349,7 +345,6 @@ class Tplink5DeviceScanner(TplinkDeviceScanner):
self._update_info()
return self.last_results.keys()
# pylint: disable=no-self-use
def get_device_name(self, device):
"""Get firmware doesn't save the name of the wireless device."""
return None

View File

@ -105,7 +105,6 @@ def setup(hass, config):
Will automatically load thermostat and sensor components to support
devices discovered on the network.
"""
# pylint: disable=import-error
global NETWORK
if 'ecobee' in _CONFIGURING:

View File

@ -31,7 +31,7 @@ CONFIG_SCHEMA = vol.Schema({
}, extra=vol.ALLOW_EXTRA)
# pylint: disable=no-member, import-self
# pylint: disable=no-member
def setup(hass, base_config):
"""Set up the gc100 component."""
import gc100

View File

@ -197,7 +197,7 @@ def setup_services(hass, track_new_found_calendars, calendar_service):
def _scan_for_calendars(service):
"""Scan for new calendars."""
service = calendar_service.get()
cal_list = service.calendarList() # pylint: disable=no-member
cal_list = service.calendarList()
calendars = cal_list.list().execute()['items']
for calendar in calendars:
calendar['track'] = track_new_found_calendars

View File

@ -13,9 +13,8 @@ import async_timeout
import voluptuous as vol
# Typing imports
# pylint: disable=using-constant-test,unused-import,ungrouped-imports
from homeassistant.core import HomeAssistant # NOQA
from typing import Dict, Any # NOQA
from homeassistant.core import HomeAssistant
from typing import Dict, Any
from homeassistant.const import CONF_NAME
from homeassistant.helpers import config_validation as cv

View File

@ -3,12 +3,11 @@
import logging
# Typing imports
# pylint: disable=using-constant-test,unused-import,ungrouped-imports
# if False:
from aiohttp.web import Request, Response # NOQA
from typing import Dict, Any # NOQA
from aiohttp.web import Request, Response
from typing import Dict, Any
from homeassistant.core import HomeAssistant # NOQA
from homeassistant.core import HomeAssistant
from homeassistant.components.http import HomeAssistantView
from homeassistant.const import (
HTTP_BAD_REQUEST,

View File

@ -7,10 +7,10 @@ https://home-assistant.io/components/google_assistant/
import logging
from aiohttp.hdrs import AUTHORIZATION
from aiohttp.web import Request, Response # NOQA
from aiohttp.web import Request, Response
# Typing imports
# pylint: disable=using-constant-test,unused-import,ungrouped-imports
# pylint: disable=unused-import
from homeassistant.components.http import HomeAssistantView
from homeassistant.core import HomeAssistant, callback # NOQA
from homeassistant.helpers.entity import Entity # NOQA

View File

@ -4,7 +4,7 @@ from itertools import product
import logging
# Typing imports
# pylint: disable=using-constant-test,unused-import,ungrouped-imports
# pylint: disable=unused-import
# if False:
from aiohttp.web import Request, Response # NOQA
from typing import Dict, Tuple, Any, Optional # NOQA

View File

@ -226,7 +226,6 @@ class HomeKitEntity(Entity):
self._securecon.put('/characteristics', body)
# pylint: too-many-function-args
def setup(hass, config):
"""Set up for Homekit devices."""
def discovery_dispatch(service, discovery_info):

View File

@ -18,7 +18,6 @@ class CachingStaticResource(StaticResource):
filename = URL(request.match_info['filename']).path
try:
# PyLint is wrong about resolve not being a member.
# pylint: disable=no-member
filepath = self._directory.joinpath(filename).resolve()
if not self._follow_symlinks:
filepath.relative_to(self._directory)

View File

@ -152,7 +152,6 @@ class OpenCVImageProcessor(ImageProcessingEntity):
import cv2 # pylint: disable=import-error
import numpy
# pylint: disable=no-member
cv_image = cv2.imdecode(
numpy.asarray(bytearray(image)), cv2.IMREAD_UNCHANGED)
@ -168,7 +167,6 @@ class OpenCVImageProcessor(ImageProcessingEntity):
else:
path = classifier
# pylint: disable=no-member
cascade = cv2.CascadeClassifier(path)
detections = cascade.detectMultiScale(

View File

@ -181,7 +181,6 @@ def devices_with_push():
def enabled_push_ids():
"""Return a list of push enabled target push IDs."""
push_ids = list()
# pylint: disable=unused-variable
for device in CONFIG_FILE[ATTR_DEVICES].values():
if device.get(ATTR_PUSH_ID) is not None:
push_ids.append(device.get(ATTR_PUSH_ID))
@ -203,7 +202,6 @@ def device_name_for_push_id(push_id):
def setup(hass, config):
"""Set up the iOS component."""
# pylint: disable=import-error
global CONFIG_FILE
global CONFIG_FILE_PATH

View File

@ -11,12 +11,12 @@ from urllib.parse import urlparse
import voluptuous as vol
from homeassistant.core import HomeAssistant # noqa
from homeassistant.core import HomeAssistant
from homeassistant.const import (
CONF_HOST, CONF_PASSWORD, CONF_USERNAME, EVENT_HOMEASSISTANT_STOP)
from homeassistant.helpers import discovery, config_validation as cv
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.typing import ConfigType, Dict # noqa
from homeassistant.helpers.typing import ConfigType, Dict
REQUIREMENTS = ['PyISY==1.1.0']
@ -268,7 +268,6 @@ def _is_sensor_a_binary_sensor(hass: HomeAssistant, node) -> bool:
def _categorize_nodes(hass: HomeAssistant, nodes, ignore_identifier: str,
sensor_identifier: str)-> None:
"""Sort the nodes to their proper domains."""
# pylint: disable=no-member
for (path, node) in nodes:
ignored = ignore_identifier in path or ignore_identifier in node.name
if ignored:

View File

@ -151,7 +151,6 @@ class KeyboardRemoteThread(threading.Thread):
if not event:
continue
# pylint: disable=no-member
if event.type is ecodes.EV_KEY and event.value is self.key_value:
_LOGGER.debug(categorize(event))
self.hass.bus.fire(

View File

@ -10,7 +10,7 @@ import json
import voluptuous as vol
from aiohttp.hdrs import AUTHORIZATION
from aiohttp.web import Request, Response # NOQA
from aiohttp.web import Request, Response
from homeassistant.components.binary_sensor import DEVICE_CLASSES_SCHEMA
from homeassistant.components.discovery import SERVICE_KONNECTED

View File

@ -31,7 +31,6 @@ CONFIG_SCHEMA = vol.Schema({
}, extra=vol.ALLOW_EXTRA)
# pylint: disable=broad-except
def setup(hass, config):
"""Set up the LaMetricManager."""
_LOGGER.debug("Setting up LaMetric platform")

View File

@ -446,8 +446,6 @@ class Profiles:
class Light(ToggleEntity):
"""Representation of a light."""
# pylint: disable=no-self-use
@property
def brightness(self):
"""Return the brightness of this light between 0..255."""

View File

@ -37,7 +37,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up an Avion switch."""
# pylint: disable=import-error, no-member
# pylint: disable=no-member
import avion
lights = []
@ -70,7 +70,7 @@ class AvionLight(Light):
def __init__(self, device):
"""Initialize the light."""
# pylint: disable=import-error, no-member
# pylint: disable=no-member
import avion
self._name = device['name']
@ -117,7 +117,7 @@ class AvionLight(Light):
def set_state(self, brightness):
"""Set the state of this lamp to the provided brightness."""
# pylint: disable=import-error, no-member
# pylint: disable=no-member
import avion
# Bluetooth LE is unreliable, and the connection may drop at any

View File

@ -30,7 +30,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up the Blinkt Light platform."""
# pylint: disable=import-error, no-member
# pylint: disable=no-member
import blinkt
# ensure that the lights are off when exiting

View File

@ -75,7 +75,7 @@ class DecoraLight(Light):
def __init__(self, device):
"""Initialize the light."""
# pylint: disable=import-error, no-member
# pylint: disable=no-member
import decora
self._name = device['name']

View File

@ -36,7 +36,7 @@ NOTIFICATION_TITLE = 'myLeviton Decora Setup'
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up the Decora WiFi platform."""
# pylint: disable=import-error, no-member, no-name-in-module
# pylint: disable=import-error, no-name-in-module
from decora_wifi import DecoraWiFiSession
from decora_wifi.models.person import Person
from decora_wifi.models.residential_account import ResidentialAccount

View File

@ -136,7 +136,7 @@ def state(new_state):
"""
def decorator(function):
"""Set up the decorator function."""
# pylint: disable=no-member,protected-access
# pylint: disable=protected-access
def wrapper(self, **kwargs):
"""Wrap a group state change."""
from limitlessled.pipeline import Pipeline

View File

@ -6,8 +6,6 @@ https://home-assistant.io/components/light.zwave/
"""
import logging
# Because we do not compile openzwave on CI
# pylint: disable=import-error
from threading import Timer
from homeassistant.components.light import (
ATTR_WHITE_VALUE, ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_HS_COLOR,

View File

@ -4,7 +4,7 @@ LIRC interface to receive signals from an infrared remote control.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/lirc/
"""
# pylint: disable=import-error,no-member
# pylint: disable=no-member
import threading
import time
import logging

View File

@ -145,7 +145,6 @@ class LockDevice(Entity):
"""Last change triggered by."""
return None
# pylint: disable=no-self-use
@property
def code_format(self):
"""Regex for code format or None if no code is required."""

View File

@ -5,7 +5,7 @@ For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/lock.isy994/
"""
import logging
from typing import Callable # noqa
from typing import Callable
from homeassistant.components.lock import LockDevice, DOMAIN
from homeassistant.components.isy994 import (ISY994_NODES, ISY994_PROGRAMS,

View File

@ -4,7 +4,7 @@ Support for Sesame, by CANDY HOUSE.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/lock.sesame/
"""
from typing import Callable # noqa
from typing import Callable
import voluptuous as vol
import homeassistant.helpers.config_validation as cv

View File

@ -4,8 +4,6 @@ Z-Wave platform that handles simple door locks.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/lock.zwave/
"""
# Because we do not compile openzwave on CI
# pylint: disable=import-error
import asyncio
import logging

View File

@ -55,7 +55,6 @@ def set_level(hass, logs):
class HomeAssistantLogFilter(logging.Filter):
"""A log filter."""
# pylint: disable=no-init
def __init__(self, logfilter):
"""Initialize the filter."""
super().__init__()

View File

@ -471,7 +471,6 @@ class MediaPlayerDevice(Entity):
_access_token = None
# pylint: disable=no-self-use
# Implement these for your media player
@property
def state(self):

View File

@ -4,7 +4,6 @@ Provide functionality to interact with Cast devices on the network.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.cast/
"""
# pylint: disable=import-error
import logging
import threading
from typing import Optional, Tuple

View File

@ -295,7 +295,6 @@ class DemoMusicPlayer(AbstractDemoPlayer):
@property
def media_album_name(self):
"""Return the album of current playing media (Music track only)."""
# pylint: disable=no-self-use
return "Bounzz"
@property

View File

@ -61,7 +61,6 @@ NewHost = namedtuple('NewHost', ['host', 'name'])
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up the Denon platform."""
# pylint: disable=import-error
import denonavr
# Initialize list with receivers to be started

View File

@ -747,7 +747,6 @@ class PlexClient(MediaPlayerDevice):
if self.device and 'playback' in self._device_protocol_capabilities:
self.device.skipPrevious(self._active_media_plexapi_type)
# pylint: disable=W0613
def play_media(self, media_type, media_id, **kwargs):
"""Play a piece of media."""
if not (self.device and

View File

@ -5,7 +5,6 @@ For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.universal/
"""
import logging
# pylint: disable=import-error
from copy import copy
import voluptuous as vol

View File

@ -75,7 +75,6 @@ HUB = None
def setup(hass, config):
"""Set up Modbus component."""
# Modbus connection type
# pylint: disable=import-error
client_type = config[DOMAIN][CONF_TYPE]
# Connect to Modbus network

View File

@ -44,7 +44,6 @@ def get_service(hass, config, discovery_info=None):
context_b64 = base64.b64encode(context_str.encode('utf-8'))
context = context_b64.decode('utf-8')
# pylint: disable=import-error
import boto3
aws_config = config.copy()

View File

@ -35,7 +35,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
def get_service(hass, config, discovery_info=None):
"""Get the AWS SNS notification service."""
# pylint: disable=import-error
import boto3
aws_config = config.copy()

View File

@ -34,7 +34,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
def get_service(hass, config, discovery_info=None):
"""Get the AWS SQS notification service."""
# pylint: disable=import-error
import boto3
aws_config = config.copy()

View File

@ -25,7 +25,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
})
# pylint: disable=unused-variable
def get_service(hass, config, discovery_info=None):
"""Get the CiscoSpark notification service."""
return CiscoSparkNotificationService(

View File

@ -11,7 +11,7 @@ import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components import ecobee
from homeassistant.components.notify import (
BaseNotificationService, PLATFORM_SCHEMA) # NOQA
BaseNotificationService, PLATFORM_SCHEMA)
_LOGGER = logging.getLogger(__name__)

View File

@ -413,7 +413,6 @@ class HTML5NotificationService(BaseNotificationService):
json.dumps(payload), gcm_key=gcm_key, ttl='86400'
)
# pylint: disable=no-member
if response.status_code == 410:
_LOGGER.info("Notification channel has expired")
reg = self.registrations.pop(target)

View File

@ -28,7 +28,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
})
# pylint: disable=unused-variable
def get_service(hass, config, discovery_info=None):
"""Get the Join notification service."""
api_key = config.get(CONF_API_KEY)

View File

@ -36,7 +36,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
})
# pylint: disable=unused-variable
def get_service(hass, config, discovery_info=None):
"""Get the LaMetric notification service."""
hlmn = hass.data.get(LAMETRIC_DOMAIN)
@ -59,7 +58,6 @@ class LaMetricNotificationService(BaseNotificationService):
self._priority = priority
self._devices = []
# pylint: disable=broad-except
def send_message(self, message="", **kwargs):
"""Send a message to some LaMetric device."""
from lmnotify import SimpleFrame, Sound, Model

View File

@ -26,7 +26,6 @@ PLATFORM_SCHEMA = cv.PLATFORM_SCHEMA.extend({
})
# pylint: disable=unused-variable
def get_service(hass, config, discovery_info=None):
"""Get the Pushover notification service."""
from pushover import InitError

View File

@ -44,7 +44,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
})
# pylint: disable=unused-variable
def get_service(hass, config, discovery_info=None):
"""Get the Slack notification service."""
import slacker

View File

@ -144,7 +144,6 @@ class OctoPrintAPI(object):
return response
# pylint: disable=unused-variable
def get_value_from_json(json_dict, sensor_type, group, tool):
"""Return the value for sensor_type from the JSON."""
if group not in json_dict:

View File

@ -229,7 +229,6 @@ class XiaomiMiioRemote(RemoteDevice):
return {'hidden': 'true'}
return
# pylint: disable=R0201
@asyncio.coroutine
def async_turn_on(self, **kwargs):
"""Turn the device on."""

View File

@ -162,7 +162,6 @@ def get_pt2262_cmd(device_id, data_bits):
return hex(data[-1] & mask)
# pylint: disable=unused-variable
def get_pt2262_device(device_id):
"""Look for the device which id matches the given device_id parameter."""
for device in RFX_DEVICES.values():
@ -176,7 +175,6 @@ def get_pt2262_device(device_id):
return None
# pylint: disable=unused-variable
def find_possible_pt2262_device(device_id):
"""Look for the device which id matches the given device_id parameter."""
for dev_id, device in RFX_DEVICES.items():

View File

@ -17,7 +17,6 @@ _LOGGER = logging.getLogger(__name__)
DOMAIN = 'rpi_gpio'
# pylint: disable=no-member
def setup(hass, config):
"""Set up the Raspberry PI GPIO component."""
import RPi.GPIO as GPIO

View File

@ -4,7 +4,6 @@ Support for Satel Integra devices.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/satel_integra/
"""
# pylint: disable=invalid-name
import asyncio
import logging

View File

@ -121,7 +121,6 @@ class BitcoinSensor(Entity):
stats = self.data.stats
ticker = self.data.ticker
# pylint: disable=no-member
if self.type == 'exchangerate':
self._state = ticker[self._currency].p15min
self._unit_of_measurement = self._currency

View File

@ -287,7 +287,6 @@ class BrSensor(Entity):
img = condition.get(IMAGE, None)
# pylint: disable=protected-access
if new_state != self._state or img != self._entity_picture:
self._state = new_state
self._entity_picture = img
@ -299,12 +298,10 @@ class BrSensor(Entity):
# update nested precipitation forecast sensors
nested = data.get(PRECIPITATION_FORECAST)
self._timeframe = nested.get(TIMEFRAME)
# pylint: disable=protected-access
self._state = nested.get(self.type[len(PRECIPITATION_FORECAST)+1:])
return True
# update all other sensors
# pylint: disable=protected-access
self._state = data.get(self.type)
return True
@ -329,7 +326,7 @@ class BrSensor(Entity):
return self._state
@property
def should_poll(self): # pylint: disable=no-self-use
def should_poll(self):
"""No polling needed."""
return False

View File

@ -30,7 +30,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
})
# pylint: disable=unused-variable
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up the CPU speed sensor."""
name = config.get(CONF_NAME)

View File

@ -128,7 +128,7 @@ class CupsSensor(Entity):
self._printer = self.data.printers.get(self._name)
# pylint: disable=import-error, no-name-in-module
# pylint: disable=no-name-in-module
class CupsData(object):
"""Get the latest data from CUPS and update the state."""

View File

@ -95,7 +95,6 @@ class DwdWeatherWarningsSensor(Entity):
"""Return the unit the value is expressed in."""
return self._var_units
# pylint: disable=no-member
@property
def state(self):
"""Return the state of the device."""
@ -104,7 +103,6 @@ class DwdWeatherWarningsSensor(Entity):
except TypeError:
return self._api.data[self._var_id]
# pylint: disable=no-member
@property
def device_state_attributes(self):
"""Return the state attributes of the DWD-Weather-Warnings."""

View File

@ -34,7 +34,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
})
# pylint: disable=unused-variable, too-many-function-args
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up the Dweet sensor."""
import dweepy

View File

@ -55,7 +55,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up the Sense HAT sensor platform."""
try:
# pylint: disable=import-error
import envirophat
except OSError:
_LOGGER.error("No Enviro pHAT was found.")
@ -175,7 +174,6 @@ class EnvirophatData(object):
self.light_red, self.light_green, self.light_blue = \
self.envirophat.light.rgb()
if self.use_leds:
# pylint: disable=no-value-for-parameter
self.envirophat.leds.off()
# accelerometer readings in G

View File

@ -56,7 +56,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
})
# pylint: disable=unused-variable
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up the Glances sensor."""
name = config.get(CONF_NAME)

View File

@ -86,7 +86,6 @@ class GpsdSensor(Entity):
"""Return the name."""
return self._name
# pylint: disable=no-member
@property
def state(self):
"""Return the state of GPSD."""

View File

@ -5,7 +5,7 @@ For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.isy994/
"""
import logging
from typing import Callable # noqa
from typing import Callable
from homeassistant.components.sensor import DOMAIN
from homeassistant.components.isy994 import (ISY994_NODES, ISY994_WEATHER,

View File

@ -18,7 +18,6 @@ ICON = 'mdi:remote'
CONF_SENSOR = 'sensor'
# pylint: disable=too-many-function-args
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up a Kira sensor."""
if discovery_info is not None:

View File

@ -68,7 +68,6 @@ class LastfmSensor(Entity):
"""Return the state of the sensor."""
return self._state
# pylint: disable=no-member
def update(self):
"""Update device state."""
self._cover = self._user.get_image()

View File

@ -63,7 +63,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
elec_config = config.get(CONF_ELEC)
gas_config = config.get(CONF_GAS, {})
# pylint: disable=too-many-function-args
controller = pyloopenergy.LoopEnergy(
elec_config.get(CONF_ELEC_SERIAL),
elec_config.get(CONF_ELEC_SECRET),

View File

@ -49,7 +49,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
})
# pylint: disable=unused-variable
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up mFi sensors."""
host = config.get(CONF_HOST)

View File

@ -64,7 +64,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
add_devices([PvoutputSensor(rest, name)], True)
# pylint: disable=no-member
class PvoutputSensor(Entity):
"""Representation of a PVOutput sensor."""

View File

@ -41,7 +41,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up the Skybeacon sensor."""
# pylint: disable=unreachable
name = config.get(CONF_NAME)
mac = config.get(CONF_MAC)
_LOGGER.debug("Setting up...")
@ -139,7 +138,7 @@ class Monitor(threading.Thread):
def run(self):
"""Thread that keeps connection alive."""
# pylint: disable=import-error, no-name-in-module, no-member
# pylint: disable=import-error
import pygatt
from pygatt.backends import Characteristic
from pygatt.exceptions import (

View File

@ -198,5 +198,4 @@ class SMAsensor(Entity):
update = True
self._state = new_state
return self.async_update_ha_state() if update else None \
# pylint: disable=protected-access
return self.async_update_ha_state() if update else None

View File

@ -76,7 +76,6 @@ class SteamSensor(Entity):
"""Return the state of the sensor."""
return self._state
# pylint: disable=no-member
def update(self):
"""Update device state."""
try:

View File

@ -147,7 +147,6 @@ class TadoSensor(Entity):
unit = TEMP_CELSIUS
# pylint: disable=R0912
if self.zone_variable == 'temperature':
if 'sensorDataPoints' in data:
sensor_data = data['sensorDataPoints']

View File

@ -32,7 +32,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
})
# pylint: disable=unused-variable
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up the Ted5000 sensor."""
host = config.get(CONF_HOST)

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