Disable too-many-* (#4107)
* Disable too-many-* and too-few-public-methods * Remove globally disabled pylint warnings
This commit is contained in:
parent
b910a9917d
commit
be272ac64a
298 changed files with 271 additions and 570 deletions
|
@ -99,8 +99,7 @@ def _async_setup_component(hass: core.HomeAssistant,
|
|||
|
||||
This method is a coroutine.
|
||||
"""
|
||||
# pylint: disable=too-many-return-statements,too-many-branches
|
||||
# pylint: disable=too-many-statements
|
||||
# pylint: disable=too-many-return-statements
|
||||
if domain in hass.config.components:
|
||||
return True
|
||||
|
||||
|
@ -312,7 +311,6 @@ def async_prepare_setup_platform(hass: core.HomeAssistant, config, domain: str,
|
|||
return platform
|
||||
|
||||
|
||||
# pylint: disable=too-many-branches, too-many-statements, too-many-arguments
|
||||
def from_config_dict(config: Dict[str, Any],
|
||||
hass: Optional[core.HomeAssistant]=None,
|
||||
config_dir: Optional[str]=None,
|
||||
|
@ -352,7 +350,6 @@ def from_config_dict(config: Dict[str, Any],
|
|||
|
||||
|
||||
@asyncio.coroutine
|
||||
# pylint: disable=too-many-branches, too-many-statements, too-many-arguments
|
||||
def async_from_config_dict(config: Dict[str, Any],
|
||||
hass: core.HomeAssistant,
|
||||
config_dir: Optional[str]=None,
|
||||
|
|
|
@ -42,7 +42,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
add_devices([AlarmDotCom(hass, name, code, username, password)])
|
||||
|
||||
|
||||
# pylint: disable=too-many-arguments, too-many-instance-attributes
|
||||
# pylint: disable=abstract-method
|
||||
class AlarmDotCom(alarm.AlarmControlPanel):
|
||||
"""Represent an Alarm.com status."""
|
||||
|
|
|
@ -43,7 +43,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
class EnvisalinkAlarm(EnvisalinkDevice, alarm.AlarmControlPanel):
|
||||
"""Representation of an Envisalink-based alarm panel."""
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def __init__(self, partition_number, alarm_name, code, panic_type, info,
|
||||
controller):
|
||||
"""Initialize the alarm panel."""
|
||||
|
|
|
@ -50,7 +50,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
)])
|
||||
|
||||
|
||||
# pylint: disable=too-many-arguments, too-many-instance-attributes
|
||||
# pylint: disable=abstract-method
|
||||
class ManualAlarm(alarm.AlarmControlPanel):
|
||||
"""
|
||||
|
|
|
@ -55,7 +55,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
config.get(CONF_CODE))])
|
||||
|
||||
|
||||
# pylint: disable=too-many-arguments, too-many-instance-attributes
|
||||
# pylint: disable=abstract-method
|
||||
class MqttAlarm(alarm.AlarmControlPanel):
|
||||
"""Representation of a MQTT alarm status."""
|
||||
|
|
|
@ -286,7 +286,6 @@ class AlexaFlashBriefingView(HomeAssistantView):
|
|||
self.flash_briefings = copy.deepcopy(flash_briefings)
|
||||
template.attach(hass, self.flash_briefings)
|
||||
|
||||
# pylint: disable=too-many-branches
|
||||
@callback
|
||||
def get(self, request, briefing_id):
|
||||
"""Handle Alexa Flash Briefing request."""
|
||||
|
|
|
@ -219,7 +219,6 @@ class AutomationEntity(ToggleEntity):
|
|||
"""Entity to show status of entity."""
|
||||
|
||||
# pylint: disable=abstract-method
|
||||
# pylint: disable=too-many-arguments, too-many-instance-attributes
|
||||
def __init__(self, name, async_attach_triggers, cond_func, async_action,
|
||||
hidden):
|
||||
"""Initialize an automation entity."""
|
||||
|
|
|
@ -54,7 +54,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
sensor_class, pin)])
|
||||
|
||||
|
||||
# pylint: disable=too-many-instance-attributes, too-many-arguments
|
||||
class ArestBinarySensor(BinarySensorDevice):
|
||||
"""Implement an aREST binary sensor for a pin."""
|
||||
|
||||
|
@ -93,7 +92,6 @@ class ArestBinarySensor(BinarySensorDevice):
|
|||
self.arest.update()
|
||||
|
||||
|
||||
# pylint: disable=too-few-public-methods
|
||||
class ArestData(object):
|
||||
"""Class for handling the data retrieval for pins."""
|
||||
|
||||
|
|
|
@ -53,7 +53,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
value_template)])
|
||||
|
||||
|
||||
# pylint: disable=too-many-arguments, too-many-instance-attributes
|
||||
class CommandBinarySensor(BinarySensorDevice):
|
||||
"""Represent a command line binary sensor."""
|
||||
|
||||
|
|
|
@ -42,7 +42,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
|||
})
|
||||
|
||||
|
||||
# pylint: disable=too-many-locals
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Set up the Concord232 binary sensor platform."""
|
||||
from concord232 import client as concord232_client
|
||||
|
|
|
@ -35,7 +35,6 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
|||
class EnvisalinkBinarySensor(EnvisalinkDevice, BinarySensorDevice):
|
||||
"""Representation of an Envisalink binary sensor."""
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def __init__(self, zone_number, zone_name, zone_type, info, controller):
|
||||
"""Initialize the binary_sensor."""
|
||||
from pydispatch import dispatcher
|
||||
|
|
|
@ -51,7 +51,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
)])
|
||||
|
||||
|
||||
# pylint: disable=too-many-arguments, too-many-instance-attributes
|
||||
class MqttBinarySensor(BinarySensorDevice):
|
||||
"""Representation a binary sensor that is updated by MQTT."""
|
||||
|
||||
|
|
|
@ -58,11 +58,9 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
add_devices(devices)
|
||||
|
||||
|
||||
# pylint: disable=too-many-instance-attributes
|
||||
class OctoPrintBinarySensor(BinarySensorDevice):
|
||||
"""Representation an OctoPrint binary sensor."""
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def __init__(self, api, condition, sensor_type, sensor_name, unit,
|
||||
endpoint, group, tool=None):
|
||||
"""Initialize a new OctoPrint sensor."""
|
||||
|
|
|
@ -41,7 +41,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
|||
})
|
||||
|
||||
|
||||
# pylint: disable=unused-variable, too-many-locals
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Setup the REST binary sensor."""
|
||||
name = config.get(CONF_NAME)
|
||||
|
@ -76,7 +75,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
hass, rest, name, sensor_class, value_template)])
|
||||
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
class RestBinarySensor(BinarySensorDevice):
|
||||
"""Representation of a REST binary sensor."""
|
||||
|
||||
|
|
|
@ -54,7 +54,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
add_devices(binary_sensors)
|
||||
|
||||
|
||||
# pylint: disable=too-many-arguments, too-many-instance-attributes
|
||||
class RPiGPIOBinarySensor(BinarySensorDevice):
|
||||
"""Represent a binary sensor that uses Raspberry Pi GPIO."""
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
add_devices(dev)
|
||||
|
||||
|
||||
# pylint: disable=too-many-instance-attributes
|
||||
class IsInBedBinarySensor(sleepiq.SleepIQSensor, BinarySensorDevice):
|
||||
"""Implementation of a SleepIQ presence sensor."""
|
||||
|
||||
|
|
|
@ -70,7 +70,6 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
|||
class BinarySensorTemplate(BinarySensorDevice):
|
||||
"""A virtual binary sensor that triggers from another sensor."""
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def __init__(self, hass, device, friendly_name, sensor_class,
|
||||
value_template, entity_ids):
|
||||
"""Initialize the Template binary sensor."""
|
||||
|
|
|
@ -72,7 +72,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
class SensorTrend(BinarySensorDevice):
|
||||
"""Representation of a trend Sensor."""
|
||||
|
||||
# pylint: disable=too-many-arguments, too-many-instance-attributes
|
||||
def __init__(self, hass, device_id, friendly_name,
|
||||
target_entity, attribute, sensor_class, invert):
|
||||
"""Initialize the sensor."""
|
||||
|
|
|
@ -33,7 +33,7 @@ CONFIG_SCHEMA = vol.Schema({
|
|||
}, extra=vol.ALLOW_EXTRA)
|
||||
|
||||
|
||||
# pylint: disable=unused-argument,too-few-public-methods
|
||||
# pylint: disable=unused-argument
|
||||
def setup(hass, config):
|
||||
"""Setup BloomSky component."""
|
||||
api_key = config[DOMAIN][CONF_API_KEY]
|
||||
|
|
|
@ -28,7 +28,6 @@ ENTITY_IMAGE_URL = '/api/camera_proxy/{0}?token={1}'
|
|||
|
||||
|
||||
@asyncio.coroutine
|
||||
# pylint: disable=too-many-branches
|
||||
def async_setup(hass, config):
|
||||
"""Setup the camera component."""
|
||||
component = EntityComponent(
|
||||
|
|
|
@ -36,7 +36,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
add_devices([FoscamCamera(config)])
|
||||
|
||||
|
||||
# pylint: disable=too-many-instance-attributes
|
||||
class FoscamCamera(Camera):
|
||||
"""An implementation of a Foscam IP camera."""
|
||||
|
||||
|
|
|
@ -46,7 +46,6 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
|||
hass.loop.create_task(async_add_devices([GenericCamera(hass, config)]))
|
||||
|
||||
|
||||
# pylint: disable=too-many-instance-attributes
|
||||
class GenericCamera(Camera):
|
||||
"""A generic implementation of an IP camera."""
|
||||
|
||||
|
|
|
@ -58,7 +58,6 @@ def extract_image_from_mjpeg(stream):
|
|||
return jpg
|
||||
|
||||
|
||||
# pylint: disable=too-many-instance-attributes
|
||||
class MjpegCamera(Camera):
|
||||
"""An implementation of an IP camera that is reachable over a URL."""
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ from homeassistant.util.async import run_coroutine_threadsafe
|
|||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
# pylint: disable=too-many-locals
|
||||
DEFAULT_NAME = 'Synology Camera'
|
||||
DEFAULT_STREAM_ID = '0'
|
||||
TIMEOUT = 5
|
||||
|
@ -179,11 +178,9 @@ def get_session_id(hass, username, password, login_url, valid_cert):
|
|||
return auth_resp['data']['sid']
|
||||
|
||||
|
||||
# pylint: disable=too-many-instance-attributes
|
||||
class SynologyCamera(Camera):
|
||||
"""An implementation of a Synology NAS based IP camera."""
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def __init__(self, config, camera_id, camera_name,
|
||||
snapshot_path, streaming_path, camera_path, auth_path):
|
||||
"""Initialize a Synology Surveillance Station camera."""
|
||||
|
|
|
@ -123,7 +123,6 @@ def set_aux_heat(hass, aux_heat, entity_id=None):
|
|||
hass.services.call(DOMAIN, SERVICE_SET_AUX_HEAT, data)
|
||||
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def set_temperature(hass, temperature=None, entity_id=None,
|
||||
target_temp_high=None, target_temp_low=None,
|
||||
operation_mode=None):
|
||||
|
@ -181,7 +180,6 @@ def set_swing_mode(hass, swing_mode, entity_id=None):
|
|||
hass.services.call(DOMAIN, SERVICE_SET_SWING_MODE, data)
|
||||
|
||||
|
||||
# pylint: disable=too-many-branches
|
||||
def setup(hass, config):
|
||||
"""Setup climate devices."""
|
||||
component = EntityComponent(_LOGGER, DOMAIN, hass, SCAN_INTERVAL)
|
||||
|
@ -364,7 +362,7 @@ def setup(hass, config):
|
|||
class ClimateDevice(Entity):
|
||||
"""Representation of a climate device."""
|
||||
|
||||
# pylint: disable=too-many-public-methods,no-self-use
|
||||
# pylint: disable=no-self-use
|
||||
@property
|
||||
def state(self):
|
||||
"""Return the current state."""
|
||||
|
|
|
@ -21,11 +21,9 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
])
|
||||
|
||||
|
||||
# pylint: disable=too-many-arguments, too-many-public-methods
|
||||
class DemoClimate(ClimateDevice):
|
||||
"""Representation of a demo climate device."""
|
||||
|
||||
# pylint: disable=too-many-instance-attributes
|
||||
def __init__(self, name, target_temperature, unit_of_measurement,
|
||||
away, current_temperature, current_fan_mode,
|
||||
target_humidity, current_humidity, current_swing_mode,
|
||||
|
|
|
@ -72,7 +72,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
schema=SET_FAN_MIN_ON_TIME_SCHEMA)
|
||||
|
||||
|
||||
# pylint: disable=too-many-public-methods, abstract-method
|
||||
# pylint: disable=abstract-method
|
||||
class Thermostat(ClimateDevice):
|
||||
"""A thermostat class for Ecobee."""
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
add_devices(devices)
|
||||
|
||||
|
||||
# pylint: disable=too-many-instance-attributes, import-error, abstract-method
|
||||
# pylint: disable=import-error, abstract-method
|
||||
class EQ3BTSmartThermostat(ClimateDevice):
|
||||
"""Representation of a eQ-3 Bluetooth Smart thermostat."""
|
||||
|
||||
|
|
|
@ -62,11 +62,10 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
target_temp, ac_mode, min_cycle_duration)])
|
||||
|
||||
|
||||
# pylint: disable=too-many-instance-attributes, abstract-method
|
||||
# pylint: disable=abstract-method
|
||||
class GenericThermostat(ClimateDevice):
|
||||
"""Representation of a GenericThermostat device."""
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def __init__(self, hass, name, heater_entity_id, sensor_entity_id,
|
||||
min_temp, max_temp, target_temp, ac_mode, min_cycle_duration):
|
||||
"""Initialize the thermostat."""
|
||||
|
|
|
@ -56,7 +56,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
class HeatmiserV3Thermostat(ClimateDevice):
|
||||
"""Representation of a HeatmiserV3 thermostat."""
|
||||
|
||||
# pylint: disable=too-many-instance-attributes, abstract-method
|
||||
# pylint: disable=abstract-method
|
||||
def __init__(self, heatmiser, device, name, serport):
|
||||
"""Initialize the thermostat."""
|
||||
self.heatmiser = heatmiser
|
||||
|
|
|
@ -100,7 +100,7 @@ def _setup_us(username, password, config, add_devices):
|
|||
class RoundThermostat(ClimateDevice):
|
||||
"""Representation of a Honeywell Round Connected thermostat."""
|
||||
|
||||
# pylint: disable=too-many-instance-attributes, abstract-method
|
||||
# pylint: disable=abstract-method
|
||||
def __init__(self, device, zone_id, master, away_temp):
|
||||
"""Initialize the thermostat."""
|
||||
self.device = device
|
||||
|
|
|
@ -37,7 +37,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
map_sv_types, devices, add_devices, MySensorsHVAC))
|
||||
|
||||
|
||||
# pylint: disable=too-many-arguments, too-many-public-methods
|
||||
class MySensorsHVAC(mysensors.MySensorsDeviceEntity, ClimateDevice):
|
||||
"""Representation of a MySensorsHVAC hvac."""
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
for structure, device in nest.devices()])
|
||||
|
||||
|
||||
# pylint: disable=abstract-method,too-many-public-methods
|
||||
# pylint: disable=abstract-method
|
||||
class NestThermostat(ClimateDevice):
|
||||
"""Representation of a Nest thermostat."""
|
||||
|
||||
|
|
|
@ -73,7 +73,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
class ZWaveClimate(ZWaveDeviceEntity, ClimateDevice):
|
||||
"""Represents a ZWave Climate device."""
|
||||
|
||||
# pylint: disable=too-many-instance-attributes
|
||||
def __init__(self, value, temp_unit):
|
||||
"""Initialize the zwave climate device."""
|
||||
from openzwave.network import ZWaveNetwork
|
||||
|
@ -121,7 +120,6 @@ class ZWaveClimate(ZWaveDeviceEntity, ClimateDevice):
|
|||
self.update_ha_state()
|
||||
_LOGGER.debug("Value changed on network %s", value)
|
||||
|
||||
# pylint: disable=too-many-branches
|
||||
def update_properties(self):
|
||||
"""Callback on data change for the registered node/value pair."""
|
||||
# Operation Mode
|
||||
|
|
|
@ -34,7 +34,6 @@ STATE_CONFIGURE = 'configure'
|
|||
STATE_CONFIGURED = 'configured'
|
||||
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def request_config(
|
||||
hass, name, callback, description=None, description_image=None,
|
||||
submit_caption=None, fields=None, link_name=None, link_url=None,
|
||||
|
@ -102,7 +101,6 @@ class Configurator(object):
|
|||
hass.services.register(
|
||||
DOMAIN, SERVICE_CONFIGURE, self.handle_service_call)
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def request_config(
|
||||
self, name, callback,
|
||||
description, description_image, submit_caption,
|
||||
|
|
|
@ -60,11 +60,9 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
add_devices(covers)
|
||||
|
||||
|
||||
# pylint: disable=too-many-arguments, too-many-instance-attributes
|
||||
class CommandCover(CoverDevice):
|
||||
"""Representation a command line cover."""
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def __init__(self, hass, name, command_open, command_close, command_stop,
|
||||
command_state, value_template):
|
||||
"""Initialize the cover."""
|
||||
|
|
|
@ -20,7 +20,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
class DemoCover(CoverDevice):
|
||||
"""Representation of a demo cover."""
|
||||
|
||||
# pylint: disable=no-self-use, too-many-instance-attributes
|
||||
# pylint: disable=no-self-use
|
||||
def __init__(self, hass, name, position=None, tilt_position=None):
|
||||
"""Initialize the cover."""
|
||||
self.hass = hass
|
||||
|
|
|
@ -67,7 +67,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
)])
|
||||
|
||||
|
||||
# pylint: disable=too-many-arguments, too-many-instance-attributes
|
||||
class MqttCover(CoverDevice):
|
||||
"""Representation of a cover that can be controlled using MQTT."""
|
||||
|
||||
|
|
|
@ -67,7 +67,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
class RPiGPIOCover(CoverDevice):
|
||||
"""Representation of a Raspberry GPIO cover."""
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def __init__(self, name, relay_pin, state_pin, state_pull_mode,
|
||||
relay_time):
|
||||
"""Initialize the cover."""
|
||||
|
|
|
@ -45,7 +45,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
add_devices(covers)
|
||||
|
||||
|
||||
# pylint: disable=too-many-arguments, too-many-instance-attributes
|
||||
class SCSGateCover(CoverDevice):
|
||||
"""Representation of SCSGate cover."""
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@ CONFIG_SCHEMA = vol.Schema({
|
|||
}, extra=vol.ALLOW_EXTRA)
|
||||
|
||||
|
||||
# pylint: disable=too-many-locals
|
||||
def setup(hass, config):
|
||||
"""The triggers to turn lights on or off based on device presence."""
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -42,7 +42,6 @@ CONFIG_SCHEMA = vol.Schema({
|
|||
}, extra=vol.ALLOW_EXTRA)
|
||||
|
||||
|
||||
# pylint: disable=unused-argument,too-few-public-methods
|
||||
def setup(hass, config):
|
||||
"""Set up the Digital Ocean component."""
|
||||
conf = config[DOMAIN]
|
||||
|
|
|
@ -38,7 +38,6 @@ CONFIG_SCHEMA = vol.Schema({
|
|||
}, extra=vol.ALLOW_EXTRA)
|
||||
|
||||
|
||||
# pylint: disable=too-many-branches
|
||||
def setup(hass, config):
|
||||
"""Listen for download events to download files."""
|
||||
download_path = config[DOMAIN][CONF_DOWNLOAD_DIR]
|
||||
|
|
|
@ -32,7 +32,6 @@ CONFIG_SCHEMA = vol.Schema({
|
|||
}, extra=vol.ALLOW_EXTRA)
|
||||
|
||||
|
||||
# pylint: disable=too-many-locals
|
||||
def setup(hass, config):
|
||||
"""Setup the Dweet.io component."""
|
||||
conf = config[DOMAIN]
|
||||
|
|
|
@ -86,7 +86,6 @@ def setup_ecobee(hass, network, config):
|
|||
discovery.load_platform(hass, 'binary_sensor', DOMAIN, {}, config)
|
||||
|
||||
|
||||
# pylint: disable=too-few-public-methods
|
||||
class EcobeeData(object):
|
||||
"""Get the latest data and update the states."""
|
||||
|
||||
|
|
|
@ -105,7 +105,6 @@ def setup(hass, yaml_config):
|
|||
return True
|
||||
|
||||
|
||||
# pylint: disable=too-few-public-methods
|
||||
class Config(object):
|
||||
"""Holds configuration variables for the emulated hue bridge."""
|
||||
|
||||
|
|
|
@ -56,14 +56,14 @@ class EnOceanDongle:
|
|||
"""Send a command from the EnOcean dongle."""
|
||||
self.__communicator.send(command)
|
||||
|
||||
def _combine_hex(self, data): # pylint: disable=no-self-use
|
||||
# pylint: disable=no-self-use
|
||||
def _combine_hex(self, data):
|
||||
"""Combine list of integer values to one big integer."""
|
||||
output = 0x00
|
||||
for i, j in enumerate(reversed(data)):
|
||||
output |= (j << i * 8)
|
||||
return output
|
||||
|
||||
# pylint: disable=too-many-branches
|
||||
def callback(self, temp):
|
||||
"""Callback function for EnOcean Device.
|
||||
|
||||
|
@ -112,7 +112,6 @@ class EnOceanDongle:
|
|||
device.value_changed(value)
|
||||
|
||||
|
||||
# pylint: disable=too-few-public-methods
|
||||
class EnOceanDevice():
|
||||
"""Parent class for all devices associated with the EnOcean component."""
|
||||
|
||||
|
|
|
@ -77,8 +77,7 @@ CONFIG_SCHEMA = vol.Schema({
|
|||
}, extra=vol.ALLOW_EXTRA)
|
||||
|
||||
|
||||
# pylint: disable=unused-argument, too-many-function-args, too-many-locals
|
||||
# pylint: disable=too-many-return-statements
|
||||
# pylint: disable=unused-argument
|
||||
def setup(hass, base_config):
|
||||
"""Common setup for Envisalink devices."""
|
||||
from pyenvisalink import EnvisalinkAlarmPanel
|
||||
|
|
|
@ -86,7 +86,6 @@ def is_on(hass, entity_id: str=None) -> bool:
|
|||
return state.attributes[ATTR_SPEED] not in [SPEED_OFF, STATE_UNKNOWN]
|
||||
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def turn_on(hass, entity_id: str=None, speed: str=None) -> None:
|
||||
"""Turn all or specified fan on."""
|
||||
data = {
|
||||
|
@ -141,7 +140,6 @@ def set_speed(hass, entity_id: str=None, speed: str=None) -> None:
|
|||
hass.services.call(DOMAIN, SERVICE_SET_SPEED, data)
|
||||
|
||||
|
||||
# pylint: disable=too-many-branches, too-many-locals, too-many-statements
|
||||
def setup(hass, config: dict) -> None:
|
||||
"""Expose fan control via statemachine and services."""
|
||||
component = EntityComponent(
|
||||
|
|
|
@ -110,11 +110,9 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
)])
|
||||
|
||||
|
||||
# pylint: disable=too-many-instance-attributes
|
||||
class MqttFan(FanEntity):
|
||||
"""A MQTT fan component."""
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def __init__(self, hass, name, topic, templates, qos, retain, payload,
|
||||
speed_list, optimistic):
|
||||
"""Initialize the MQTT fan."""
|
||||
|
|
|
@ -44,7 +44,6 @@ def setup(hass, config):
|
|||
return len(feeds) > 0
|
||||
|
||||
|
||||
# pylint: disable=too-few-public-methods
|
||||
class FeedManager(object):
|
||||
"""Abstraction over feedparser module."""
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@ _LOGGER = logging.getLogger(__name__)
|
|||
def register_built_in_panel(hass, component_name, sidebar_title=None,
|
||||
sidebar_icon=None, url_path=None, config=None):
|
||||
"""Register a built-in panel."""
|
||||
# pylint: disable=too-many-arguments
|
||||
path = 'panels/ha-panel-{}.html'.format(component_name)
|
||||
|
||||
if hass.http.development:
|
||||
|
@ -70,7 +69,6 @@ def register_panel(hass, component_name, path, md5=None, sidebar_title=None,
|
|||
|
||||
Warning: this API will probably change. Use at own risk.
|
||||
"""
|
||||
# pylint: disable=too-many-arguments
|
||||
if url_path is None:
|
||||
url_path = component_name
|
||||
|
||||
|
|
|
@ -218,7 +218,6 @@ def _async_process_config(hass, config, component):
|
|||
class Group(Entity):
|
||||
"""Track a group of entity ids."""
|
||||
|
||||
# pylint: disable=too-many-instance-attributes, too-many-arguments
|
||||
def __init__(self, hass, name, order=None, user_defined=True, icon=None,
|
||||
view=False):
|
||||
"""Initialize a group.
|
||||
|
@ -240,7 +239,6 @@ class Group(Entity):
|
|||
self._visible = True
|
||||
|
||||
@staticmethod
|
||||
# pylint: disable=too-many-arguments
|
||||
def create_group(hass, name, entity_ids=None, user_defined=True,
|
||||
icon=None, view=False, object_id=None):
|
||||
"""Initialize a group."""
|
||||
|
@ -251,7 +249,6 @@ class Group(Entity):
|
|||
|
||||
@staticmethod
|
||||
@asyncio.coroutine
|
||||
# pylint: disable=too-many-arguments
|
||||
def async_create_group(hass, name, entity_ids=None, user_defined=True,
|
||||
icon=None, view=False, object_id=None):
|
||||
"""Initialize a group.
|
||||
|
@ -420,7 +417,6 @@ class Group(Entity):
|
|||
|
||||
This method must be run in the event loop.
|
||||
"""
|
||||
# pylint: disable=too-many-branches
|
||||
# To store current states of group entities. Might not be needed.
|
||||
states = None
|
||||
gr_state = self._state
|
||||
|
|
|
@ -247,7 +247,6 @@ class HistoryPeriodView(HomeAssistantView):
|
|||
return self.json(result.values())
|
||||
|
||||
|
||||
# pylint: disable=too-few-public-methods
|
||||
class Filters(object):
|
||||
"""Container for the configured include and exclude filters."""
|
||||
|
||||
|
|
|
@ -183,7 +183,7 @@ def set_value(hass, entity_id, value):
|
|||
hass.services.call(DOMAIN, SERVICE_SET_VALUE, data)
|
||||
|
||||
|
||||
# pylint: disable=unused-argument,too-many-locals
|
||||
# pylint: disable=unused-argument
|
||||
def setup(hass, config):
|
||||
"""Setup the Homematic component."""
|
||||
global HOMEMATIC, HOMEMATIC_LINK_DELAY
|
||||
|
@ -271,7 +271,6 @@ def setup(hass, config):
|
|||
return True
|
||||
|
||||
|
||||
# pylint: disable=too-many-branches
|
||||
def _system_callback_handler(hass, config, src, *args):
|
||||
"""Callback handler."""
|
||||
if src == 'newDevices':
|
||||
|
@ -323,7 +322,6 @@ def _get_devices(device_type, keys):
|
|||
"""Get the Homematic devices."""
|
||||
device_arr = []
|
||||
|
||||
# pylint: disable=too-many-nested-blocks
|
||||
for key in keys:
|
||||
device = HOMEMATIC.devices[key]
|
||||
class_name = device.__class__.__name__
|
||||
|
@ -585,7 +583,6 @@ class HMVariable(Entity):
|
|||
class HMDevice(Entity):
|
||||
"""The Homematic device base object."""
|
||||
|
||||
# pylint: disable=too-many-instance-attributes
|
||||
def __init__(self, config):
|
||||
"""Initialize a generic Homematic device."""
|
||||
self._name = config.get(ATTR_NAME)
|
||||
|
|
|
@ -97,7 +97,6 @@ def request_class():
|
|||
class HideSensitiveFilter(logging.Filter):
|
||||
"""Filter API password calls."""
|
||||
|
||||
# pylint: disable=too-few-public-methods
|
||||
def __init__(self, hass):
|
||||
"""Initialize sensitive data filter."""
|
||||
super().__init__()
|
||||
|
@ -247,9 +246,6 @@ class HAStaticRoute(StaticRoute):
|
|||
class HomeAssistantWSGI(object):
|
||||
"""WSGI server for Home Assistant."""
|
||||
|
||||
# pylint: disable=too-many-instance-attributes, too-many-locals
|
||||
# pylint: disable=too-many-arguments
|
||||
|
||||
def __init__(self, hass, development, api_password, ssl_certificate,
|
||||
ssl_key, server_host, server_port, cors_origins,
|
||||
trusted_networks):
|
||||
|
@ -405,7 +401,8 @@ class HomeAssistantView(object):
|
|||
|
||||
self.hass = hass
|
||||
|
||||
def json(self, result, status_code=200): # pylint: disable=no-self-use
|
||||
# pylint: disable=no-self-use
|
||||
def json(self, result, status_code=200):
|
||||
"""Return a JSON response."""
|
||||
msg = json.dumps(
|
||||
result, sort_keys=True, cls=rem.JSONEncoder).encode('UTF-8')
|
||||
|
@ -417,7 +414,8 @@ class HomeAssistantView(object):
|
|||
return self.json({'message': error}, status_code)
|
||||
|
||||
@asyncio.coroutine
|
||||
def file(self, request, fil): # pylint: disable=no-self-use
|
||||
# pylint: disable=no-self-use
|
||||
def file(self, request, fil):
|
||||
"""Return a file."""
|
||||
assert isinstance(fil, str), 'only string paths allowed'
|
||||
response = yield from _GZIP_FILE_SENDER.send(request, Path(fil))
|
||||
|
|
|
@ -49,7 +49,6 @@ CONFIG_SCHEMA = vol.Schema({
|
|||
}, extra=vol.ALLOW_EXTRA)
|
||||
|
||||
|
||||
# pylint: disable=too-many-locals
|
||||
def setup(hass, config):
|
||||
"""Setup the InfluxDB component."""
|
||||
from influxdb import InfluxDBClient, exceptions
|
||||
|
|
|
@ -148,7 +148,6 @@ def async_setup(hass, config):
|
|||
class InputSelect(Entity):
|
||||
"""Representation of a select input."""
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def __init__(self, object_id, name, state, options, icon):
|
||||
"""Initialize a select input."""
|
||||
self.entity_id = ENTITY_ID_FORMAT.format(object_id)
|
||||
|
|
|
@ -114,7 +114,6 @@ def async_setup(hass, config):
|
|||
class InputSlider(Entity):
|
||||
"""Represent an slider."""
|
||||
|
||||
# pylint: disable=too-many-arguments, too-many-instance-attributes
|
||||
def __init__(self, object_id, name, state, minimum, maximum, step, icon,
|
||||
unit):
|
||||
"""Initialize a select input."""
|
||||
|
|
|
@ -93,15 +93,16 @@ def _categorize_nodes(hidden_identifier: str, sensor_identifier: str) -> None:
|
|||
NODES = []
|
||||
GROUPS = []
|
||||
|
||||
# pylint: disable=no-member
|
||||
for (path, node) in ISY.nodes:
|
||||
hidden = hidden_identifier in path or hidden_identifier in node.name
|
||||
if hidden:
|
||||
node.name += hidden_identifier
|
||||
if sensor_identifier in path or sensor_identifier in node.name:
|
||||
SENSOR_NODES.append(node)
|
||||
elif isinstance(node, PYISY.Nodes.Node): # pylint: disable=no-member
|
||||
elif isinstance(node, PYISY.Nodes.Node):
|
||||
NODES.append(node)
|
||||
elif isinstance(node, PYISY.Nodes.Group): # pylint: disable=no-member
|
||||
elif isinstance(node, PYISY.Nodes.Group):
|
||||
GROUPS.append(node)
|
||||
|
||||
|
||||
|
@ -131,7 +132,6 @@ def _categorize_programs() -> None:
|
|||
PROGRAMS[component].append(program)
|
||||
|
||||
|
||||
# pylint: disable=too-many-locals
|
||||
def setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||
"""Set up the ISY 994 platform."""
|
||||
isy_config = config.get(DOMAIN)
|
||||
|
|
|
@ -27,7 +27,6 @@ CONFIG_SCHEMA = vol.Schema({
|
|||
}, extra=vol.ALLOW_EXTRA)
|
||||
|
||||
|
||||
# pylint: disable=too-many-locals
|
||||
def register_device(hass, device_id, api_key, name):
|
||||
"""Method to register services for each join device listed."""
|
||||
from pyjoin import (ring_device, set_wallpaper, send_sms,
|
||||
|
|
|
@ -124,7 +124,6 @@ def is_on(hass, entity_id=None):
|
|||
return hass.states.is_state(entity_id, STATE_ON)
|
||||
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def turn_on(hass, entity_id=None, transition=None, brightness=None,
|
||||
rgb_color=None, xy_color=None, color_temp=None, white_value=None,
|
||||
profile=None, flash=None, effect=None, color_name=None):
|
||||
|
@ -172,7 +171,6 @@ def toggle(hass, entity_id=None, transition=None):
|
|||
hass.services.call(DOMAIN, SERVICE_TOGGLE, data)
|
||||
|
||||
|
||||
# pylint: disable=too-many-branches, too-many-locals, too-many-statements
|
||||
def setup(hass, config):
|
||||
"""Expose light control via statemachine and services."""
|
||||
component = EntityComponent(
|
||||
|
|
|
@ -34,7 +34,6 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
|||
class DemoLight(Light):
|
||||
"""Represenation of a demo light."""
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def __init__(
|
||||
self, name, state, rgb=None, ct=None, brightness=180,
|
||||
xy_color=(.5, .5), white=200):
|
||||
|
|
|
@ -76,7 +76,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
class FluxLight(Light):
|
||||
"""Representation of a Flux light."""
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def __init__(self, device):
|
||||
"""Initialize the light."""
|
||||
import flux_led
|
||||
|
|
|
@ -199,7 +199,6 @@ def request_configuration(host, hass, add_devices, filename,
|
|||
class HueLight(Light):
|
||||
"""Representation of a Hue light."""
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def __init__(self, light_id, info, bridge, update_lights,
|
||||
bridge_type, allow_unreachable):
|
||||
"""Initialize the light."""
|
||||
|
|
|
@ -80,7 +80,6 @@ class LIFX(object):
|
|||
break
|
||||
return bulb
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def on_device(self, ipaddr, name, power, hue, sat, bri, kel):
|
||||
"""Initialize the light."""
|
||||
bulb = self.find_bulb(ipaddr)
|
||||
|
@ -99,7 +98,6 @@ class LIFX(object):
|
|||
bulb.set_color(hue, sat, bri, kel)
|
||||
bulb.update_ha_state()
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def on_color(self, ipaddr, hue, sat, bri, kel):
|
||||
"""Initialize the light."""
|
||||
bulb = self.find_bulb(ipaddr)
|
||||
|
@ -137,11 +135,9 @@ def convert_rgb_to_hsv(rgb):
|
|||
int(brightness * SHORT_MAX)]
|
||||
|
||||
|
||||
# pylint: disable=too-many-instance-attributes
|
||||
class LIFXLight(Light):
|
||||
"""Representation of a LIFX light."""
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def __init__(self, liffy, ipaddr, name, power, hue, saturation, brightness,
|
||||
kelvin):
|
||||
"""Initialize the light."""
|
||||
|
|
|
@ -101,8 +101,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
class MqttLight(Light):
|
||||
"""MQTT light."""
|
||||
|
||||
# pylint: disable=too-many-arguments,too-many-instance-attributes
|
||||
# pylint: disable=too-many-locals,too-many-branches
|
||||
def __init__(self, hass, name, topic, templates, qos, retain, payload,
|
||||
optimistic, brightness_scale):
|
||||
"""Initialize MQTT light."""
|
||||
|
|
|
@ -85,7 +85,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
class MqttJson(Light):
|
||||
"""Representation of a MQTT JSON light."""
|
||||
|
||||
# pylint: disable=too-many-arguments,too-many-instance-attributes
|
||||
def __init__(self, hass, name, topic, qos, retain,
|
||||
optimistic, brightness, rgb, flash_times):
|
||||
"""Initialize MQTT JSON light."""
|
||||
|
|
|
@ -78,7 +78,6 @@ class WinkLight(WinkDevice, Light):
|
|||
"""Flag supported features."""
|
||||
return SUPPORT_WINK
|
||||
|
||||
# pylint: disable=too-few-public-methods
|
||||
def turn_on(self, **kwargs):
|
||||
"""Turn the switch on."""
|
||||
brightness = kwargs.get(ATTR_BRIGHTNESS)
|
||||
|
|
|
@ -43,7 +43,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
class YeelightLight(Light):
|
||||
"""Representation of a Yeelight light."""
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def __init__(self, device):
|
||||
"""Initialize the light."""
|
||||
import pyyeelight
|
||||
|
|
|
@ -105,7 +105,6 @@ def brightness_state(value):
|
|||
class ZwaveDimmer(zwave.ZWaveDeviceEntity, Light):
|
||||
"""Representation of a Z-Wave dimmer."""
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def __init__(self, value):
|
||||
"""Initialize the light."""
|
||||
from openzwave.network import ZWaveNetwork
|
||||
|
@ -263,7 +262,6 @@ class ZwaveColorLight(ZwaveDimmer):
|
|||
# Check for the missing color values
|
||||
self._get_color_values()
|
||||
|
||||
# pylint: disable=too-many-branches
|
||||
def update_properties(self):
|
||||
"""Update internal properties based on zwave values."""
|
||||
super().update_properties()
|
||||
|
|
|
@ -58,7 +58,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
)])
|
||||
|
||||
|
||||
# pylint: disable=too-many-arguments, too-many-instance-attributes
|
||||
class MqttLock(LockDevice):
|
||||
"""Represents a lock that can be toggled using MQTT."""
|
||||
|
||||
|
|
|
@ -154,7 +154,6 @@ class LogbookView(HomeAssistantView):
|
|||
class Entry(object):
|
||||
"""A human readable version of the log."""
|
||||
|
||||
# pylint: disable=too-many-arguments, too-few-public-methods
|
||||
def __init__(self, when=None, name=None, message=None, domain=None,
|
||||
entity_id=None):
|
||||
"""Initialize the entry."""
|
||||
|
@ -182,7 +181,6 @@ def humanify(events):
|
|||
- if 2+ sensor updates in GROUP_BY_MINUTES, show last
|
||||
- if home assistant stop and start happen in same minute call it restarted
|
||||
"""
|
||||
# pylint: disable=too-many-branches
|
||||
# Group events in batches of GROUP_BY_MINUTES
|
||||
for _, g_events in groupby(
|
||||
events,
|
||||
|
@ -288,7 +286,6 @@ def humanify(events):
|
|||
|
||||
def _exclude_events(events, config):
|
||||
"""Get lists of excluded entities and platforms."""
|
||||
# pylint: disable=too-many-branches
|
||||
excluded_entities = []
|
||||
excluded_domains = []
|
||||
included_entities = []
|
||||
|
@ -355,10 +352,10 @@ def _exclude_events(events, config):
|
|||
return filtered_events
|
||||
|
||||
|
||||
# pylint: disable=too-many-return-statements
|
||||
def _entry_message_from_state(domain, state):
|
||||
"""Convert a state to a message for the logbook."""
|
||||
# We pass domain in so we don't have to split entity_id again
|
||||
# pylint: disable=too-many-return-statements
|
||||
if domain == 'device_tracker':
|
||||
if state.state == STATE_NOT_HOME:
|
||||
return 'is away'
|
||||
|
|
|
@ -398,10 +398,8 @@ def setup(hass, config):
|
|||
class MediaPlayerDevice(Entity):
|
||||
"""ABC for media player devices."""
|
||||
|
||||
# pylint: disable=too-many-public-methods,no-self-use
|
||||
|
||||
# pylint: disable=no-self-use
|
||||
# Implement these for your media player
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
"""State of the player."""
|
||||
|
|
|
@ -117,7 +117,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
setup_bravia(config, pin, hass, add_devices)
|
||||
|
||||
|
||||
# pylint: disable=too-many-branches
|
||||
def setup_bravia(config, pin, hass, add_devices):
|
||||
"""Setup a Sony Bravia TV based on host parameter."""
|
||||
host = config.get(CONF_HOST)
|
||||
|
@ -181,8 +180,7 @@ def request_configuration(config, hass, add_devices):
|
|||
)
|
||||
|
||||
|
||||
# pylint: disable=abstract-method, too-many-public-methods,
|
||||
# pylint: disable=too-many-instance-attributes, too-many-arguments
|
||||
# pylint: disable=abstract-method
|
||||
class BraviaTVDevice(MediaPlayerDevice):
|
||||
"""Representation of a Sony Bravia TV."""
|
||||
|
||||
|
|
|
@ -89,7 +89,6 @@ class CastDevice(MediaPlayerDevice):
|
|||
"""Representation of a Cast device on the network."""
|
||||
|
||||
# pylint: disable=abstract-method
|
||||
# pylint: disable=too-many-public-methods
|
||||
def __init__(self, chromecast):
|
||||
"""Initialize the Cast device."""
|
||||
self.cast = chromecast
|
||||
|
|
|
@ -58,7 +58,7 @@ def setup_platform(hass, config, add_devices, discover_info=None):
|
|||
class CmusDevice(MediaPlayerDevice):
|
||||
"""Representation of a running cmus."""
|
||||
|
||||
# pylint: disable=no-member, too-many-public-methods, abstract-method
|
||||
# pylint: disable=no-member, abstract-method
|
||||
def __init__(self, server, password, port, name):
|
||||
"""Initialize the CMUS device."""
|
||||
from pycmus import remote
|
||||
|
|
|
@ -45,7 +45,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
class DenonDevice(MediaPlayerDevice):
|
||||
"""Representation of a Denon device."""
|
||||
|
||||
# pylint: disable=too-many-public-methods, abstract-method
|
||||
# pylint: disable=abstract-method
|
||||
def __init__(self, name, host):
|
||||
"""Initialize the Denon device."""
|
||||
self._name = name
|
||||
|
|
|
@ -66,7 +66,6 @@ class DirecTvDevice(MediaPlayerDevice):
|
|||
"""Representation of a DirecTV reciever on the network."""
|
||||
|
||||
# pylint: disable=abstract-method
|
||||
# pylint: disable=too-many-public-methods
|
||||
def __init__(self, name, host, port):
|
||||
"""Initialize the device."""
|
||||
from DirectPy import DIRECTV
|
||||
|
|
|
@ -170,8 +170,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
|||
class GPMDP(MediaPlayerDevice):
|
||||
"""Representation of a GPMDP."""
|
||||
|
||||
# pylint: disable=too-many-public-methods, abstract-method
|
||||
# pylint: disable=too-many-instance-attributes
|
||||
# pylint: disable=abstract-method
|
||||
def __init__(self, name, url, code):
|
||||
"""Initialize the media player."""
|
||||
from websocket import create_connection
|
||||
|
|
|
@ -154,7 +154,6 @@ class Itunes(object):
|
|||
|
||||
|
||||
# pylint: disable=unused-argument, abstract-method
|
||||
# pylint: disable=too-many-instance-attributes
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Setup the iTunes platform."""
|
||||
add_devices([
|
||||
|
@ -172,7 +171,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
class ItunesDevice(MediaPlayerDevice):
|
||||
"""Representation of an iTunes API instance."""
|
||||
|
||||
# pylint: disable=too-many-public-methods, too-many-arguments
|
||||
def __init__(self, name, host, port, use_ssl, add_devices):
|
||||
"""Initialize the iTunes device."""
|
||||
self._name = name
|
||||
|
@ -353,7 +351,6 @@ class ItunesDevice(MediaPlayerDevice):
|
|||
class AirPlayDevice(MediaPlayerDevice):
|
||||
"""Representation an AirPlay device via an iTunes API instance."""
|
||||
|
||||
# pylint: disable=too-many-public-methods
|
||||
def __init__(self, device_id, client):
|
||||
"""Initialize the AirPlay device."""
|
||||
self._id = device_id
|
||||
|
|
|
@ -63,8 +63,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
class KodiDevice(MediaPlayerDevice):
|
||||
"""Representation of a XBMC/Kodi device."""
|
||||
|
||||
# pylint: disable=too-many-public-methods, abstract-method
|
||||
# pylint: disable=too-many-instance-attributes
|
||||
# pylint: disable=abstract-method
|
||||
def __init__(self, name, url, auth=None, turn_off_action=None):
|
||||
"""Initialize the Kodi device."""
|
||||
import jsonrpc_requests
|
||||
|
|
|
@ -52,8 +52,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
add_devices([LgTVDevice(client, config[CONF_NAME])])
|
||||
|
||||
|
||||
# pylint: disable=too-many-public-methods, abstract-method
|
||||
# pylint: disable=too-many-instance-attributes
|
||||
# pylint: disable=abstract-method
|
||||
class LgTVDevice(MediaPlayerDevice):
|
||||
"""Representation of a LG TV."""
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
class MpdDevice(MediaPlayerDevice):
|
||||
"""Representation of a MPD server."""
|
||||
|
||||
# pylint: disable=no-member, too-many-public-methods, abstract-method
|
||||
# pylint: disable=no-member, abstract-method
|
||||
def __init__(self, server, port, location, password):
|
||||
"""Initialize the MPD device."""
|
||||
import mpd
|
||||
|
|
|
@ -65,11 +65,10 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
add_devices(hosts)
|
||||
|
||||
|
||||
# pylint: disable=too-many-instance-attributes
|
||||
class OnkyoDevice(MediaPlayerDevice):
|
||||
"""Representation of an Onkyo device."""
|
||||
|
||||
# pylint: disable=too-many-public-methods, abstract-method
|
||||
# pylint: disable=abstract-method
|
||||
def __init__(self, receiver, sources, name=None):
|
||||
"""Initialize the Onkyo Receiver."""
|
||||
self._receiver = receiver
|
||||
|
|
|
@ -72,7 +72,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
class PanasonicVieraTVDevice(MediaPlayerDevice):
|
||||
"""Representation of a Panasonic Viera TV."""
|
||||
|
||||
# pylint: disable=too-many-public-methods
|
||||
def __init__(self, name, remote):
|
||||
"""Initialize the samsung device."""
|
||||
# Save a reference to the imported class
|
||||
|
|
|
@ -60,7 +60,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
add_devices([pandora])
|
||||
|
||||
|
||||
# pylint: disable=too-many-instance-attributes
|
||||
class PandoraMediaPlayer(MediaPlayerDevice):
|
||||
"""A media player that uses the Pianobar interface to Pandora."""
|
||||
|
||||
|
|
|
@ -54,8 +54,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
class PioneerDevice(MediaPlayerDevice):
|
||||
"""Representation of a Pioneer device."""
|
||||
|
||||
# pylint: disable=too-many-public-methods, abstract-method
|
||||
# pylint: disable=too-many-instance-attributes
|
||||
# pylint: disable=abstract-method
|
||||
def __init__(self, name, host, port, timeout):
|
||||
"""Initialize the Pioneer device."""
|
||||
self._name = name
|
||||
|
|
|
@ -83,7 +83,6 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
|||
setup_plexserver(host, token, hass, add_devices_callback)
|
||||
|
||||
|
||||
# pylint: disable=too-many-branches
|
||||
def setup_plexserver(host, token, hass, add_devices_callback):
|
||||
"""Setup a plexserver based on host parameter."""
|
||||
import plexapi.server
|
||||
|
@ -192,7 +191,7 @@ def request_configuration(host, hass, add_devices_callback):
|
|||
class PlexClient(MediaPlayerDevice):
|
||||
"""Representation of a Plex device."""
|
||||
|
||||
# pylint: disable=too-many-public-methods, attribute-defined-outside-init
|
||||
# pylint: disable=attribute-defined-outside-init
|
||||
def __init__(self, device, plex_sessions, update_devices, update_sessions):
|
||||
"""Initialize the Plex device."""
|
||||
from plexapi.utils import NA
|
||||
|
|
|
@ -66,7 +66,6 @@ class RokuDevice(MediaPlayerDevice):
|
|||
"""Representation of a Roku device on the network."""
|
||||
|
||||
# pylint: disable=abstract-method
|
||||
# pylint: disable=too-many-public-methods
|
||||
def __init__(self, host):
|
||||
"""Initialize the Roku device."""
|
||||
from roku import Roku
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue