Disable pylint unused-argument check

This commit is contained in:
Paulus Schoutsen 2015-01-19 23:40:51 -08:00
parent d3f1b83e57
commit ff230cefe3
37 changed files with 12 additions and 52 deletions

View File

@ -34,7 +34,6 @@ SERVICE_FLASH = 'flash'
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
# pylint: disable=unused-argument
def setup(hass, config): def setup(hass, config):
""" Setup example component. """ """ Setup example component. """

View File

@ -101,7 +101,6 @@ def main():
hass = bootstrap.from_config_file(config_path) hass = bootstrap.from_config_file(config_path)
if args.open_ui: if args.open_ui:
# pylint: disable=unused-argument
def open_browser(event): def open_browser(event):
""" Open the webinterface in a browser. """ """ Open the webinterface in a browser. """
if hass.local_api is not None: if hass.local_api is not None:

View File

@ -70,7 +70,6 @@ def turn_off(hass, entity_id=None, **service_data):
hass.services.call(ha.DOMAIN, SERVICE_TURN_OFF, service_data) hass.services.call(ha.DOMAIN, SERVICE_TURN_OFF, service_data)
# pylint: disable=unused-argument
def setup(hass, config): def setup(hass, config):
""" Setup general services related to homeassistant. """ """ Setup general services related to homeassistant. """

View File

@ -26,7 +26,6 @@ def register(hass, config, action):
from_state = config.get(CONF_FROM, MATCH_ALL) from_state = config.get(CONF_FROM, MATCH_ALL)
to_state = config.get(CONF_TO, MATCH_ALL) to_state = config.get(CONF_TO, MATCH_ALL)
# pylint: disable=unused-argument
def state_automation_listener(entity, from_s, to_s): def state_automation_listener(entity, from_s, to_s):
""" Listens for state changes and calls action. """ """ Listens for state changes and calls action. """
action() action()

View File

@ -17,7 +17,6 @@ def register(hass, config, action):
minutes = convert(config.get(CONF_MINUTES), int) minutes = convert(config.get(CONF_MINUTES), int)
seconds = convert(config.get(CONF_SECONDS), int) seconds = convert(config.get(CONF_SECONDS), int)
# pylint: disable=unused-argument
def time_automation_listener(now): def time_automation_listener(now):
""" Listens for time changes and calls action. """ """ Listens for time changes and calls action. """
action() action()

View File

@ -11,7 +11,6 @@ DEPENDENCIES = []
SERVICE_BROWSE_URL = "browse_url" SERVICE_BROWSE_URL = "browse_url"
# pylint: disable=unused-argument
def setup(hass, config): def setup(hass, config):
""" Listen for browse_url events and open """ Listen for browse_url events and open
the url in the default webbrowser. """ the url in the default webbrowser. """

View File

@ -158,7 +158,6 @@ def setup(hass, config):
for host in hosts: for host in hosts:
setup_chromecast(casts, host) setup_chromecast(casts, host)
# pylint: disable=unused-argument
def chromecast_discovered(service, info): def chromecast_discovered(service, info):
""" Called when a Chromecast has been discovered. """ """ Called when a Chromecast has been discovered. """
logger.info("New Chromecast discovered: %s", info[0]) logger.info("New Chromecast discovered: %s", info[0])
@ -212,7 +211,7 @@ def setup(hass, config):
hass.states.set(entity_id, state, state_attr) hass.states.set(entity_id, state, state_attr)
def update_chromecast_states(time): # pylint: disable=unused-argument def update_chromecast_states(time):
""" Updates all chromecast states. """ """ Updates all chromecast states. """
if casts: if casts:
logger.info("Updating Chromecast status") logger.info("Updating Chromecast status")

View File

@ -71,7 +71,6 @@ def request_done(request_id):
pass pass
# pylint: disable=unused-argument
def setup(hass, config): def setup(hass, config):
""" Set up Configurator. """ """ Set up Configurator. """
return True return True

View File

@ -174,7 +174,6 @@ def setup(hass, config):
configurator_ids = [] configurator_ids = []
# pylint: disable=unused-argument
def hue_configuration_callback(data): def hue_configuration_callback(data):
""" Fake callback, mark config as done. """ """ Fake callback, mark config as done. """
time.sleep(2) time.sleep(2)

View File

@ -66,7 +66,6 @@ def setup(hass, config):
else: else:
return None return None
# pylint: disable=unused-argument
def schedule_light_on_sun_rise(entity, old_state, new_state): def schedule_light_on_sun_rise(entity, old_state, new_state):
"""The moment sun sets we want to have all the lights on. """The moment sun sets we want to have all the lights on.
We will schedule to have each light start after one another We will schedule to have each light start after one another

