Disable pylint unused-argument check
parent
d3f1b83e57
commit
ff230cefe3
config/custom_components
homeassistant
components
device_tracker
http
notify
sensor
thermostat
|
@ -34,7 +34,6 @@ SERVICE_FLASH = 'flash'
|
|||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# pylint: disable=unused-argument
|
||||
def setup(hass, config):
|
||||
""" Setup example component. """
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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. """
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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. """
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -71,7 +71,6 @@ def request_done(request_id):
|
|||
pass
|
||||
|
||||
|
||||
# pylint: disable=unused-argument
|
||||
def setup(hass, config):
|
||||
""" Set up Configurator. """
|
||||
return True
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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]},
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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. """
|
||||
|
|
|
@ -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):
|
|||
"<splash-login auth='{}'></splash-login>"
|
||||
"</body></html>").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')
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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. """
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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. """
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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. """
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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. """
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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. """
|
||||
|
|
|
@ -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__)
|
||||
|
|
4
pylintrc
4
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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue