diff --git a/homeassistant/components/recorder/pool.py b/homeassistant/components/recorder/pool.py index d1a0cb28639..027b9bfbc25 100644 --- a/homeassistant/components/recorder/pool.py +++ b/homeassistant/components/recorder/pool.py @@ -112,7 +112,6 @@ class MutexPool(StaticPool): # type: ignore[misc] if DEBUG_MUTEX_POOL: _LOGGER.debug("%s wait conn%s", threading.current_thread().name, trace_msg) - # pylint: disable-next=consider-using-with got_lock = MutexPool.pool_lock.acquire(timeout=1) if not got_lock: raise SQLAlchemyError diff --git a/homeassistant/components/samsungtv/media_player.py b/homeassistant/components/samsungtv/media_player.py index 98457c31493..a0b70af2db5 100644 --- a/homeassistant/components/samsungtv/media_player.py +++ b/homeassistant/components/samsungtv/media_player.py @@ -258,9 +258,7 @@ class SamsungTVDevice(MediaPlayerEntity): except asyncio.TimeoutError as err: # No need to try again self._app_list_event.set() - LOGGER.debug( - "Failed to load app list from %s: %s", self._host, err.__repr__() - ) + LOGGER.debug("Failed to load app list from %s: %r", self._host, err) async def _async_startup_dmr(self) -> None: assert self._ssdp_rendering_control_location is not None @@ -378,9 +376,7 @@ class SamsungTVDevice(MediaPlayerEntity): try: await dmr_device.async_set_volume_level(volume) except UpnpActionResponseError as err: - LOGGER.warning( - "Unable to set volume level on %s: %s", self._host, err.__repr__() - ) + LOGGER.warning("Unable to set volume level on %s: %r", self._host, err) async def async_volume_up(self) -> None: """Volume up the media player.""" diff --git a/homeassistant/components/soundtouch/media_player.py b/homeassistant/components/soundtouch/media_player.py index 2a19ed10833..7081f4a3a0f 100644 --- a/homeassistant/components/soundtouch/media_player.py +++ b/homeassistant/components/soundtouch/media_player.py @@ -121,11 +121,13 @@ def setup_platform( ] master = next( - [ - device - for device in hass.data[DATA_SOUNDTOUCH] - if device.entity_id == master_device_id - ].__iter__(), + iter( + [ + device + for device in hass.data[DATA_SOUNDTOUCH] + if device.entity_id == master_device_id + ] + ), None, ) @@ -357,9 +359,9 @@ class SoundTouchDevice(MediaPlayerEntity): # Preset presets = self._device.presets() preset = next( - [ - preset for preset in presets if preset.preset_id == str(media_id) - ].__iter__(), + iter( + [preset for preset in presets if preset.preset_id == str(media_id)] + ), None, ) if preset is not None: diff --git a/homeassistant/components/tailscale/diagnostics.py b/homeassistant/components/tailscale/diagnostics.py index 3c3393adc42..0fd69a12825 100644 --- a/homeassistant/components/tailscale/diagnostics.py +++ b/homeassistant/components/tailscale/diagnostics.py @@ -23,7 +23,6 @@ TO_REDACT = { "name", "node_key", "user", - "user", } diff --git a/homeassistant/helpers/schema_config_entry_flow.py b/homeassistant/helpers/schema_config_entry_flow.py index 604ab8d9200..4073421bc2c 100644 --- a/homeassistant/helpers/schema_config_entry_flow.py +++ b/homeassistant/helpers/schema_config_entry_flow.py @@ -377,7 +377,7 @@ def entity_selector_without_own_entities( entity_registry = er.async_get(handler.hass) entities = er.async_entries_for_config_entry( entity_registry, - handler.config_entry.entry_id, # pylint: disable=protected-access + handler.config_entry.entry_id, ) entity_ids = [ent.entity_id for ent in entities] diff --git a/homeassistant/helpers/template.py b/homeassistant/helpers/template.py index fe8feac76c4..9003fc2daf3 100644 --- a/homeassistant/helpers/template.py +++ b/homeassistant/helpers/template.py @@ -821,7 +821,7 @@ class TemplateState(State): def __repr__(self) -> str: """Representation of Template State.""" - return f"