View File

@ -114,7 +114,6 @@ class DeviceTracker(object):
dev_group = group.Group( dev_group = group.Group(
hass, GROUP_NAME_ALL_DEVICES, user_defined=False) hass, GROUP_NAME_ALL_DEVICES, user_defined=False)
# pylint: disable=unused-argument
def reload_known_devices_service(service): def reload_known_devices_service(service):
""" Reload known devices file. """ """ Reload known devices file. """
self._read_known_devices_file() self._read_known_devices_file()

View File

@ -17,7 +17,6 @@ MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
# pylint: disable=unused-argument
def get_scanner(hass, config): def get_scanner(hass, config):
""" Validates config and returns a Luci scanner. """ """ Validates config and returns a Luci scanner. """
if not validate_config(config, if not validate_config(config,

View File

@ -14,7 +14,6 @@ MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
# pylint: disable=unused-argument
def get_scanner(hass, config): def get_scanner(hass, config):
""" Validates config and returns a Netgear scanner. """ """ Validates config and returns a Netgear scanner. """
if not validate_config(config, if not validate_config(config,

View File

@ -20,7 +20,6 @@ MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
# pylint: disable=unused-argument
def get_scanner(hass, config): def get_scanner(hass, config):
""" Validates config and returns a Nmap scanner. """ """ Validates config and returns a Nmap scanner. """
if not validate_config(config, {DOMAIN: [CONF_HOSTS]}, if not validate_config(config, {DOMAIN: [CONF_HOSTS]},

View File

@ -20,7 +20,6 @@ CONF_HTTP_ID = "http_id"
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
# pylint: disable=unused-argument
def get_scanner(hass, config): def get_scanner(hass, config):
""" Validates config and returns a Tomato scanner. """ """ Validates config and returns a Tomato scanner. """
if not validate_config(config, if not validate_config(config,

View File

@ -75,7 +75,6 @@ def setup(hass, config):
ATTR_DISCOVERED: info ATTR_DISCOVERED: info
}) })
# pylint: disable=unused-argument
def start_discovery(event): def start_discovery(event):
""" Start discovering. """ """ Start discovering. """
netdisco = DiscoveryService(SCAN_INTERVAL) netdisco = DiscoveryService(SCAN_INTERVAL)

View File

@ -163,7 +163,6 @@ class Group(object):
self.hass.bus.remove_listener( self.hass.bus.remove_listener(
ha.EVENT_STATE_CHANGED, self._update_group_state) ha.EVENT_STATE_CHANGED, self._update_group_state)
# pylint: disable=unused-argument
def _update_group_state(self, entity_id, old_state, new_state): def _update_group_state(self, entity_id, old_state, new_state):
""" Updates the group state based on a state change by """ Updates the group state based on a state change by
a tracked entity. """ a tracked entity. """

View File

@ -351,7 +351,6 @@ class RequestHandler(SimpleHTTPRequestHandler):
""" DELETE request handler. """ """ DELETE request handler. """
self._handle_request('DELETE') self._handle_request('DELETE')
# pylint: disable=unused-argument
def _handle_get_root(self, path_match, data): def _handle_get_root(self, path_match, data):
""" Renders the debug interface. """ """ Renders the debug interface. """
@ -390,17 +389,14 @@ class RequestHandler(SimpleHTTPRequestHandler):
"<splash-login auth='{}'></splash-login>" "<splash-login auth='{}'></splash-login>"
"</body></html>").format(app_url, auth)) "</body></html>").format(app_url, auth))
# pylint: disable=unused-argument
def _handle_get_api(self, path_match, data): def _handle_get_api(self, path_match, data):
""" Renders the debug interface. """ """ Renders the debug interface. """
self._json_message("API running.") self._json_message("API running.")
# pylint: disable=unused-argument
def _handle_get_api_states(self, path_match, data): def _handle_get_api_states(self, path_match, data):
""" Returns a dict containing all entity ids and their state. """ """ Returns a dict containing all entity ids and their state. """
self._write_json(self.server.hass.states.all()) self._write_json(self.server.hass.states.all())
# pylint: disable=unused-argument
def _handle_get_api_states_entity(self, path_match, data): def _handle_get_api_states_entity(self, path_match, data):
""" Returns the state of a specific entity. """ """ Returns the state of a specific entity. """
entity_id = path_match.group('entity_id') entity_id = path_match.group('entity_id')

View File

