Disable too-many-* (#4107)

* Disable too-many-* and too-few-public-methods

* Remove globally disabled pylint warnings
This commit is contained in:
Fabian Affolter authored and GitHub committed 2016-10-30 22:18:53 +01:00
1 parent b910a9917d
commit be272ac64a
298 files changed
+271 -570

No files matched your search

@@ -4,8 +4,6 @@ Provide functionality to keep track of devices.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/device_tracker/
"""
# pylint: disable=too-many-instance-attributes, too-many-arguments
# pylint: disable=too-many-locals
import asyncio
from datetime import timedelta
import logging
@@ -88,7 +86,6 @@ def is_on(hass: HomeAssistantType, entity_id: str=None):
return hass.states.is_state(entity, STATE_HOME)
# pylint: disable=too-many-arguments
def see(hass: HomeAssistantType, mac: str=None, dev_id: str=None,
host_name: str=None, location_name: str=None,
gps: GPSType=None, gps_accuracy=None,
@@ -90,9 +90,7 @@ AsusWrtResult = namedtuple('AsusWrtResult', 'neighbors leases arp')
class AsusWrtDeviceScanner(object):
"""This class queries a router running ASUSWRT firmware."""
# pylint: disable=too-many-instance-attributes, too-many-branches
# Eighth attribute needed for mode (AP mode vs router mode)
def __init__(self, config):
"""Initialize the scanner."""
self.host = config[CONF_HOST]
@@ -60,8 +60,6 @@ def setup_scanner(hass, config: dict, see):
return True
# pylint: disable=too-many-instance-attributes
# pylint: disable=too-few-public-methods
class AutomaticDeviceScanner(object):
"""A class representing an Automatic device."""
@@ -41,7 +41,6 @@ def get_scanner(hass, config):
return None
# pylint: disable=too-many-instance-attributes
class DdWrtDeviceScanner(object):
"""This class queries a wireless router running DD-WRT firmware."""
@@ -38,7 +38,6 @@ def get_scanner(hass, config):
return scanner if scanner.success_init else None
# pylint: disable=too-many-instance-attributes
class FritzBoxScanner(object):
"""This class queries a FRITZ!Box router."""
@@ -51,9 +51,9 @@ class LocativeView(HomeAssistantView):
return res
@asyncio.coroutine
# pylint: disable=too-many-return-statements
def _handle(self, data):
"""Handle locative request."""
# pylint: disable=too-many-return-statements
if 'latitude' not in data or 'longitude' not in data:
return ('Latitude and longitude not specified.',
HTTP_UNPROCESSABLE_ENTITY)
@@ -37,7 +37,6 @@ def get_scanner(hass, config):
return scanner if scanner.success_init else None
# pylint: disable=too-many-instance-attributes
class LuciDeviceScanner(object):
"""This class queries a wireless router running OpenWrt firmware.
@@ -114,10 +114,9 @@ def setup_scanner(hass, config, see):
'for topic %s.', topic)
return None
# pylint: disable=too-many-return-statements
def validate_payload(topic, payload, data_type):
"""Validate the OwnTracks payload."""
# pylint: disable=too-many-return-statements
try:
data = json.loads(payload)
except ValueError:
@@ -49,7 +49,6 @@ def get_scanner(hass, config):
class SnmpScanner(object):
"""Queries any SNMP capable Access Point for connected devices."""
# pylint: disable=too-many-instance-attributes
def __init__(self, config):
"""Initialize the scanner."""
from pysnmp.entity.rfc3413.oneliner import cmdgen
@@ -37,7 +37,6 @@ def get_scanner(hass, config):
return scanner if scanner.success_init else None
# pylint: disable=too-many-instance-attributes
class UbusDeviceScanner(object):
"""
This class queries a wireless router running OpenWrt firmware.