diff --git a/homeassistant/components/braviatv/config_flow.py b/homeassistant/components/braviatv/config_flow.py index 159f3806d61..8e59033ffc8 100644 --- a/homeassistant/components/braviatv/config_flow.py +++ b/homeassistant/components/braviatv/config_flow.py @@ -157,7 +157,7 @@ class BraviaTVOptionsFlowHandler(config_entries.OptionsFlow): content_mapping = await self.hass.async_add_executor_job( braviarc.load_source_list ) - self.source_list = {item: item for item in [*content_mapping]} + self.source_list = {item: item for item in content_mapping} return await self.async_step_user() async def async_step_user( diff --git a/homeassistant/components/camera/img_util.py b/homeassistant/components/camera/img_util.py index 4cfb4fda278..279bc57672a 100644 --- a/homeassistant/components/camera/img_util.py +++ b/homeassistant/components/camera/img_util.py @@ -69,8 +69,6 @@ class TurboJPEGSingleton: def __init__(self) -> None: """Try to create TurboJPEG only once.""" - # pylint: disable=unused-private-member - # https://github.com/PyCQA/pylint/issues/4681 try: # TurboJPEG checks for libturbojpeg # when its created, but it imports diff --git a/homeassistant/components/climate/__init__.py b/homeassistant/components/climate/__init__.py index 6a46c1986b8..98e37237792 100644 --- a/homeassistant/components/climate/__init__.py +++ b/homeassistant/components/climate/__init__.py @@ -504,7 +504,6 @@ class ClimateEntity(Entity): async def async_turn_on(self) -> None: """Turn the entity on.""" if hasattr(self, "turn_on"): - # pylint: disable=no-member await self.hass.async_add_executor_job(self.turn_on) # type: ignore[attr-defined] return @@ -518,7 +517,6 @@ class ClimateEntity(Entity): async def async_turn_off(self) -> None: """Turn the entity off.""" if hasattr(self, "turn_off"): - # pylint: disable=no-member await self.hass.async_add_executor_job(self.turn_off) # type: ignore[attr-defined] return diff --git a/homeassistant/components/isy994/binary_sensor.py b/homeassistant/components/isy994/binary_sensor.py index c091ca6f96a..58997eaa579 100644 --- a/homeassistant/components/isy994/binary_sensor.py +++ b/homeassistant/components/isy994/binary_sensor.py @@ -184,20 +184,14 @@ def _detect_device_type_and_class(node: Group | Node) -> (str, str): # Z-Wave Devices: if node.protocol == PROTO_ZWAVE: device_type = f"Z{node.zwave_props.category}" - for device_class in [*BINARY_SENSOR_DEVICE_TYPES_ZWAVE]: - if ( - node.zwave_props.category - in BINARY_SENSOR_DEVICE_TYPES_ZWAVE[device_class] - ): + for device_class, values in BINARY_SENSOR_DEVICE_TYPES_ZWAVE.items(): + if node.zwave_props.category in values: return device_class, device_type return (None, device_type) # Other devices (incl Insteon.) - for device_class in [*BINARY_SENSOR_DEVICE_TYPES_ISY]: - if any( - device_type.startswith(t) - for t in set(BINARY_SENSOR_DEVICE_TYPES_ISY[device_class]) - ): + for device_class, values in BINARY_SENSOR_DEVICE_TYPES_ISY.items(): + if any(device_type.startswith(t) for t in values): return device_class, device_type return (None, device_type) diff --git a/homeassistant/components/light/__init__.py b/homeassistant/components/light/__init__.py index 51f387a2cdb..0ef877e6247 100644 --- a/homeassistant/components/light/__init__.py +++ b/homeassistant/components/light/__init__.py @@ -529,7 +529,7 @@ class Profile: transition: int | None = None hs_color: tuple[float, float] | None = dataclasses.field(init=False) - SCHEMA = vol.Schema( # pylint: disable=invalid-name + SCHEMA = vol.Schema( vol.Any( vol.ExactSequence( ( diff --git a/homeassistant/components/media_player/__init__.py b/homeassistant/components/media_player/__init__.py index 2b80736bc7a..b0030786ed7 100644 --- a/homeassistant/components/media_player/__init__.py +++ b/homeassistant/components/media_player/__init__.py @@ -813,7 +813,6 @@ class MediaPlayerEntity(Entity): async def async_toggle(self): """Toggle the power on the media player.""" if hasattr(self, "toggle"): - # pylint: disable=no-member await self.hass.async_add_executor_job(self.toggle) return @@ -828,7 +827,6 @@ class MediaPlayerEntity(Entity): This method is a coroutine. """ if hasattr(self, "volume_up"): - # pylint: disable=no-member await self.hass.async_add_executor_job(self.volume_up) return @@ -841,7 +839,6 @@ class MediaPlayerEntity(Entity): This method is a coroutine. """ if hasattr(self, "volume_down"): - # pylint: disable=no-member await self.hass.async_add_executor_job(self.volume_down) return @@ -851,7 +848,6 @@ class MediaPlayerEntity(Entity): async def async_media_play_pause(self): """Play or pause the media player.""" if hasattr(self, "media_play_pause"): - # pylint: disable=no-member await self.hass.async_add_executor_job(self.media_play_pause) return diff --git a/homeassistant/components/nfandroidtv/notify.py b/homeassistant/components/nfandroidtv/notify.py index 8cc1b0031f7..0f15b152038 100644 --- a/homeassistant/components/nfandroidtv/notify.py +++ b/homeassistant/components/nfandroidtv/notify.py @@ -201,7 +201,7 @@ class NFAndroidTVNotificationService(BaseNotificationService): if local_path is not None: # Check whether path is whitelisted in configuration.yaml if self.is_allowed_path(local_path): - return open(local_path, "rb") # pylint: disable=consider-using-with + return open(local_path, "rb") _LOGGER.warning("'%s' is not secure to load data from!", local_path) else: _LOGGER.warning("Neither URL nor local path found in params!") diff --git a/homeassistant/components/notify/__init__.py b/homeassistant/components/notify/__init__.py index 41953ddfc75..00047f0a32b 100644 --- a/homeassistant/components/notify/__init__.py +++ b/homeassistant/components/notify/__init__.py @@ -183,7 +183,6 @@ class BaseNotificationService: if hasattr(self, "targets"): stale_targets = set(self.registered_targets) - # pylint: disable=no-member for name, target in self.targets.items(): # type: ignore target_name = slugify(f"{self._target_service_name_prefix}_{name}") if target_name in stale_targets: diff --git a/homeassistant/components/rest/__init__.py b/homeassistant/components/rest/__init__.py index 42c342a2c84..8186db1c3c2 100644 --- a/homeassistant/components/rest/__init__.py +++ b/homeassistant/components/rest/__init__.py @@ -68,7 +68,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: @callback def _async_setup_shared_data(hass: HomeAssistant): """Create shared data for platform config and rest coordinators.""" - hass.data[DOMAIN] = {key: [] for key in [REST_DATA, *COORDINATOR_AWARE_PLATFORMS]} + hass.data[DOMAIN] = {key: [] for key in (REST_DATA, *COORDINATOR_AWARE_PLATFORMS)} async def _async_process_config(hass, config) -> bool: diff --git a/homeassistant/components/supla/__init__.py b/homeassistant/components/supla/__init__.py index 5ebd6d6ca48..c8862a37b61 100644 --- a/homeassistant/components/supla/__init__.py +++ b/homeassistant/components/supla/__init__.py @@ -104,7 +104,7 @@ async def discover_devices(hass, hass_config): async with async_timeout.timeout(SCAN_INTERVAL.total_seconds()): channels = { channel["id"]: channel - for channel in await server.get_channels( + for channel in await server.get_channels( # pylint: disable=cell-var-from-loop include=["iodevice", "state", "connected"] ) } diff --git a/homeassistant/components/surepetcare/__init__.py b/homeassistant/components/surepetcare/__init__.py index 87a3260fc40..4ac27ce25a0 100644 --- a/homeassistant/components/surepetcare/__init__.py +++ b/homeassistant/components/surepetcare/__init__.py @@ -111,8 +111,6 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: vol.Lower, vol.In( [ - # https://github.com/PyCQA/pylint/issues/2062 - # pylint: disable=no-member LockState.UNLOCKED.name.lower(), LockState.LOCKED_IN.name.lower(), LockState.LOCKED_OUT.name.lower(), @@ -156,8 +154,6 @@ class SurePetcareAPI: async def set_lock_state(self, flap_id: int, state: str) -> None: """Update the lock state of a flap.""" - # https://github.com/PyCQA/pylint/issues/2062 - # pylint: disable=no-member if state == LockState.UNLOCKED.name.lower(): await self.surepy.sac.unlock(flap_id) elif state == LockState.LOCKED_IN.name.lower(): diff --git a/homeassistant/components/telegram_bot/__init__.py b/homeassistant/components/telegram_bot/__init__.py index 02629e695fc..84b7249d203 100644 --- a/homeassistant/components/telegram_bot/__init__.py +++ b/homeassistant/components/telegram_bot/__init__.py @@ -286,7 +286,7 @@ def load_data( _LOGGER.warning("Can't load data in %s after %s retries", url, retry_num) elif filepath is not None: if hass.config.is_allowed_path(filepath): - return open(filepath, "rb") # pylint: disable=consider-using-with + return open(filepath, "rb") _LOGGER.warning("'%s' are not secure to load data from!", filepath) else: diff --git a/homeassistant/components/vallox/__init__.py b/homeassistant/components/vallox/__init__.py index 27210e0c750..6f88afa66cf 100644 --- a/homeassistant/components/vallox/__init__.py +++ b/homeassistant/components/vallox/__init__.py @@ -40,7 +40,6 @@ CONFIG_SCHEMA = vol.Schema( extra=vol.ALLOW_EXTRA, ) -# pylint: disable=no-member PROFILE_TO_STR_SETTABLE = { VALLOX_PROFILE.HOME: "Home", VALLOX_PROFILE.AWAY: "Away", @@ -50,7 +49,6 @@ PROFILE_TO_STR_SETTABLE = { STR_TO_PROFILE = {v: k for (k, v) in PROFILE_TO_STR_SETTABLE.items()} -# pylint: disable=no-member PROFILE_TO_STR_REPORTABLE = { **{VALLOX_PROFILE.NONE: "None", VALLOX_PROFILE.EXTRA: "Extra"}, **PROFILE_TO_STR_SETTABLE, diff --git a/homeassistant/helpers/entity.py b/homeassistant/helpers/entity.py index 63e84371fad..847dc062764 100644 --- a/homeassistant/helpers/entity.py +++ b/homeassistant/helpers/entity.py @@ -622,7 +622,6 @@ class Entity(ABC): await self.parallel_updates.acquire() try: - # pylint: disable=no-member if hasattr(self, "async_update"): task = self.hass.async_create_task(self.async_update()) # type: ignore elif hasattr(self, "update"): diff --git a/requirements_test.txt b/requirements_test.txt index 63e102ec77e..7aee2dfb332 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -13,7 +13,7 @@ jsonpickle==1.4.1 mock-open==1.4.0 mypy==0.910 pre-commit==2.14.0 -pylint==2.9.5 +pylint==2.10.1 pipdeptree==1.0.0 pylint-strict-informational==0.1 pytest-aiohttp==0.3.0