@ -46,7 +46,6 @@ def media_prev_track(hass):
hass.services.call(DOMAIN, SERVICE_MEDIA_PREV_TRACK) hass.services.call(DOMAIN, SERVICE_MEDIA_PREV_TRACK)
# pylint: disable=unused-argument
def setup(hass, config): def setup(hass, config):
""" Listen for keyboard events. """ """ Listen for keyboard events. """
try: try:

View File

@ -196,7 +196,6 @@ def setup(hass, config):
platform.setup_platform(hass, p_config, add_lights) platform.setup_platform(hass, p_config, add_lights)
# pylint: disable=unused-argument
def update_lights_state(now): def update_lights_state(now):
""" Update the states of all the lights. """ """ Update the states of all the lights. """
if lights: if lights:

View File

@ -117,7 +117,6 @@ def request_configuration(host, hass, add_devices_callback):
return return
# pylint: disable=unused-argument
def hue_configuration_callback(data): def hue_configuration_callback(data):
""" Actions to do when our configuration callback is called. """ """ Actions to do when our configuration callback is called. """
setup_bridge(host, hass, add_devices_callback) setup_bridge(host, hass, add_devices_callback)

View File

@ -9,7 +9,6 @@ from homeassistant.components.wink import WinkToggleDevice
from homeassistant.const import CONF_ACCESS_TOKEN from homeassistant.const import CONF_ACCESS_TOKEN
# pylint: disable=unused-argument
def setup_platform(hass, config, add_devices_callback, discovery_info=None): def setup_platform(hass, config, add_devices_callback, discovery_info=None):
""" Find and return Wink lights. """ """ Find and return Wink lights. """
token = config.get(CONF_ACCESS_TOKEN) token = config.get(CONF_ACCESS_TOKEN)

View File

@ -11,7 +11,6 @@ from homeassistant.const import CONF_API_KEY
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
# pylint: disable=unused-argument
def get_service(hass, config): def get_service(hass, config):
""" Get the pushbullet notification service. """ """ Get the pushbullet notification service. """

View File

@ -30,7 +30,6 @@ def setup(hass, config):
entities = {ENTITY_ID_FORMAT.format(util.slugify(pname)): pstring entities = {ENTITY_ID_FORMAT.format(util.slugify(pname)): pstring
for pname, pstring in config[DOMAIN].items()} for pname, pstring in config[DOMAIN].items()}
# pylint: disable=unused-argument
def update_process_states(time): def update_process_states(time):
""" Check ps for currently running processes and update states. """ """ Check ps for currently running processes and update states. """
with os.popen(PS_STRING, 'r') as psfile: with os.popen(PS_STRING, 'r') as psfile:

View File

@ -47,7 +47,6 @@ def setup(hass, config):
sensors = platform_devices_from_config( sensors = platform_devices_from_config(
config, DOMAIN, hass, ENTITY_ID_FORMAT, logger) config, DOMAIN, hass, ENTITY_ID_FORMAT, logger)
# pylint: disable=unused-argument
@util.Throttle(MIN_TIME_BETWEEN_SCANS) @util.Throttle(MIN_TIME_BETWEEN_SCANS)
def update_sensor_states(now): def update_sensor_states(now):
""" Update states of all sensors. """ """ Update states of all sensors. """

View File

@ -8,7 +8,6 @@ from homeassistant.components.wink import WinkSensorDevice
from homeassistant.const import CONF_ACCESS_TOKEN from homeassistant.const import CONF_ACCESS_TOKEN
# pylint: disable=unused-argument
def get_devices(hass, config): def get_devices(hass, config):
""" Find and return Wink sensors. """ """ Find and return Wink sensors. """
token = config.get(CONF_ACCESS_TOKEN) token = config.get(CONF_ACCESS_TOKEN)
@ -24,7 +23,6 @@ def get_devices(hass, config):
return get_sensors() return get_sensors()
# pylint: disable=unused-argument
def devices_discovered(hass, config, info): def devices_discovered(hass, config, info):
""" Called when a device is discovered. """ """ Called when a device is discovered. """
return get_sensors() return get_sensors()

View File

@ -78,7 +78,6 @@ def setup(hass, config):
hass.services.register( hass.services.register(
DOMAIN, SERVICE_TEST_UNKNOWN_ALARM, lambda call: unknown_alarm()) DOMAIN, SERVICE_TEST_UNKNOWN_ALARM, lambda call: unknown_alarm())
# pylint: disable=unused-argument
def unknown_alarm_if_lights_on(entity_id, old_state, new_state): def unknown_alarm_if_lights_on(entity_id, old_state, new_state):
""" Called when a light has been turned on. """ """ Called when a light has been turned on. """
if not device_tracker.is_on(hass): if not device_tracker.is_on(hass):
@ -88,7 +87,6 @@ def setup(hass, config):
light.ENTITY_ID_ALL_LIGHTS, light.ENTITY_ID_ALL_LIGHTS,
unknown_alarm_if_lights_on, STATE_OFF, STATE_ON) unknown_alarm_if_lights_on, STATE_OFF, STATE_ON)
# pylint: disable=unused-argument
def ring_known_alarm(entity_id, old_state, new_state): def ring_known_alarm(entity_id, old_state, new_state):
""" Called when a known person comes home. """ """ Called when a known person comes home. """
if light.is_on(hass, known_light_id): if light.is_on(hass, known_light_id):

View File

@ -65,7 +65,6 @@ def setup(hass, config):
switches = platform_devices_from_config( switches = platform_devices_from_config(
config, DOMAIN, hass, ENTITY_ID_FORMAT, logger) config, DOMAIN, hass, ENTITY_ID_FORMAT, logger)
# pylint: disable=unused-argument
@util.Throttle(MIN_TIME_BETWEEN_SCANS) @util.Throttle(MIN_TIME_BETWEEN_SCANS)
def update_states(now): def update_states(now):
""" Update states of all switches. """ """ Update states of all switches. """

View File

@ -11,7 +11,6 @@ except ImportError:
pass pass
# pylint: disable=unused-argument
def get_devices(hass, config): def get_devices(hass, config):
""" Find and return Tellstick switches. """ """ Find and return Tellstick switches. """
try: try:
@ -54,12 +53,10 @@ class TellstickSwitch(ToggleDevice):
return last_command == tc_constants.TELLSTICK_TURNON return last_command == tc_constants.TELLSTICK_TURNON
# pylint: disable=unused-argument
def turn_on(self, **kwargs): def turn_on(self, **kwargs):
""" Turns the switch on. """ """ Turns the switch on. """
self.tellstick.turn_on() self.tellstick.turn_on()
# pylint: disable=unused-argument
def turn_off(self, **kwargs): def turn_off(self, **kwargs):
""" Turns the switch off. """ """ Turns the switch off. """
self.tellstick.turn_off() self.tellstick.turn_off()

View File

@ -7,7 +7,6 @@ from homeassistant.components.switch import (
ATTR_TODAY_MWH, ATTR_CURRENT_POWER_MWH) ATTR_TODAY_MWH, ATTR_CURRENT_POWER_MWH)
# pylint: disable=unused-argument
def get_devices(hass, config): def get_devices(hass, config):
""" Find and return WeMo switches. """ """ Find and return WeMo switches. """

View File

@ -8,7 +8,6 @@ from homeassistant.components.wink import WinkToggleDevice
from homeassistant.const import CONF_ACCESS_TOKEN from homeassistant.const import CONF_ACCESS_TOKEN
# pylint: disable=unused-argument
def get_devices(hass, config): def get_devices(hass, config):
""" Find and return Wink switches. """ """ Find and return Wink switches. """
token = config.get(CONF_ACCESS_TOKEN) token = config.get(CONF_ACCESS_TOKEN)
@ -24,7 +23,6 @@ def get_devices(hass, config):
return get_switches() return get_switches()
# pylint: disable=unused-argument
def devices_discovered(hass, config, info): def devices_discovered(hass, config, info):
""" Called when a device is discovered. """ """ Called when a device is discovered. """
return get_switches() return get_switches()

View File

@ -129,7 +129,6 @@ def setup(hass, config):
sensor.has_value(datatype): sensor.has_value(datatype):
update_sensor_value_state(sensor_name, sensor.value(datatype)) update_sensor_value_state(sensor_name, sensor.value(datatype))
# pylint: disable=unused-argument
def update_sensors_state(time): def update_sensors_state(time):
""" Update the state of all sensors """ """ Update the state of all sensors """
for sensor in sensors: for sensor in sensors:

View File

@ -67,7 +67,6 @@ def setup(hass, config):
if not thermostats: if not thermostats:
return False return False
# pylint: disable=unused-argument
@util.Throttle(MIN_TIME_BETWEEN_SCANS) @util.Throttle(MIN_TIME_BETWEEN_SCANS)
def update_state(now): def update_state(now):
""" Update thermostat state. """ """ Update thermostat state. """

View File

