From 9b2544c9236c5613430e1b55a5f83256c8af609e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 25 Feb 2020 02:47:15 +0200 Subject: [PATCH] Remove some unneeded pylint suppressions (#32152) --- homeassistant/components/alexa/capabilities.py | 1 - homeassistant/components/alexa/config.py | 2 +- homeassistant/components/almond/config_flow.py | 1 - homeassistant/components/amcrest/__init__.py | 1 - homeassistant/components/automation/geo_location.py | 1 - homeassistant/components/automation/zone.py | 1 - homeassistant/components/device_tracker/legacy.py | 1 - homeassistant/components/hue/config_flow.py | 2 -- homeassistant/components/mqtt/fan.py | 1 - homeassistant/components/mqtt/light/schema_basic.py | 1 - homeassistant/components/mqtt/light/schema_json.py | 1 - homeassistant/components/mqtt/light/schema_template.py | 1 - homeassistant/components/mqtt/switch.py | 1 - homeassistant/components/mqtt/vacuum/schema_legacy.py | 1 - homeassistant/components/mqtt/vacuum/schema_state.py | 1 - homeassistant/components/mysensors/light.py | 2 -- homeassistant/components/pi_hole/__init__.py | 2 +- homeassistant/components/rflink/light.py | 4 ---- homeassistant/components/rflink/switch.py | 1 - homeassistant/components/websocket_api/const.py | 5 +---- homeassistant/components/zha/core/typing.py | 1 - homeassistant/helpers/collection.py | 2 +- homeassistant/util/yaml/loader.py | 1 - 23 files changed, 4 insertions(+), 31 deletions(-) diff --git a/homeassistant/components/alexa/capabilities.py b/homeassistant/components/alexa/capabilities.py index 94cf41d530b..8b38fe4d298 100644 --- a/homeassistant/components/alexa/capabilities.py +++ b/homeassistant/components/alexa/capabilities.py @@ -227,7 +227,6 @@ class AlexaCapability: """Return properties serialized for an API response.""" for prop in self.properties_supported(): prop_name = prop["name"] - # pylint: disable=assignment-from-no-return prop_value = self.get_property(prop_name) if prop_value is not None: result = { diff --git a/homeassistant/components/alexa/config.py b/homeassistant/components/alexa/config.py index bd579dc4dad..7d3a3994ace 100644 --- a/homeassistant/components/alexa/config.py +++ b/homeassistant/components/alexa/config.py @@ -53,7 +53,7 @@ class AbstractConfig(ABC): ) try: await self._unsub_proactive_report - except Exception: # pylint: disable=broad-except + except Exception: self._unsub_proactive_report = None raise diff --git a/homeassistant/components/almond/config_flow.py b/homeassistant/components/almond/config_flow.py index 42f9318a06f..b1eb506270b 100644 --- a/homeassistant/components/almond/config_flow.py +++ b/homeassistant/components/almond/config_flow.py @@ -87,7 +87,6 @@ class AlmondFlowHandler(config_entry_oauth2_flow.AbstractOAuth2FlowHandler): ) return self.async_abort(reason="cannot_connect") - # pylint: disable=invalid-name self.CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_POLL return self.async_create_entry( diff --git a/homeassistant/components/amcrest/__init__.py b/homeassistant/components/amcrest/__init__.py index 5578d350e22..b4b3e1866b4 100644 --- a/homeassistant/components/amcrest/__init__.py +++ b/homeassistant/components/amcrest/__init__.py @@ -109,7 +109,6 @@ CONFIG_SCHEMA = vol.Schema( ) -# pylint: disable=too-many-ancestors class AmcrestChecker(Http): """amcrest.Http wrapper for catching errors.""" diff --git a/homeassistant/components/automation/geo_location.py b/homeassistant/components/automation/geo_location.py index 5dc4f3c80f6..92094a751a0 100644 --- a/homeassistant/components/automation/geo_location.py +++ b/homeassistant/components/automation/geo_location.py @@ -58,7 +58,6 @@ async def async_attach_trigger(hass, config, action, automation_info): from_match = condition.zone(hass, zone_state, from_state) to_match = condition.zone(hass, zone_state, to_state) - # pylint: disable=too-many-boolean-expressions if ( trigger_event == EVENT_ENTER and not from_match diff --git a/homeassistant/components/automation/zone.py b/homeassistant/components/automation/zone.py index 3dba1a4df35..14233d783f9 100644 --- a/homeassistant/components/automation/zone.py +++ b/homeassistant/components/automation/zone.py @@ -53,7 +53,6 @@ async def async_attach_trigger(hass, config, action, automation_info): from_match = False to_match = condition.zone(hass, zone_state, to_s) - # pylint: disable=too-many-boolean-expressions if ( event == EVENT_ENTER and not from_match diff --git a/homeassistant/components/device_tracker/legacy.py b/homeassistant/components/device_tracker/legacy.py index b4bfd506f27..68908f8c79f 100644 --- a/homeassistant/components/device_tracker/legacy.py +++ b/homeassistant/components/device_tracker/legacy.py @@ -411,7 +411,6 @@ class Device(RestoreEntity): self.gps_accuracy = 0 LOGGER.warning("Could not parse gps value for %s: %s", self.dev_id, gps) - # pylint: disable=not-an-iterable await self.async_update() def stale(self, now: dt_util.dt.datetime = None): diff --git a/homeassistant/components/hue/config_flow.py b/homeassistant/components/hue/config_flow.py index d214c5509ea..77c24caa389 100644 --- a/homeassistant/components/hue/config_flow.py +++ b/homeassistant/components/hue/config_flow.py @@ -60,10 +60,8 @@ class HueFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): if ( user_input is not None and self.discovered_bridges is not None - # pylint: disable=unsupported-membership-test and user_input["id"] in self.discovered_bridges ): - # pylint: disable=unsubscriptable-object self.bridge = self.discovered_bridges[user_input["id"]] await self.async_set_unique_id(self.bridge.id, raise_on_progress=False) # We pass user input to link so it will attempt to link right away diff --git a/homeassistant/components/mqtt/fan.py b/homeassistant/components/mqtt/fan.py index 07cb711ebd0..c5e4b3145de 100644 --- a/homeassistant/components/mqtt/fan.py +++ b/homeassistant/components/mqtt/fan.py @@ -141,7 +141,6 @@ async def _async_setup_entity( async_add_entities([MqttFan(config, config_entry, discovery_hash)]) -# pylint: disable=too-many-ancestors class MqttFan( MqttAttributes, MqttAvailability, diff --git a/homeassistant/components/mqtt/light/schema_basic.py b/homeassistant/components/mqtt/light/schema_basic.py index 041c5e804dc..23f8684cf46 100644 --- a/homeassistant/components/mqtt/light/schema_basic.py +++ b/homeassistant/components/mqtt/light/schema_basic.py @@ -154,7 +154,6 @@ async def async_setup_entity_basic( async_add_entities([MqttLight(config, config_entry, discovery_hash)]) -# pylint: disable=too-many-ancestors class MqttLight( MqttAttributes, MqttAvailability, diff --git a/homeassistant/components/mqtt/light/schema_json.py b/homeassistant/components/mqtt/light/schema_json.py index 373fbc1b3b2..e7256614002 100644 --- a/homeassistant/components/mqtt/light/schema_json.py +++ b/homeassistant/components/mqtt/light/schema_json.py @@ -125,7 +125,6 @@ async def async_setup_entity_json( async_add_entities([MqttLightJson(config, config_entry, discovery_hash)]) -# pylint: disable=too-many-ancestors class MqttLightJson( MqttAttributes, MqttAvailability, diff --git a/homeassistant/components/mqtt/light/schema_template.py b/homeassistant/components/mqtt/light/schema_template.py index 82f0fa3c9d0..6bbf5ee1572 100644 --- a/homeassistant/components/mqtt/light/schema_template.py +++ b/homeassistant/components/mqtt/light/schema_template.py @@ -99,7 +99,6 @@ async def async_setup_entity_template( async_add_entities([MqttTemplate(config, config_entry, discovery_hash)]) -# pylint: disable=too-many-ancestors class MqttTemplate( MqttAttributes, MqttAvailability, diff --git a/homeassistant/components/mqtt/switch.py b/homeassistant/components/mqtt/switch.py index 3c35434be86..65b43f6bf53 100644 --- a/homeassistant/components/mqtt/switch.py +++ b/homeassistant/components/mqtt/switch.py @@ -99,7 +99,6 @@ async def _async_setup_entity( async_add_entities([MqttSwitch(config, config_entry, discovery_hash)]) -# pylint: disable=too-many-ancestors class MqttSwitch( MqttAttributes, MqttAvailability, diff --git a/homeassistant/components/mqtt/vacuum/schema_legacy.py b/homeassistant/components/mqtt/vacuum/schema_legacy.py index 6c08b18bc9c..c6322d9fec5 100644 --- a/homeassistant/components/mqtt/vacuum/schema_legacy.py +++ b/homeassistant/components/mqtt/vacuum/schema_legacy.py @@ -168,7 +168,6 @@ async def async_setup_entity_legacy( async_add_entities([MqttVacuum(config, config_entry, discovery_hash)]) -# pylint: disable=too-many-ancestors class MqttVacuum( MqttAttributes, MqttAvailability, diff --git a/homeassistant/components/mqtt/vacuum/schema_state.py b/homeassistant/components/mqtt/vacuum/schema_state.py index 9dd5053d019..0399e66c0ad 100644 --- a/homeassistant/components/mqtt/vacuum/schema_state.py +++ b/homeassistant/components/mqtt/vacuum/schema_state.py @@ -163,7 +163,6 @@ async def async_setup_entity_state( async_add_entities([MqttStateVacuum(config, config_entry, discovery_hash)]) -# pylint: disable=too-many-ancestors class MqttStateVacuum( MqttAttributes, MqttAvailability, diff --git a/homeassistant/components/mysensors/light.py b/homeassistant/components/mysensors/light.py index 45da4a77d5f..b25cf977d83 100644 --- a/homeassistant/components/mysensors/light.py +++ b/homeassistant/components/mysensors/light.py @@ -228,8 +228,6 @@ class MySensorsLightRGB(MySensorsLight): class MySensorsLightRGBW(MySensorsLightRGB): """RGBW child class to MySensorsLightRGB.""" - # pylint: disable=too-many-ancestors - @property def supported_features(self): """Flag supported features.""" diff --git a/homeassistant/components/pi_hole/__init__.py b/homeassistant/components/pi_hole/__init__.py index 5791d17f6dd..fb06d06cfb4 100644 --- a/homeassistant/components/pi_hole/__init__.py +++ b/homeassistant/components/pi_hole/__init__.py @@ -115,7 +115,7 @@ async def async_setup(hass, config): return call_data - service_disable_schema = vol.Schema( # pylint: disable=invalid-name + service_disable_schema = vol.Schema( vol.All( { vol.Required(SERVICE_DISABLE_ATTR_DURATION): vol.All( diff --git a/homeassistant/components/rflink/light.py b/homeassistant/components/rflink/light.py index 1ed19569585..01004a3b45a 100644 --- a/homeassistant/components/rflink/light.py +++ b/homeassistant/components/rflink/light.py @@ -159,14 +159,12 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= hass.data[DATA_DEVICE_REGISTER][EVENT_KEY_COMMAND] = add_new_device -# pylint: disable=too-many-ancestors class RflinkLight(SwitchableRflinkDevice, Light): """Representation of a Rflink light.""" pass -# pylint: disable=too-many-ancestors class DimmableRflinkLight(SwitchableRflinkDevice, Light): """Rflink light device that support dimming.""" @@ -212,7 +210,6 @@ class DimmableRflinkLight(SwitchableRflinkDevice, Light): return SUPPORT_BRIGHTNESS -# pylint: disable=too-many-ancestors class HybridRflinkLight(SwitchableRflinkDevice, Light): """Rflink light device that sends out both dim and on/off commands. @@ -276,7 +273,6 @@ class HybridRflinkLight(SwitchableRflinkDevice, Light): return SUPPORT_BRIGHTNESS -# pylint: disable=too-many-ancestors class ToggleRflinkLight(SwitchableRflinkDevice, Light): """Rflink light device which sends out only 'on' commands. diff --git a/homeassistant/components/rflink/switch.py b/homeassistant/components/rflink/switch.py index 990d76101cc..943f8a6aae6 100644 --- a/homeassistant/components/rflink/switch.py +++ b/homeassistant/components/rflink/switch.py @@ -69,7 +69,6 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= async_add_entities(devices_from_config(config)) -# pylint: disable=too-many-ancestors class RflinkSwitch(SwitchableRflinkDevice, SwitchDevice): """Representation of a Rflink switch.""" diff --git a/homeassistant/components/websocket_api/const.py b/homeassistant/components/websocket_api/const.py index b1fa1263a99..61f12fd5f57 100644 --- a/homeassistant/components/websocket_api/const.py +++ b/homeassistant/components/websocket_api/const.py @@ -12,10 +12,7 @@ if TYPE_CHECKING: from .connection import ActiveConnection # noqa -WebSocketCommandHandler = Callable[ - [HomeAssistant, "ActiveConnection", dict], None -] # pylint: disable=invalid-name - +WebSocketCommandHandler = Callable[[HomeAssistant, "ActiveConnection", dict], None] DOMAIN = "websocket_api" URL = "/api/websocket" diff --git a/homeassistant/components/zha/core/typing.py b/homeassistant/components/zha/core/typing.py index 3d10912d165..fb397ea15ae 100644 --- a/homeassistant/components/zha/core/typing.py +++ b/homeassistant/components/zha/core/typing.py @@ -30,7 +30,6 @@ if TYPE_CHECKING: import homeassistant.components.zha.entity import homeassistant.components.zha.core.channels - # pylint: disable=invalid-name ChannelType = base_channels.ZigbeeChannel ChannelsType = channels.Channels ChannelPoolType = channels.ChannelPool diff --git a/homeassistant/helpers/collection.py b/homeassistant/helpers/collection.py index 025c6c07dee..bea08fb322c 100644 --- a/homeassistant/helpers/collection.py +++ b/homeassistant/helpers/collection.py @@ -35,7 +35,7 @@ ChangeListener = Callable[ Optional[dict], ], Awaitable[None], -] # pylint: disable=invalid-name +] class CollectionError(HomeAssistantError): diff --git a/homeassistant/util/yaml/loader.py b/homeassistant/util/yaml/loader.py index 6b921ade961..ba4d1e77576 100644 --- a/homeassistant/util/yaml/loader.py +++ b/homeassistant/util/yaml/loader.py @@ -41,7 +41,6 @@ def clear_secret_cache() -> None: __SECRET_CACHE.clear() -# pylint: disable=too-many-ancestors class SafeLineLoader(yaml.SafeLoader): """Loader class that keeps track of line numbers."""