diff --git a/config/custom_components/example.py b/config/custom_components/example.py index ee422174377d..a972e3ab5764 100644 --- a/config/custom_components/example.py +++ b/config/custom_components/example.py @@ -34,7 +34,6 @@ SERVICE_FLASH = 'flash' _LOGGER = logging.getLogger(__name__) -# pylint: disable=unused-argument def setup(hass, config): """ Setup example component. """ diff --git a/homeassistant/__main__.py b/homeassistant/__main__.py index 8226e1fdc84b..8c1808caaea3 100644 --- a/homeassistant/__main__.py +++ b/homeassistant/__main__.py @@ -101,7 +101,6 @@ def main(): hass = bootstrap.from_config_file(config_path) if args.open_ui: - # pylint: disable=unused-argument def open_browser(event): """ Open the webinterface in a browser. """ if hass.local_api is not None: diff --git a/homeassistant/components/__init__.py b/homeassistant/components/__init__.py index 6720ae2a2d93..0b757766bc04 100644 --- a/homeassistant/components/__init__.py +++ b/homeassistant/components/__init__.py @@ -70,7 +70,6 @@ def turn_off(hass, entity_id=None, **service_data): hass.services.call(ha.DOMAIN, SERVICE_TURN_OFF, service_data) -# pylint: disable=unused-argument def setup(hass, config): """ Setup general services related to homeassistant. """ diff --git a/homeassistant/components/automation/state.py b/homeassistant/components/automation/state.py index d2be5a54006b..c8adfe95bbeb 100644 --- a/homeassistant/components/automation/state.py +++ b/homeassistant/components/automation/state.py @@ -26,7 +26,6 @@ def register(hass, config, action): from_state = config.get(CONF_FROM, MATCH_ALL) to_state = config.get(CONF_TO, MATCH_ALL) - # pylint: disable=unused-argument def state_automation_listener(entity, from_s, to_s): """ Listens for state changes and calls action. """ action() diff --git a/homeassistant/components/automation/time.py b/homeassistant/components/automation/time.py index b1fca4121e6b..7e38960534d1 100644 --- a/homeassistant/components/automation/time.py +++ b/homeassistant/components/automation/time.py @@ -17,7 +17,6 @@ def register(hass, config, action): minutes = convert(config.get(CONF_MINUTES), int) seconds = convert(config.get(CONF_SECONDS), int) - # pylint: disable=unused-argument def time_automation_listener(now): """ Listens for time changes and calls action. """ action() diff --git a/homeassistant/components/browser.py b/homeassistant/components/browser.py index dc3fc568fde0..c5a55afad403 100644 --- a/homeassistant/components/browser.py +++ b/homeassistant/components/browser.py @@ -11,7 +11,6 @@ DEPENDENCIES = [] SERVICE_BROWSE_URL = "browse_url" -# pylint: disable=unused-argument def setup(hass, config): """ Listen for browse_url events and open the url in the default webbrowser. """ diff --git a/homeassistant/components/chromecast.py b/homeassistant/components/chromecast.py index 12591e3af920..2f6190073654 100644 --- a/homeassistant/components/chromecast.py +++ b/homeassistant/components/chromecast.py @@ -158,7 +158,6 @@ def setup(hass, config): for host in hosts: setup_chromecast(casts, host) - # pylint: disable=unused-argument def chromecast_discovered(service, info): """ Called when a Chromecast has been discovered. """ logger.info("New Chromecast discovered: %s", info[0]) @@ -212,7 +211,7 @@ def setup(hass, config): 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. """ if casts: logger.info("Updating Chromecast status") diff --git a/homeassistant/components/configurator.py b/homeassistant/components/configurator.py index 2e43e9c54f69..fdd3c5716018 100644 --- a/homeassistant/components/configurator.py +++ b/homeassistant/components/configurator.py @@ -71,7 +71,6 @@ def request_done(request_id): pass -# pylint: disable=unused-argument def setup(hass, config): """ Set up Configurator. """ return True diff --git a/homeassistant/components/demo.py b/homeassistant/components/demo.py index cfb37895561e..0dcc1a41bf70 100644 --- a/homeassistant/components/demo.py +++ b/homeassistant/components/demo.py @@ -174,7 +174,6 @@ def setup(hass, config): configurator_ids = [] - # pylint: disable=unused-argument def hue_configuration_callback(data): """ Fake callback, mark config as done. """ time.sleep(2) diff --git a/homeassistant/components/device_sun_light_trigger.py b/homeassistant/components/device_sun_light_trigger.py index c9668853c739..90d06e6a3c1a 100644 --- a/homeassistant/components/device_sun_light_trigger.py +++ b/homeassistant/components/device_sun_light_trigger.py @@ -66,7 +66,6 @@ def setup(hass, config): else: return None - # pylint: disable=unused-argument def schedule_light_on_sun_rise(entity, old_state, new_state): """The moment sun sets we want to have all the lights on. We will schedule to have each light start after one another diff --git a/homeassistant/components/device_tracker/__init__.py b/homeassistant/components/device_tracker/__init__.py index 956d2f3957f6..f7f4061a9c2b 100644 --- a/homeassistant/components/device_tracker/__init__.py +++ b/homeassistant/components/device_tracker/__init__.py @@ -114,7 +114,6 @@ class DeviceTracker(object): dev_group = group.Group( hass, GROUP_NAME_ALL_DEVICES, user_defined=False) - # pylint: disable=unused-argument def reload_known_devices_service(service): """ Reload known devices file. """ self._read_known_devices_file() diff --git a/homeassistant/components/device_tracker/luci.py b/homeassistant/components/device_tracker/luci.py index 9dbf503fc944..637c48ddf261 100644 --- a/homeassistant/components/device_tracker/luci.py +++ b/homeassistant/components/device_tracker/luci.py @@ -17,7 +17,6 @@ MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5) _LOGGER = logging.getLogger(__name__) -# pylint: disable=unused-argument def get_scanner(hass, config): """ Validates config and returns a Luci scanner. """ if not validate_config(config, diff --git a/homeassistant/components/device_tracker/netgear.py b/homeassistant/components/device_tracker/netgear.py index 14a01b7d658c..aac095367465 100644 --- a/homeassistant/components/device_tracker/netgear.py +++ b/homeassistant/components/device_tracker/netgear.py @@ -14,7 +14,6 @@ MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5) _LOGGER = logging.getLogger(__name__) -# pylint: disable=unused-argument def get_scanner(hass, config): """ Validates config and returns a Netgear scanner. """ if not validate_config(config, diff --git a/homeassistant/components/device_tracker/nmap_tracker.py b/homeassistant/components/device_tracker/nmap_tracker.py index 4d914d5c1c00..a4fd5f6cfff1 100644 --- a/homeassistant/components/device_tracker/nmap_tracker.py +++ b/homeassistant/components/device_tracker/nmap_tracker.py @@ -20,7 +20,6 @@ MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5) _LOGGER = logging.getLogger(__name__) -# pylint: disable=unused-argument def get_scanner(hass, config): """ Validates config and returns a Nmap scanner. """ if not validate_config(config, {DOMAIN: [CONF_HOSTS]}, diff --git a/homeassistant/components/device_tracker/tomato.py b/homeassistant/components/device_tracker/tomato.py index 81755f42c660..265dcf84b571 100644 --- a/homeassistant/components/device_tracker/tomato.py +++ b/homeassistant/components/device_tracker/tomato.py @@ -20,7 +20,6 @@ CONF_HTTP_ID = "http_id" _LOGGER = logging.getLogger(__name__) -# pylint: disable=unused-argument def get_scanner(hass, config): """ Validates config and returns a Tomato scanner. """ if not validate_config(config, diff --git a/homeassistant/components/discovery.py b/homeassistant/components/discovery.py index fde6061dfaa6..195203e8134c 100644 --- a/homeassistant/components/discovery.py +++ b/homeassistant/components/discovery.py @@ -75,7 +75,6 @@ def setup(hass, config): ATTR_DISCOVERED: info }) - # pylint: disable=unused-argument def start_discovery(event): """ Start discovering. """ netdisco = DiscoveryService(SCAN_INTERVAL) diff --git a/homeassistant/components/group.py b/homeassistant/components/group.py index 05c69b6e2304..bcf7f3fe8b4a 100644 --- a/homeassistant/components/group.py +++ b/homeassistant/components/group.py @@ -163,7 +163,6 @@ class Group(object): self.hass.bus.remove_listener( ha.EVENT_STATE_CHANGED, self._update_group_state) - # pylint: disable=unused-argument def _update_group_state(self, entity_id, old_state, new_state): """ Updates the group state based on a state change by a tracked entity. """ diff --git a/homeassistant/components/http/__init__.py b/homeassistant/components/http/__init__.py index f2b5eefa5a1e..67030407f5f3 100644 --- a/homeassistant/components/http/__init__.py +++ b/homeassistant/components/http/__init__.py @@ -351,7 +351,6 @@ class RequestHandler(SimpleHTTPRequestHandler): """ DELETE request handler. """ self._handle_request('DELETE') - # pylint: disable=unused-argument def _handle_get_root(self, path_match, data): """ Renders the debug interface. """ @@ -390,17 +389,14 @@ class RequestHandler(SimpleHTTPRequestHandler): "" "").format(app_url, auth)) - # pylint: disable=unused-argument def _handle_get_api(self, path_match, data): """ Renders the debug interface. """ self._json_message("API running.") - # pylint: disable=unused-argument def _handle_get_api_states(self, path_match, data): """ Returns a dict containing all entity ids and their state. """ self._write_json(self.server.hass.states.all()) - # pylint: disable=unused-argument def _handle_get_api_states_entity(self, path_match, data): """ Returns the state of a specific entity. """ entity_id = path_match.group('entity_id') diff --git a/homeassistant/components/keyboard.py b/homeassistant/components/keyboard.py index 2d8c3995a2fb..8e820856c343 100644 --- a/homeassistant/components/keyboard.py +++ b/homeassistant/components/keyboard.py @@ -46,7 +46,6 @@ def media_prev_track(hass): hass.services.call(DOMAIN, SERVICE_MEDIA_PREV_TRACK) -# pylint: disable=unused-argument def setup(hass, config): """ Listen for keyboard events. """ try: diff --git a/homeassistant/components/light/__init__.py b/homeassistant/components/light/__init__.py index 9b0f9eda1629..48e8f862fc77 100644 --- a/homeassistant/components/light/__init__.py +++ b/homeassistant/components/light/__init__.py @@ -196,7 +196,6 @@ def setup(hass, config): platform.setup_platform(hass, p_config, add_lights) - # pylint: disable=unused-argument def update_lights_state(now): """ Update the states of all the lights. """ if lights: diff --git a/homeassistant/components/light/hue.py b/homeassistant/components/light/hue.py index 8bbe528c6c3c..6efce68d0310 100644 --- a/homeassistant/components/light/hue.py +++ b/homeassistant/components/light/hue.py @@ -117,7 +117,6 @@ def request_configuration(host, hass, add_devices_callback): return - # pylint: disable=unused-argument def hue_configuration_callback(data): """ Actions to do when our configuration callback is called. """ setup_bridge(host, hass, add_devices_callback) diff --git a/homeassistant/components/light/wink.py b/homeassistant/components/light/wink.py index e8dd3c1fc4d0..dc7b7041611e 100644 --- a/homeassistant/components/light/wink.py +++ b/homeassistant/components/light/wink.py @@ -9,7 +9,6 @@ from homeassistant.components.wink import WinkToggleDevice from homeassistant.const import CONF_ACCESS_TOKEN -# pylint: disable=unused-argument def setup_platform(hass, config, add_devices_callback, discovery_info=None): """ Find and return Wink lights. """ token = config.get(CONF_ACCESS_TOKEN) diff --git a/homeassistant/components/notify/pushbullet.py b/homeassistant/components/notify/pushbullet.py index 953fa8744580..cea1b216e8b3 100644 --- a/homeassistant/components/notify/pushbullet.py +++ b/homeassistant/components/notify/pushbullet.py @@ -11,7 +11,6 @@ from homeassistant.const import CONF_API_KEY _LOGGER = logging.getLogger(__name__) -# pylint: disable=unused-argument def get_service(hass, config): """ Get the pushbullet notification service. """ diff --git a/homeassistant/components/process.py b/homeassistant/components/process.py index 5d18557f9986..b356532af7ec 100644 --- a/homeassistant/components/process.py +++ b/homeassistant/components/process.py @@ -30,7 +30,6 @@ def setup(hass, config): entities = {ENTITY_ID_FORMAT.format(util.slugify(pname)): pstring for pname, pstring in config[DOMAIN].items()} - # pylint: disable=unused-argument def update_process_states(time): """ Check ps for currently running processes and update states. """ with os.popen(PS_STRING, 'r') as psfile: diff --git a/homeassistant/components/sensor/__init__.py b/homeassistant/components/sensor/__init__.py index 2ed732289b64..91d4cec92364 100644 --- a/homeassistant/components/sensor/__init__.py +++ b/homeassistant/components/sensor/__init__.py @@ -47,7 +47,6 @@ def setup(hass, config): sensors = platform_devices_from_config( config, DOMAIN, hass, ENTITY_ID_FORMAT, logger) - # pylint: disable=unused-argument @util.Throttle(MIN_TIME_BETWEEN_SCANS) def update_sensor_states(now): """ Update states of all sensors. """ diff --git a/homeassistant/components/sensor/wink.py b/homeassistant/components/sensor/wink.py index 99303d3ef561..6dcb6b3d9bd7 100644 --- a/homeassistant/components/sensor/wink.py +++ b/homeassistant/components/sensor/wink.py @@ -8,7 +8,6 @@ from homeassistant.components.wink import WinkSensorDevice from homeassistant.const import CONF_ACCESS_TOKEN -# pylint: disable=unused-argument def get_devices(hass, config): """ Find and return Wink sensors. """ token = config.get(CONF_ACCESS_TOKEN) @@ -24,7 +23,6 @@ def get_devices(hass, config): return get_sensors() -# pylint: disable=unused-argument def devices_discovered(hass, config, info): """ Called when a device is discovered. """ return get_sensors() diff --git a/homeassistant/components/simple_alarm.py b/homeassistant/components/simple_alarm.py index e29659f3c5b0..e4ae8e6e9e93 100644 --- a/homeassistant/components/simple_alarm.py +++ b/homeassistant/components/simple_alarm.py @@ -78,7 +78,6 @@ def setup(hass, config): hass.services.register( 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): """ Called when a light has been turned on. """ if not device_tracker.is_on(hass): @@ -88,7 +87,6 @@ def setup(hass, config): light.ENTITY_ID_ALL_LIGHTS, unknown_alarm_if_lights_on, STATE_OFF, STATE_ON) - # pylint: disable=unused-argument def ring_known_alarm(entity_id, old_state, new_state): """ Called when a known person comes home. """ if light.is_on(hass, known_light_id): diff --git a/homeassistant/components/switch/__init__.py b/homeassistant/components/switch/__init__.py index 5e1a2dd64a87..0b9ca77a4981 100644 --- a/homeassistant/components/switch/__init__.py +++ b/homeassistant/components/switch/__init__.py @@ -65,7 +65,6 @@ def setup(hass, config): switches = platform_devices_from_config( config, DOMAIN, hass, ENTITY_ID_FORMAT, logger) - # pylint: disable=unused-argument @util.Throttle(MIN_TIME_BETWEEN_SCANS) def update_states(now): """ Update states of all switches. """ diff --git a/homeassistant/components/switch/tellstick.py b/homeassistant/components/switch/tellstick.py index 67336481c0af..1f2cd5c66a8a 100644 --- a/homeassistant/components/switch/tellstick.py +++ b/homeassistant/components/switch/tellstick.py @@ -11,7 +11,6 @@ except ImportError: pass -# pylint: disable=unused-argument def get_devices(hass, config): """ Find and return Tellstick switches. """ try: @@ -54,12 +53,10 @@ class TellstickSwitch(ToggleDevice): return last_command == tc_constants.TELLSTICK_TURNON - # pylint: disable=unused-argument def turn_on(self, **kwargs): """ Turns the switch on. """ self.tellstick.turn_on() - # pylint: disable=unused-argument def turn_off(self, **kwargs): """ Turns the switch off. """ self.tellstick.turn_off() diff --git a/homeassistant/components/switch/wemo.py b/homeassistant/components/switch/wemo.py index e6dce192e225..8e5808ee36e8 100644 --- a/homeassistant/components/switch/wemo.py +++ b/homeassistant/components/switch/wemo.py @@ -7,7 +7,6 @@ from homeassistant.components.switch import ( ATTR_TODAY_MWH, ATTR_CURRENT_POWER_MWH) -# pylint: disable=unused-argument def get_devices(hass, config): """ Find and return WeMo switches. """ diff --git a/homeassistant/components/switch/wink.py b/homeassistant/components/switch/wink.py index 58faed9a2a57..cc325454376d 100644 --- a/homeassistant/components/switch/wink.py +++ b/homeassistant/components/switch/wink.py @@ -8,7 +8,6 @@ from homeassistant.components.wink import WinkToggleDevice from homeassistant.const import CONF_ACCESS_TOKEN -# pylint: disable=unused-argument def get_devices(hass, config): """ Find and return Wink switches. """ token = config.get(CONF_ACCESS_TOKEN) @@ -24,7 +23,6 @@ def get_devices(hass, config): return get_switches() -# pylint: disable=unused-argument def devices_discovered(hass, config, info): """ Called when a device is discovered. """ return get_switches() diff --git a/homeassistant/components/tellstick_sensor.py b/homeassistant/components/tellstick_sensor.py index 79a91241316a..5f1ad748900c 100644 --- a/homeassistant/components/tellstick_sensor.py +++ b/homeassistant/components/tellstick_sensor.py @@ -129,7 +129,6 @@ def setup(hass, config): sensor.has_value(datatype): update_sensor_value_state(sensor_name, sensor.value(datatype)) - # pylint: disable=unused-argument def update_sensors_state(time): """ Update the state of all sensors """ for sensor in sensors: diff --git a/homeassistant/components/thermostat/__init__.py b/homeassistant/components/thermostat/__init__.py index 825f9abb51a9..5423c7d26af2 100644 --- a/homeassistant/components/thermostat/__init__.py +++ b/homeassistant/components/thermostat/__init__.py @@ -67,7 +67,6 @@ def setup(hass, config): if not thermostats: return False - # pylint: disable=unused-argument @util.Throttle(MIN_TIME_BETWEEN_SCANS) def update_state(now): """ Update thermostat state. """ diff --git a/homeassistant/components/thermostat/nest.py b/homeassistant/components/thermostat/nest.py index 46c4974d9084..cac2d53d0402 100644 --- a/homeassistant/components/thermostat/nest.py +++ b/homeassistant/components/thermostat/nest.py @@ -7,7 +7,6 @@ from homeassistant.components.thermostat import ThermostatDevice from homeassistant.const import (CONF_USERNAME, CONF_PASSWORD, TEMP_CELCIUS) -# pylint: disable=unused-argument def get_devices(hass, config): """ Gets Nest thermostats. """ logger = logging.getLogger(__name__) diff --git a/pylintrc b/pylintrc index c10fafe25b8b..a9994eb70f52 100644 --- a/pylintrc +++ b/pylintrc @@ -8,12 +8,14 @@ reports=no # cyclic-import - doesn't test if both import on load # abstract-class-little-used - Prevents from setting right foundation # 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= locally-disabled, duplicate-code, cyclic-import, abstract-class-little-used, - abstract-class-not-used + abstract-class-not-used, + unused-argument [EXCEPTIONS] overgeneral-exceptions=Exception,HomeAssistantError diff --git a/tests/test_component_http.py b/tests/test_component_http.py index 13ada8efbc0e..0fe99bea9a13 100644 --- a/tests/test_component_http.py +++ b/tests/test_component_http.py @@ -184,7 +184,7 @@ class TestHTTP(unittest.TestCase): """ Test if the API allows us to fire an event. """ test_value = [] - def listener(event): # pylint: disable=unused-argument + def listener(event): """ Helper method that will verify our event got called. """ test_value.append(1) @@ -203,7 +203,7 @@ class TestHTTP(unittest.TestCase): """ Test if the API allows us to fire an event. """ test_value = [] - def listener(event): # pylint: disable=unused-argument + def listener(event): """ Helper method that will verify that our event got called and that test if our data came through. """ if "test" in event.data: @@ -225,7 +225,7 @@ class TestHTTP(unittest.TestCase): """ Test if the API allows us to fire an event. """ test_value = [] - def listener(event): # pylint: disable=unused-argument + def listener(event): """ Helper method that will verify our event got called. """ test_value.append(1) @@ -281,7 +281,7 @@ class TestHTTP(unittest.TestCase): """ Test if the API allows us to call a service. """ test_value = [] - def listener(service_call): # pylint: disable=unused-argument + def listener(service_call): """ Helper method that will verify that our service got called. """ test_value.append(1) @@ -300,7 +300,7 @@ class TestHTTP(unittest.TestCase): """ Test if the API allows us to call a service. """ 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 that test if our data came through. """ if "test" in service_call.data: diff --git a/tests/test_remote.py b/tests/test_remote.py index da491e690168..22c5dbe4254f 100644 --- a/tests/test_remote.py +++ b/tests/test_remote.py @@ -93,7 +93,7 @@ class TestRemoteMethods(unittest.TestCase): """ Test Python API fire_event. """ test_value = [] - def listener(event): # pylint: disable=unused-argument + def listener(event): """ Helper method that will verify our event got called. """ test_value.append(1) @@ -158,7 +158,7 @@ class TestRemoteMethods(unittest.TestCase): """ Test Python API services.call. """ test_value = [] - def listener(service_call): # pylint: disable=unused-argument + def listener(service_call): """ Helper method that will verify that our service got called. """ test_value.append(1) @@ -214,7 +214,7 @@ class TestRemoteClasses(unittest.TestCase): """ Test if events fired from the eventbus get fired. """ test_value = [] - def listener(event): # pylint: disable=unused-argument + def listener(event): """ Helper method that will verify our event got called. """ test_value.append(1)