@ -7,7 +7,6 @@ from homeassistant.components.thermostat import ThermostatDevice
from homeassistant.const import (CONF_USERNAME, CONF_PASSWORD, TEMP_CELCIUS) from homeassistant.const import (CONF_USERNAME, CONF_PASSWORD, TEMP_CELCIUS)
# pylint: disable=unused-argument
def get_devices(hass, config): def get_devices(hass, config):
""" Gets Nest thermostats. """ """ Gets Nest thermostats. """
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)

View File

@ -8,12 +8,14 @@ reports=no
# cyclic-import - doesn't test if both import on load # cyclic-import - doesn't test if both import on load
# abstract-class-little-used - Prevents from setting right foundation # abstract-class-little-used - Prevents from setting right foundation
# abstract-class-not-used - is flaky, should not show up but does # abstract-class-not-used - is flaky, should not show up but does
# unused-argument - generic callbacks and setup methods create a lot of warnings
disable= disable=
locally-disabled, locally-disabled,
duplicate-code, duplicate-code,
cyclic-import, cyclic-import,
abstract-class-little-used, abstract-class-little-used,
abstract-class-not-used abstract-class-not-used,
unused-argument
[EXCEPTIONS] [EXCEPTIONS]
overgeneral-exceptions=Exception,HomeAssistantError overgeneral-exceptions=Exception,HomeAssistantError

View File

@ -184,7 +184,7 @@ class TestHTTP(unittest.TestCase):
""" Test if the API allows us to fire an event. """ """ Test if the API allows us to fire an event. """
test_value = [] test_value = []
def listener(event): # pylint: disable=unused-argument def listener(event):
""" Helper method that will verify our event got called. """ """ Helper method that will verify our event got called. """
test_value.append(1) test_value.append(1)
@ -203,7 +203,7 @@ class TestHTTP(unittest.TestCase):
""" Test if the API allows us to fire an event. """ """ Test if the API allows us to fire an event. """
test_value = [] test_value = []
def listener(event): # pylint: disable=unused-argument def listener(event):
""" Helper method that will verify that our event got called and """ Helper method that will verify that our event got called and
that test if our data came through. """ that test if our data came through. """
if "test" in event.data: if "test" in event.data:
@ -225,7 +225,7 @@ class TestHTTP(unittest.TestCase):
""" Test if the API allows us to fire an event. """ """ Test if the API allows us to fire an event. """
test_value = [] test_value = []
def listener(event): # pylint: disable=unused-argument def listener(event):
""" Helper method that will verify our event got called. """ """ Helper method that will verify our event got called. """
test_value.append(1) test_value.append(1)
@ -281,7 +281,7 @@ class TestHTTP(unittest.TestCase):
""" Test if the API allows us to call a service. """ """ Test if the API allows us to call a service. """
test_value = [] test_value = []
def listener(service_call): # pylint: disable=unused-argument def listener(service_call):
""" Helper method that will verify that our service got called. """ """ Helper method that will verify that our service got called. """
test_value.append(1) test_value.append(1)
@ -300,7 +300,7 @@ class TestHTTP(unittest.TestCase):
""" Test if the API allows us to call a service. """ """ Test if the API allows us to call a service. """
test_value = [] test_value = []
def listener(service_call): # pylint: disable=unused-argument def listener(service_call):
""" Helper method that will verify that our service got called and """ Helper method that will verify that our service got called and
that test if our data came through. """ that test if our data came through. """
if "test" in service_call.data: if "test" in service_call.data:

View File

@ -93,7 +93,7 @@ class TestRemoteMethods(unittest.TestCase):
""" Test Python API fire_event. """ """ Test Python API fire_event. """
test_value = [] test_value = []
def listener(event): # pylint: disable=unused-argument def listener(event):
""" Helper method that will verify our event got called. """ """ Helper method that will verify our event got called. """
test_value.append(1) test_value.append(1)
@ -158,7 +158,7 @@ class TestRemoteMethods(unittest.TestCase):
""" Test Python API services.call. """ """ Test Python API services.call. """
test_value = [] test_value = []
def listener(service_call): # pylint: disable=unused-argument def listener(service_call):
""" Helper method that will verify that our service got called. """ """ Helper method that will verify that our service got called. """
test_value.append(1) test_value.append(1)
@ -214,7 +214,7 @@ class TestRemoteClasses(unittest.TestCase):
""" Test if events fired from the eventbus get fired. """ """ Test if events fired from the eventbus get fired. """
test_value = [] test_value = []
def listener(event): # pylint: disable=unused-argument def listener(event):
""" Helper method that will verify our event got called. """ """ Helper method that will verify our event got called. """
test_value.append(1) test_value.append(1)