diff --git a/homeassistant/components/aftership/sensor.py b/homeassistant/components/aftership/sensor.py index e54a48f7ee43aba79216fe64098e5fd54b40d16f..c41e5aec7b51d67d4175cabd64ef40dee0592e63 100644 --- a/homeassistant/components/aftership/sensor.py +++ b/homeassistant/components/aftership/sensor.py @@ -146,10 +146,10 @@ class AfterShipSensor(Entity): async def async_added_to_hass(self): """Register callbacks.""" self.hass.helpers.dispatcher.async_dispatcher_connect( - UPDATE_TOPIC, self.force_update + UPDATE_TOPIC, self._force_update ) - async def force_update(self): + async def _force_update(self): """Force update of data.""" await self.async_update(no_throttle=True) await self.async_update_ha_state() diff --git a/homeassistant/components/axis/config_flow.py b/homeassistant/components/axis/config_flow.py index 3b5efe96760efd1b03ba26a3a07acebfd9ee9d18..3473eba30653dd1d38fc63894d4a7332671c4e61 100644 --- a/homeassistant/components/axis/config_flow.py +++ b/homeassistant/components/axis/config_flow.py @@ -171,7 +171,7 @@ class AxisFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): if discovery_info[CONF_HOST].startswith("169.254"): return self.async_abort(reason="link_local_address") - # pylint: disable=unsupported-assignment-operation + # pylint: disable=no-member # https://github.com/PyCQA/pylint/issues/3167 self.context["macaddress"] = serialnumber if any( diff --git a/homeassistant/components/bayesian/binary_sensor.py b/homeassistant/components/bayesian/binary_sensor.py index acefc5a3b26660718b74b40b808e009c89876f0f..ffa13a6288ca5624ea3a697cbf39c3cc12c0206b 100644 --- a/homeassistant/components/bayesian/binary_sensor.py +++ b/homeassistant/components/bayesian/binary_sensor.py @@ -250,7 +250,7 @@ class BayesianBinarySensor(BinarySensorDevice): def device_state_attributes(self): """Return the state attributes of the sensor.""" return { - ATTR_OBSERVATIONS: [val for val in self.current_obs.values()], + ATTR_OBSERVATIONS: list(self.current_obs.values()), ATTR_PROBABILITY: round(self.probability, 2), ATTR_PROBABILITY_THRESHOLD: self._probability_threshold, } diff --git a/homeassistant/components/bt_smarthub/device_tracker.py b/homeassistant/components/bt_smarthub/device_tracker.py index 58f409c2d4b5644b215776d1dc69a5db5078019f..ece67e3b635b920a1aee025be60b0cf48bebe938 100644 --- a/homeassistant/components/bt_smarthub/device_tracker.py +++ b/homeassistant/components/bt_smarthub/device_tracker.py @@ -69,7 +69,7 @@ class BTSmartHubScanner(DeviceScanner): _LOGGER.warning("Error scanning devices") return - clients = [client for client in data.values()] + clients = list(data.values()) self.last_results = clients def get_bt_smarthub_data(self): diff --git a/homeassistant/components/cert_expiry/helper.py b/homeassistant/components/cert_expiry/helper.py index 9c10887293adbd5e8325b121c53a74aaf8b8ac4c..cd49588ec89f310833c0c4fe2088279f9c481c9f 100644 --- a/homeassistant/components/cert_expiry/helper.py +++ b/homeassistant/components/cert_expiry/helper.py @@ -11,5 +11,6 @@ def get_cert(host, port): address = (host, port) with socket.create_connection(address, timeout=TIMEOUT) as sock: with ctx.wrap_socket(sock, server_hostname=address[0]) as ssock: - cert = ssock.getpeercert() + # pylint disable: https://github.com/PyCQA/pylint/issues/3166 + cert = ssock.getpeercert() # pylint: disable=no-member return cert diff --git a/homeassistant/components/ddwrt/device_tracker.py b/homeassistant/components/ddwrt/device_tracker.py index 4e661376719ec94b2279ed257ae8d9b764e616fe..bd2728d03dcab4badb83318e3d98c696afee0a59 100644 --- a/homeassistant/components/ddwrt/device_tracker.py +++ b/homeassistant/components/ddwrt/device_tracker.py @@ -165,4 +165,4 @@ class DdWrtDeviceScanner(DeviceScanner): def _parse_ddwrt_response(data_str): """Parse the DD-WRT data format.""" - return {key: val for key, val in _DDWRT_DATA_REGEX.findall(data_str)} + return dict(_DDWRT_DATA_REGEX.findall(data_str)) diff --git a/homeassistant/components/deconz/config_flow.py b/homeassistant/components/deconz/config_flow.py index 66df687047f209c6c27532db25f697bdd0b7b894..91768584e8ac9521655cd9649b680cc4e366cc40 100644 --- a/homeassistant/components/deconz/config_flow.py +++ b/homeassistant/components/deconz/config_flow.py @@ -187,7 +187,7 @@ class DeconzFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): ): return self.async_abort(reason="already_in_progress") - # pylint: disable=unsupported-assignment-operation + # pylint: disable=no-member # https://github.com/PyCQA/pylint/issues/3167 self.context[CONF_BRIDGEID] = bridgeid self.deconz_config = { diff --git a/homeassistant/components/esphome/climate.py b/homeassistant/components/esphome/climate.py index 7337aec4541fe165a5ad33916d9a8475b38dfe88..fa840078aa4ee717d837d9d7994cd56bd15e39db 100644 --- a/homeassistant/components/esphome/climate.py +++ b/homeassistant/components/esphome/climate.py @@ -126,6 +126,9 @@ class EsphomeClimateDevice(EsphomeEntity, ClimateDevice): features |= SUPPORT_PRESET_MODE return features + # https://github.com/PyCQA/pylint/issues/3150 for all @esphome_state_property + # pylint: disable=invalid-overridden-method + @esphome_state_property def hvac_mode(self) -> Optional[str]: """Return current operation ie. heat, cool, idle.""" diff --git a/homeassistant/components/esphome/config_flow.py b/homeassistant/components/esphome/config_flow.py index 9680ed46acdf5de60289fcbdf44b40ab9788b197..47c00f434635b6ee11bc6593cc82ac1e8ed29494 100644 --- a/homeassistant/components/esphome/config_flow.py +++ b/homeassistant/components/esphome/config_flow.py @@ -44,11 +44,12 @@ class EsphomeFlowHandler(config_entries.ConfigFlow): @property def _name(self): + # pylint: disable=no-member # https://github.com/PyCQA/pylint/issues/3167 return self.context.get("name") @_name.setter def _name(self, value): - # pylint: disable=unsupported-assignment-operation + # pylint: disable=no-member # https://github.com/PyCQA/pylint/issues/3167 self.context["name"] = value self.context["title_placeholders"] = {"name": self._name} diff --git a/homeassistant/components/esphome/cover.py b/homeassistant/components/esphome/cover.py index 31b895b4eb2f558e747df07c5765d37e14295ec8..980fc936940620bed0a45e97864b596c03870250 100644 --- a/homeassistant/components/esphome/cover.py +++ b/homeassistant/components/esphome/cover.py @@ -70,6 +70,9 @@ class EsphomeCover(EsphomeEntity, CoverDevice): def _state(self) -> Optional[CoverState]: return super()._state + # https://github.com/PyCQA/pylint/issues/3150 for all @esphome_state_property + # pylint: disable=invalid-overridden-method + @esphome_state_property def is_closed(self) -> Optional[bool]: """Return if the cover is closed or not.""" diff --git a/homeassistant/components/esphome/fan.py b/homeassistant/components/esphome/fan.py index 44059673f15404323af2fffe8795169d2f66f85e..cddb75b41bfa79e3cebd0faa6396ec7606586f65 100644 --- a/homeassistant/components/esphome/fan.py +++ b/homeassistant/components/esphome/fan.py @@ -92,6 +92,9 @@ class EsphomeFan(EsphomeEntity, FanEntity): key=self._static_info.key, oscillating=oscillating ) + # https://github.com/PyCQA/pylint/issues/3150 for all @esphome_state_property + # pylint: disable=invalid-overridden-method + @esphome_state_property def is_on(self) -> Optional[bool]: """Return true if the entity is on.""" diff --git a/homeassistant/components/esphome/light.py b/homeassistant/components/esphome/light.py index 334e7e645a7518e71c6e6aebaec8794d36c56225..9a2a0ccd0bca0e55b4c7618540ddc70400d76d1a 100644 --- a/homeassistant/components/esphome/light.py +++ b/homeassistant/components/esphome/light.py @@ -61,6 +61,9 @@ class EsphomeLight(EsphomeEntity, Light): def _state(self) -> Optional[LightState]: return super()._state + # https://github.com/PyCQA/pylint/issues/3150 for all @esphome_state_property + # pylint: disable=invalid-overridden-method + @esphome_state_property def is_on(self) -> Optional[bool]: """Return true if the switch is on.""" diff --git a/homeassistant/components/esphome/sensor.py b/homeassistant/components/esphome/sensor.py index 3168bae7ec88d21b1c3acf023a8318bdbeb347ab..2b7a8b94f1eaa424429794aa292018cd6762469f 100644 --- a/homeassistant/components/esphome/sensor.py +++ b/homeassistant/components/esphome/sensor.py @@ -37,6 +37,10 @@ async def async_setup_entry( ) +# https://github.com/PyCQA/pylint/issues/3150 for all @esphome_state_property +# pylint: disable=invalid-overridden-method + + class EsphomeSensor(EsphomeEntity): """A sensor implementation for esphome.""" diff --git a/homeassistant/components/esphome/switch.py b/homeassistant/components/esphome/switch.py index f66bfaa39f3b9e4f3a3e53e8d1e0dd8e0354ea0c..b52d630e1b4714a4b3bc72f496a69fbd9f8cb011 100644 --- a/homeassistant/components/esphome/switch.py +++ b/homeassistant/components/esphome/switch.py @@ -49,6 +49,8 @@ class EsphomeSwitch(EsphomeEntity, SwitchDevice): """Return true if we do optimistic updates.""" return self._static_info.assumed_state + # https://github.com/PyCQA/pylint/issues/3150 for @esphome_state_property + # pylint: disable=invalid-overridden-method @esphome_state_property def is_on(self) -> Optional[bool]: """Return true if the switch is on.""" diff --git a/homeassistant/components/homekit_controller/config_flow.py b/homeassistant/components/homekit_controller/config_flow.py index 008e0f8566dcdd1acdee846268ce3bf1fcb851dd..40bf87d6f0a91120c3a6ad79672cf3690e1e1fd5 100644 --- a/homeassistant/components/homekit_controller/config_flow.py +++ b/homeassistant/components/homekit_controller/config_flow.py @@ -122,7 +122,7 @@ class HomekitControllerFlowHandler(config_entries.ConfigFlow): _LOGGER.debug("Discovered device %s (%s - %s)", name, model, hkid) - # pylint: disable=unsupported-assignment-operation + # pylint: disable=no-member # https://github.com/PyCQA/pylint/issues/3167 self.context["hkid"] = hkid self.context["title_placeholders"] = {"name": name} diff --git a/homeassistant/components/hue/config_flow.py b/homeassistant/components/hue/config_flow.py index 9c0e94bc3bdce08f12af87b2a630319482ef81c6..ebd71ba7c1cf9a1259e8404c831c24cf8665d581 100644 --- a/homeassistant/components/hue/config_flow.py +++ b/homeassistant/components/hue/config_flow.py @@ -50,6 +50,8 @@ class HueFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): VERSION = 1 CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_POLL + # pylint: disable=no-member # https://github.com/PyCQA/pylint/issues/3167 + def __init__(self): """Initialize the Hue flow.""" self.host = None diff --git a/homeassistant/components/mqtt/__init__.py b/homeassistant/components/mqtt/__init__.py index 9b25a6ef6e481714402279afc30ae208a87f2470..e3605cb866484c9adfbff08c3455bc10b11b6a78 100644 --- a/homeassistant/components/mqtt/__init__.py +++ b/homeassistant/components/mqtt/__init__.py @@ -776,7 +776,9 @@ class MQTT: self._mqttc.on_message = self._mqtt_on_message if will_message is not None: - self._mqttc.will_set(*attr.astuple(will_message)) + self._mqttc.will_set( # pylint: disable=no-value-for-parameter + *attr.astuple(will_message) + ) async def async_publish( self, topic: str, payload: PublishPayloadType, qos: int, retain: bool @@ -909,7 +911,11 @@ class MQTT: self.hass.add_job(self._async_perform_subscription, topic, max_qos) if self.birth_message: - self.hass.add_job(self.async_publish(*attr.astuple(self.birth_message))) + self.hass.add_job( + self.async_publish( # pylint: disable=no-value-for-parameter + *attr.astuple(self.birth_message) + ) + ) def _mqtt_on_message(self, _mqttc, _userdata, msg) -> None: """Message received callback.""" diff --git a/homeassistant/components/onkyo/media_player.py b/homeassistant/components/onkyo/media_player.py index af92f6c5f0510a998afe060d92f67c4547f6d96b..92e5f01d486861a1e1204b7637bc56250a70d87c 100644 --- a/homeassistant/components/onkyo/media_player.py +++ b/homeassistant/components/onkyo/media_player.py @@ -264,7 +264,7 @@ class OnkyoDevice(MediaPlayerDevice): if source in self._source_mapping: self._current_source = self._source_mapping[source] break - self._current_source = "_".join([i for i in current_source_tuples[1]]) + self._current_source = "_".join(current_source_tuples[1]) if preset_raw and self._current_source.lower() == "radio": self._attributes[ATTR_PRESET] = preset_raw[1] elif ATTR_PRESET in self._attributes: @@ -413,7 +413,7 @@ class OnkyoDeviceZone(OnkyoDevice): if source in self._source_mapping: self._current_source = self._source_mapping[source] break - self._current_source = "_".join([i for i in current_source_tuples[1]]) + self._current_source = "_".join(current_source_tuples[1]) self._muted = bool(mute_raw[1] == "on") if preset_raw and self._current_source.lower() == "radio": self._attributes[ATTR_PRESET] = preset_raw[1] diff --git a/homeassistant/components/rmvtransport/sensor.py b/homeassistant/components/rmvtransport/sensor.py index d7d075f48f7c75031b1dec32bc21ca6b0206fcca..f66f22dda173184c67661ebf2c91ce156907d721 100644 --- a/homeassistant/components/rmvtransport/sensor.py +++ b/homeassistant/components/rmvtransport/sensor.py @@ -157,7 +157,7 @@ class RMVDepartureSensor(Entity): """Return the state attributes.""" try: return { - "next_departures": [val for val in self.data.departures[1:]], + "next_departures": self.data.departures[1:], "direction": self.data.departures[0].get("direction"), "line": self.data.departures[0].get("line"), "minutes": self.data.departures[0].get("minutes"), diff --git a/homeassistant/components/sabnzbd/sensor.py b/homeassistant/components/sabnzbd/sensor.py index 58624c758d9c83b4bcda08312b9403b45d1047a1..21ac9eefdb29a5175d86249a34ca9bb321851f0e 100644 --- a/homeassistant/components/sabnzbd/sensor.py +++ b/homeassistant/components/sabnzbd/sensor.py @@ -49,6 +49,7 @@ class SabnzbdSensor(Entity): """Return the state of the sensor.""" return self._state + @property def should_poll(self): """Don't poll. Will be updated by dispatcher signal.""" return False diff --git a/homeassistant/components/synology/camera.py b/homeassistant/components/synology/camera.py index 5594a4b3c9a921352f4467843cc18c1a2740856c..8c176f488034ca7c821d487554dc461b9840200b 100644 --- a/homeassistant/components/synology/camera.py +++ b/homeassistant/components/synology/camera.py @@ -105,6 +105,7 @@ class SynologyCamera(Camera): """Return true if the device is recording.""" return self._camera.is_recording + @property def should_poll(self): """Update the recording state periodically.""" return True diff --git a/homeassistant/components/tplink/device_tracker.py b/homeassistant/components/tplink/device_tracker.py index e7f87074cb4c00345a490c3c8be2d906534bc52a..f6921efed9183b7edfc79f06fb3cf00d1d95beb6 100644 --- a/homeassistant/components/tplink/device_tracker.py +++ b/homeassistant/components/tplink/device_tracker.py @@ -102,7 +102,7 @@ class TplinkDeviceScanner(DeviceScanner): self.success_init = self._update_info() except requests.exceptions.RequestException: - _LOGGER.debug("RequestException in %s", __class__.__name__) + _LOGGER.debug("RequestException in %s", self.__class__.__name__) def scan_devices(self): """Scan for new devices and return a list with found device IDs.""" @@ -150,7 +150,7 @@ class Tplink1DeviceScanner(DeviceScanner): try: self.success_init = self._update_info() except requests.exceptions.RequestException: - _LOGGER.debug("RequestException in %s", __class__.__name__) + _LOGGER.debug("RequestException in %s", self.__class__.__name__) def scan_devices(self): """Scan for new devices and return a list with found device IDs.""" diff --git a/homeassistant/components/tradfri/config_flow.py b/homeassistant/components/tradfri/config_flow.py index 6266766f394f60ef6b8442d5252f48722b381a47..9da381deb75658a0d85be1ce2b629ad449cb90e9 100644 --- a/homeassistant/components/tradfri/config_flow.py +++ b/homeassistant/components/tradfri/config_flow.py @@ -83,7 +83,7 @@ class FlowHandler(config_entries.ConfigFlow): """Handle zeroconf discovery.""" host = user_input["host"] - # pylint: disable=unsupported-assignment-operation + # pylint: disable=no-member # https://github.com/PyCQA/pylint/issues/3167 self.context["host"] = host if any(host == flow["context"]["host"] for flow in self._async_in_progress()): diff --git a/homeassistant/components/upnp/sensor.py b/homeassistant/components/upnp/sensor.py index b721fa29cdd860490faae90239e31f56d497f1bf..40cb7ef2032f8538f030c88710ae6b33e3eb9105 100644 --- a/homeassistant/components/upnp/sensor.py +++ b/homeassistant/components/upnp/sensor.py @@ -164,7 +164,6 @@ class PerSecondUPnPIGDSensor(UpnpSensor): """Get unit we are measuring in.""" raise NotImplementedError() - @property def _async_fetch_value(self): """Fetch a value from the IGD.""" raise NotImplementedError() diff --git a/homeassistant/components/vacuum/__init__.py b/homeassistant/components/vacuum/__init__.py index 9bc376916c6edf293d3e3158893baaf6af473145..55e56415b0deaf89c5261edd166c2963728e4776 100644 --- a/homeassistant/components/vacuum/__init__.py +++ b/homeassistant/components/vacuum/__init__.py @@ -6,7 +6,7 @@ import logging import voluptuous as vol from homeassistant.components import group -from homeassistant.const import ( +from homeassistant.const import ( # noqa: F401 # STATE_PAUSED/IDLE are API ATTR_BATTERY_LEVEL, ATTR_COMMAND, SERVICE_TOGGLE, @@ -68,8 +68,6 @@ VACUUM_SEND_COMMAND_SERVICE_SCHEMA = ENTITY_SERVICE_SCHEMA.extend( STATE_CLEANING = "cleaning" STATE_DOCKED = "docked" -STATE_IDLE = STATE_IDLE -STATE_PAUSED = STATE_PAUSED STATE_RETURNING = "returning" STATE_ERROR = "error" diff --git a/homeassistant/components/vallox/__init__.py b/homeassistant/components/vallox/__init__.py index c107e4f88945511ddf04bdbd9f9559a0dd231ef1..eb5edfe7fcf51b636737b4ea4f56b01902602ae1 100644 --- a/homeassistant/components/vallox/__init__.py +++ b/homeassistant/components/vallox/__init__.py @@ -252,7 +252,7 @@ class ValloxServiceHandler: async def async_handle(self, service): """Dispatch a service call.""" method = SERVICE_TO_METHOD.get(service.service) - params = {key: value for key, value in service.data.items()} + params = service.data.copy() if not hasattr(self, method["method"]): _LOGGER.error("Service not implemented: %s", method["method"]) diff --git a/homeassistant/components/wink/climate.py b/homeassistant/components/wink/climate.py index 38f25ef0a83912e53fd4c76a4d3a066351d22fb6..6323fa7bbfe8aa4fd4a8ad420ec15ca85c44e2bc 100644 --- a/homeassistant/components/wink/climate.py +++ b/homeassistant/components/wink/climate.py @@ -283,10 +283,6 @@ class WinkThermostat(WinkDevice, ClimateDevice): target_temp_high = target_temp if self.hvac_mode == HVAC_MODE_HEAT: target_temp_low = target_temp - if target_temp_low is not None: - target_temp_low = target_temp_low - if target_temp_high is not None: - target_temp_high = target_temp_high self.wink.set_temperature(target_temp_low, target_temp_high) def set_hvac_mode(self, hvac_mode): diff --git a/homeassistant/components/zha/core/device.py b/homeassistant/components/zha/core/device.py index e9e2c3b7ea6aaf7d2e22bcf1e33dc479e373daf9..f4a3a2c3d48b5eb3e8ee2c9cf63332b34a155634 100644 --- a/homeassistant/components/zha/core/device.py +++ b/homeassistant/components/zha/core/device.py @@ -348,7 +348,6 @@ class ZHADevice(LogMixin): zdo_task = None for channel in channels: if channel.name == CHANNEL_ZDO: - # pylint: disable=E1111 if zdo_task is None: # We only want to do this once zdo_task = self._async_create_task( semaphore, channel, task_name, *args @@ -373,8 +372,7 @@ class ZHADevice(LogMixin): @callback def async_unsub_dispatcher(self): """Unsubscribe the dispatcher.""" - if self._unsub: - self._unsub() + self._unsub() @callback def async_update_last_seen(self, last_seen): diff --git a/homeassistant/components/zha/fan.py b/homeassistant/components/zha/fan.py index 1f119ef6657e3e66f89323f6f6b2a5d20e63d3be..43ad2291cb775de6a6d41c6b6271507d4a8e6e78 100644 --- a/homeassistant/components/zha/fan.py +++ b/homeassistant/components/zha/fan.py @@ -43,7 +43,7 @@ SPEED_LIST = [ SPEED_SMART, ] -VALUE_TO_SPEED = {i: speed for i, speed in enumerate(SPEED_LIST)} +VALUE_TO_SPEED = dict(enumerate(SPEED_LIST)) SPEED_TO_VALUE = {speed: i for i, speed in enumerate(SPEED_LIST)} diff --git a/homeassistant/components/zha/lock.py b/homeassistant/components/zha/lock.py index afc4618343cba2275fdf151a4382ab0de27986d7..a2151b4bdcb4afc82637616c7b38e1dd0ddeef79 100644 --- a/homeassistant/components/zha/lock.py +++ b/homeassistant/components/zha/lock.py @@ -27,7 +27,7 @@ _LOGGER = logging.getLogger(__name__) STATE_LIST = [STATE_UNLOCKED, STATE_LOCKED, STATE_UNLOCKED] -VALUE_TO_STATE = {i: state for i, state in enumerate(STATE_LIST)} +VALUE_TO_STATE = dict(enumerate(STATE_LIST)) async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): diff --git a/homeassistant/core.py b/homeassistant/core.py index feb4445d36d5bdb585b910ccb6bd5c89e7445dd1..90d197906cbe5bd4c93db81328f8233e1081e0e9 100644 --- a/homeassistant/core.py +++ b/homeassistant/core.py @@ -186,7 +186,9 @@ class HomeAssistant: self.data: dict = {} self.state = CoreState.not_running self.exit_code = 0 - self.config_entries: Optional[ConfigEntries] = None + self.config_entries: Optional[ + ConfigEntries # pylint: disable=used-before-assignment + ] = None # If not None, use to signal end-of-loop self._stopped: Optional[asyncio.Event] = None diff --git a/homeassistant/helpers/config_entry_flow.py b/homeassistant/helpers/config_entry_flow.py index 922878fb3241277e276bda8d2e9cf1d974002903..88aae3721b1a1f1a6521685daeec36af20a18592 100644 --- a/homeassistant/helpers/config_entry_flow.py +++ b/homeassistant/helpers/config_entry_flow.py @@ -38,7 +38,7 @@ class DiscoveryFlowHandler(config_entries.ConfigFlow): if user_input is None: return self.async_show_form(step_id="confirm") - if ( + if ( # pylint: disable=no-member # https://github.com/PyCQA/pylint/issues/3167 self.context and self.context.get("source") != config_entries.SOURCE_DISCOVERY ): diff --git a/homeassistant/util/color.py b/homeassistant/util/color.py index 89d1dcfc4c1afe4b6cb051b4f2dd280d3001f3e7..640e5c5540a4d60289d6d9835bf555ee2d70ecd9 100644 --- a/homeassistant/util/color.py +++ b/homeassistant/util/color.py @@ -167,8 +167,8 @@ COLORS = { class XYPoint: """Represents a CIE 1931 XY coordinate pair.""" - x = attr.ib(type=float) - y = attr.ib(type=float) + x = attr.ib(type=float) # pylint: disable=invalid-name + y = attr.ib(type=float) # pylint: disable=invalid-name @attr.s() diff --git a/homeassistant/util/dt.py b/homeassistant/util/dt.py index a948c4407ae6e7705f90545b73fda6c094a3a15e..1abb429439876c973eb868144d034eff1b875fe1 100644 --- a/homeassistant/util/dt.py +++ b/homeassistant/util/dt.py @@ -220,7 +220,7 @@ def get_age(date: dt.datetime) -> str: def parse_time_expression(parameter: Any, min_value: int, max_value: int) -> List[int]: """Parse the time expression part and return a list of times to match.""" if parameter is None or parameter == MATCH_ALL: - res = [x for x in range(min_value, max_value + 1)] + res = list(range(min_value, max_value + 1)) elif isinstance(parameter, str) and parameter.startswith("/"): parameter = int(parameter[1:]) res = [x for x in range(min_value, max_value + 1) if x % parameter == 0] diff --git a/pylintrc b/pylintrc index bb4f1fe96d03ca2851682eb92a47cfa9f8100188..3d69800e5c3120122bb62fd9b21b2f4e054eb362 100644 --- a/pylintrc +++ b/pylintrc @@ -2,7 +2,7 @@ ignore=tests [BASIC] -good-names=i,j,k,ex,Run,_,fp +good-names=id,i,j,k,ex,Run,_,fp [MESSAGES CONTROL] # Reasons disabled: @@ -18,8 +18,8 @@ good-names=i,j,k,ex,Run,_,fp # too-few-* - same as too-many-* # abstract-method - with intro of async there are always methods missing # inconsistent-return-statements - doesn't handle raise -# not-an-iterable - https://github.com/PyCQA/pylint/issues/2311 # unnecessary-pass - readability for functions which only contain pass +# import-outside-toplevel - TODO disable= format, abstract-class-little-used, @@ -27,9 +27,9 @@ disable= cyclic-import, duplicate-code, global-statement, + import-outside-toplevel, inconsistent-return-statements, locally-disabled, - not-an-iterable, not-context-manager, redefined-variable-type, too-few-public-methods, diff --git a/requirements_test.txt b/requirements_test.txt index 9da375b33c8a918177af108f05f96f6ae8748832..d0b7880d78daf3771edc4d548e469a0766d663b0 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -12,8 +12,8 @@ mock-open==1.3.1 mypy==0.730 pre-commit==1.18.3 pydocstyle==4.0.1 -pylint==2.3.1 -astroid==2.2.5 +pylint==2.4.2 +astroid==2.3.1 pytest-aiohttp==0.3.0 pytest-cov==2.7.1 pytest-sugar==0.9.2 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 62be2f035a5ad553e0cdc03c78aaac02f6201d68..425170d168dc1647560c57f2c369a0b210c92502 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -13,8 +13,8 @@ mock-open==1.3.1 mypy==0.730 pre-commit==1.18.3 pydocstyle==4.0.1 -pylint==2.3.1 -astroid==2.2.5 +pylint==2.4.2 +astroid==2.3.1 pytest-aiohttp==0.3.0 pytest-cov==2.7.1 pytest-sugar==0.9.2