diff --git a/homeassistant/components/saj/sensor.py b/homeassistant/components/saj/sensor.py index 58dd4436861..12a5ae99570 100644 --- a/homeassistant/components/saj/sensor.py +++ b/homeassistant/components/saj/sensor.py @@ -141,7 +141,7 @@ async def async_setup_platform( @callback def stop_update_interval(event): """Properly cancel the scheduled update.""" - remove_interval_update() # pylint: disable=not-callable + remove_interval_update() hass.bus.async_listen(EVENT_HOMEASSISTANT_STOP, stop_update_interval) async_at_start(hass, start_update_interval) @@ -171,7 +171,7 @@ def async_track_time_interval_backoff( def remove_listener() -> None: """Remove interval listener.""" if remove: - remove() # pylint: disable=not-callable + remove() return remove_listener diff --git a/homeassistant/components/sendgrid/notify.py b/homeassistant/components/sendgrid/notify.py index 4c47f497b36..25d00fdd3b8 100644 --- a/homeassistant/components/sendgrid/notify.py +++ b/homeassistant/components/sendgrid/notify.py @@ -29,7 +29,6 @@ CONF_SENDER_NAME = "sender_name" DEFAULT_SENDER_NAME = "Home Assistant" -# pylint: disable=no-value-for-parameter PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( { vol.Required(CONF_API_KEY): cv.string, diff --git a/homeassistant/components/sia/hub.py b/homeassistant/components/sia/hub.py index 64ca3832ce0..859841d3bea 100644 --- a/homeassistant/components/sia/hub.py +++ b/homeassistant/components/sia/hub.py @@ -110,14 +110,12 @@ class SIAHub: self.sia_client.accounts = self.sia_accounts return # the new client class method creates a subclass based on protocol, hence the type ignore - self.sia_client = ( - SIAClient( # pylint: disable=abstract-class-instantiated # type: ignore - host="", - port=self._port, - accounts=self.sia_accounts, - function=self.async_create_and_fire_event, - protocol=CommunicationsProtocol(self._protocol), - ) + self.sia_client = SIAClient( + host="", + port=self._port, + accounts=self.sia_accounts, + function=self.async_create_and_fire_event, + protocol=CommunicationsProtocol(self._protocol), ) def _load_options(self) -> None: diff --git a/homeassistant/components/smarty/__init__.py b/homeassistant/components/smarty/__init__.py index 036fb6e1e90..e3cf1dcf287 100644 --- a/homeassistant/components/smarty/__init__.py +++ b/homeassistant/components/smarty/__init__.py @@ -3,7 +3,7 @@ from datetime import timedelta import ipaddress import logging -from pysmarty import Smarty # pylint: disable=import-error +from pysmarty import Smarty import voluptuous as vol from homeassistant.const import CONF_HOST, CONF_NAME, Platform diff --git a/homeassistant/components/smarty/binary_sensor.py b/homeassistant/components/smarty/binary_sensor.py index baa25115186..d9d757a71b5 100644 --- a/homeassistant/components/smarty/binary_sensor.py +++ b/homeassistant/components/smarty/binary_sensor.py @@ -3,7 +3,7 @@ from __future__ import annotations import logging -from pysmarty import Smarty # pylint: disable=import-error +from pysmarty import Smarty from homeassistant.components.binary_sensor import ( BinarySensorDeviceClass, diff --git a/homeassistant/components/smarty/fan.py b/homeassistant/components/smarty/fan.py index cf7db560c15..cf4b49e6105 100644 --- a/homeassistant/components/smarty/fan.py +++ b/homeassistant/components/smarty/fan.py @@ -5,7 +5,7 @@ import logging import math from typing import Any -from pysmarty import Smarty # pylint: disable=import-error +from pysmarty import Smarty from homeassistant.components.fan import FanEntity, FanEntityFeature from homeassistant.core import HomeAssistant, callback diff --git a/homeassistant/components/smarty/sensor.py b/homeassistant/components/smarty/sensor.py index df99529b1f4..57d681594cf 100644 --- a/homeassistant/components/smarty/sensor.py +++ b/homeassistant/components/smarty/sensor.py @@ -4,7 +4,7 @@ from __future__ import annotations import datetime as dt import logging -from pysmarty import Smarty # pylint: disable=import-error +from pysmarty import Smarty from homeassistant.components.sensor import SensorDeviceClass, SensorEntity from homeassistant.const import UnitOfTemperature diff --git a/homeassistant/components/smhi/weather.py b/homeassistant/components/smhi/weather.py index c8ff9127ba8..05683f19b11 100644 --- a/homeassistant/components/smhi/weather.py +++ b/homeassistant/components/smhi/weather.py @@ -192,9 +192,7 @@ class SmhiWeather(WeatherEntity): async def retry_update(self, _: datetime) -> None: """Retry refresh weather forecast.""" - await self.async_update( # pylint: disable=unexpected-keyword-arg - no_throttle=True - ) + await self.async_update(no_throttle=True) @property def forecast(self) -> list[Forecast] | None: diff --git a/homeassistant/components/sms/__init__.py b/homeassistant/components/sms/__init__.py index 5b4ecc3a141..824a95e36b1 100644 --- a/homeassistant/components/sms/__init__.py +++ b/homeassistant/components/sms/__init__.py @@ -3,7 +3,7 @@ import asyncio from datetime import timedelta import logging -import gammu # pylint: disable=import-error +import gammu import voluptuous as vol from homeassistant.config_entries import ConfigEntry diff --git a/homeassistant/components/sms/config_flow.py b/homeassistant/components/sms/config_flow.py index 9128b6187c1..df3530764cb 100644 --- a/homeassistant/components/sms/config_flow.py +++ b/homeassistant/components/sms/config_flow.py @@ -1,7 +1,7 @@ """Config flow for SMS integration.""" import logging -import gammu # pylint: disable=import-error +import gammu import voluptuous as vol from homeassistant import config_entries, core, exceptions diff --git a/homeassistant/components/sms/gateway.py b/homeassistant/components/sms/gateway.py index 36ada5421e0..578b2191bd2 100644 --- a/homeassistant/components/sms/gateway.py +++ b/homeassistant/components/sms/gateway.py @@ -1,8 +1,8 @@ """The sms gateway to interact with a GSM modem.""" import logging -import gammu # pylint: disable=import-error -from gammu.asyncworker import GammuAsyncWorker # pylint: disable=import-error +import gammu +from gammu.asyncworker import GammuAsyncWorker from homeassistant.core import callback diff --git a/homeassistant/components/sms/notify.py b/homeassistant/components/sms/notify.py index 9d94472b1b8..21d3ab2beb5 100644 --- a/homeassistant/components/sms/notify.py +++ b/homeassistant/components/sms/notify.py @@ -3,7 +3,7 @@ from __future__ import annotations import logging -import gammu # pylint: disable=import-error +import gammu from homeassistant.components.notify import ATTR_DATA, BaseNotificationService from homeassistant.const import CONF_TARGET diff --git a/homeassistant/components/smtp/notify.py b/homeassistant/components/smtp/notify.py index 28c3121a172..7037c239db3 100644 --- a/homeassistant/components/smtp/notify.py +++ b/homeassistant/components/smtp/notify.py @@ -56,7 +56,6 @@ DEFAULT_ENCRYPTION = "starttls" ENCRYPTION_OPTIONS = ["tls", "starttls", "none"] -# pylint: disable=no-value-for-parameter PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( { vol.Required(CONF_RECIPIENT): vol.All(cv.ensure_list, [vol.Email()]), diff --git a/homeassistant/components/ssdp/__init__.py b/homeassistant/components/ssdp/__init__.py index 4bc9bb24835..3be5475a71a 100644 --- a/homeassistant/components/ssdp/__init__.py +++ b/homeassistant/components/ssdp/__init__.py @@ -153,7 +153,7 @@ async def async_register_callback( @bind_hass -async def async_get_discovery_info_by_udn_st( # pylint: disable=invalid-name +async def async_get_discovery_info_by_udn_st( hass: HomeAssistant, udn: str, st: str ) -> SsdpServiceInfo | None: """Fetch the discovery info cache.""" @@ -162,7 +162,7 @@ async def async_get_discovery_info_by_udn_st( # pylint: disable=invalid-name @bind_hass -async def async_get_discovery_info_by_st( # pylint: disable=invalid-name +async def async_get_discovery_info_by_st( hass: HomeAssistant, st: str ) -> list[SsdpServiceInfo]: """Fetch all the entries matching the st.""" @@ -575,7 +575,7 @@ class Scanner: info_desc = await self._async_get_description_dict(location) return discovery_info_from_headers_and_description(headers, info_desc) - async def async_get_discovery_info_by_udn_st( # pylint: disable=invalid-name + async def async_get_discovery_info_by_udn_st( self, udn: str, st: str ) -> SsdpServiceInfo | None: """Return discovery_info for a udn and st.""" @@ -583,9 +583,7 @@ class Scanner: return await self._async_headers_to_discovery_info(headers) return None - async def async_get_discovery_info_by_st( # pylint: disable=invalid-name - self, st: str - ) -> list[SsdpServiceInfo]: + async def async_get_discovery_info_by_st(self, st: str) -> list[SsdpServiceInfo]: """Return matching discovery_infos for a st.""" return [ await self._async_headers_to_discovery_info(headers) diff --git a/homeassistant/components/system_log/__init__.py b/homeassistant/components/system_log/__init__.py index cba8082d23c..ab271ec676c 100644 --- a/homeassistant/components/system_log/__init__.py +++ b/homeassistant/components/system_log/__init__.py @@ -141,7 +141,7 @@ class LogEntry: self.root_cause = None if record.exc_info: self.exception = "".join(traceback.format_exception(*record.exc_info)) - _, _, tb = record.exc_info # pylint: disable=invalid-name + _, _, tb = record.exc_info # Last line of traceback contains the root cause of the exception if traceback.extract_tb(tb): self.root_cause = str(traceback.extract_tb(tb)[-1]) diff --git a/homeassistant/components/tank_utility/sensor.py b/homeassistant/components/tank_utility/sensor.py index f902abc22e0..0aecbb0f405 100644 --- a/homeassistant/components/tank_utility/sensor.py +++ b/homeassistant/components/tank_utility/sensor.py @@ -56,10 +56,7 @@ def setup_platform( try: token = auth.get_token(email, password) except requests.exceptions.HTTPError as http_error: - if ( - http_error.response.status_code - == requests.codes.unauthorized # pylint: disable=no-member - ): + if http_error.response.status_code == requests.codes.unauthorized: _LOGGER.error("Invalid credentials") return @@ -121,8 +118,8 @@ class TankUtilitySensor(SensorEntity): data = tank_monitor.get_device_data(self._token, self.device) except requests.exceptions.HTTPError as http_error: if http_error.response.status_code in ( - requests.codes.unauthorized, # pylint: disable=no-member - requests.codes.bad_request, # pylint: disable=no-member + requests.codes.unauthorized, + requests.codes.bad_request, ): _LOGGER.info("Getting new token") self._token = auth.get_token(self._email, self._password, force=True) diff --git a/homeassistant/components/template/template_entity.py b/homeassistant/components/template/template_entity.py index 0d6d5a99748..fe1a53e6510 100644 --- a/homeassistant/components/template/template_entity.py +++ b/homeassistant/components/template/template_entity.py @@ -15,7 +15,7 @@ from homeassistant.const import ( ) import homeassistant.helpers.config_validation as cv from homeassistant.helpers.template import Template -from homeassistant.helpers.template_entity import ( # noqa: F401 pylint: disable=unused-import +from homeassistant.helpers.template_entity import ( # noqa: F401 TEMPLATE_ENTITY_BASE_SCHEMA, TemplateEntity, make_template_entity_base_schema, diff --git a/homeassistant/components/template/trigger.py b/homeassistant/components/template/trigger.py index 113da3aa3ee..327c988106e 100644 --- a/homeassistant/components/template/trigger.py +++ b/homeassistant/components/template/trigger.py @@ -80,7 +80,6 @@ async def async_attach_trigger( return if delay_cancel: - # pylint: disable-next=not-callable delay_cancel() delay_cancel = None @@ -156,7 +155,6 @@ async def async_attach_trigger( """Remove state listeners async.""" unsub() if delay_cancel: - # pylint: disable-next=not-callable delay_cancel() return async_remove diff --git a/homeassistant/components/tensorflow/image_processing.py b/homeassistant/components/tensorflow/image_processing.py index a149ea92371..e2fce4b94c2 100644 --- a/homeassistant/components/tensorflow/image_processing.py +++ b/homeassistant/components/tensorflow/image_processing.py @@ -9,7 +9,7 @@ import time import numpy as np from PIL import Image, ImageDraw, UnidentifiedImageError -import tensorflow as tf # pylint: disable=import-error +import tensorflow as tf import voluptuous as vol from homeassistant.components.image_processing import ( @@ -148,7 +148,7 @@ def setup_platform( try: # Display warning that PIL will be used if no OpenCV is found. - import cv2 # noqa: F401 pylint: disable=unused-import, import-outside-toplevel + import cv2 # noqa: F401 pylint: disable=import-outside-toplevel except ImportError: _LOGGER.warning( "No OpenCV library found. TensorFlow will process image with " diff --git a/homeassistant/components/tuya/__init__.py b/homeassistant/components/tuya/__init__.py index 2b28a7e4e5e..509e7e17013 100644 --- a/homeassistant/components/tuya/__init__.py +++ b/homeassistant/components/tuya/__init__.py @@ -234,10 +234,6 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: class DeviceListener(TuyaDeviceListener): """Device Update Listener.""" - # pylint: disable=arguments-differ - # Library incorrectly defines methods as 'classmethod' - # https://github.com/tuya/tuya-iot-python-sdk/pull/48 - def __init__( self, hass: HomeAssistant, diff --git a/homeassistant/components/upnp/__init__.py b/homeassistant/components/upnp/__init__.py index bb505c08ad0..326ff5d7651 100644 --- a/homeassistant/components/upnp/__init__.py +++ b/homeassistant/components/upnp/__init__.py @@ -43,7 +43,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: hass.data.setdefault(DOMAIN, {}) udn = entry.data[CONFIG_ENTRY_UDN] - st = entry.data[CONFIG_ENTRY_ST] # pylint: disable=invalid-name + st = entry.data[CONFIG_ENTRY_ST] usn = f"{udn}::{st}" # Register device discovered-callback. diff --git a/homeassistant/components/watson_tts/tts.py b/homeassistant/components/watson_tts/tts.py index 7af6c1ce97b..7adb1b1582f 100644 --- a/homeassistant/components/watson_tts/tts.py +++ b/homeassistant/components/watson_tts/tts.py @@ -1,10 +1,8 @@ """Support for IBM Watson TTS integration.""" import logging -from ibm_cloud_sdk_core.authenticators import ( # pylint: disable=import-error - IAMAuthenticator, -) -from ibm_watson import TextToSpeechV1 # pylint: disable=import-error +from ibm_cloud_sdk_core.authenticators import IAMAuthenticator +from ibm_watson import TextToSpeechV1 import voluptuous as vol from homeassistant.components.tts import PLATFORM_SCHEMA, Provider diff --git a/homeassistant/components/xiaomi_aqara/__init__.py b/homeassistant/components/xiaomi_aqara/__init__.py index 8f5ac19ee68..f7bc1910521 100644 --- a/homeassistant/components/xiaomi_aqara/__init__.py +++ b/homeassistant/components/xiaomi_aqara/__init__.py @@ -267,10 +267,8 @@ class XiaomiDevice(Entity): self.parse_data(device["data"], device["raw_data"]) self.parse_voltage(device["data"]) - if hasattr(self, "_data_key") and self._data_key: # pylint: disable=no-member - self._unique_id = ( - f"{self._data_key}{self._sid}" # pylint: disable=no-member - ) + if hasattr(self, "_data_key") and self._data_key: + self._unique_id = f"{self._data_key}{self._sid}" else: self._unique_id = f"{self._type}{self._sid}" diff --git a/homeassistant/components/xiaomi_miio/light.py b/homeassistant/components/xiaomi_miio/light.py index 0a4ed1527c0..1fc032b5c36 100644 --- a/homeassistant/components/xiaomi_miio/light.py +++ b/homeassistant/components/xiaomi_miio/light.py @@ -449,14 +449,11 @@ class XiaomiPhilipsBulb(XiaomiPhilipsGenericLight): if ATTR_BRIGHTNESS in kwargs and ATTR_COLOR_TEMP in kwargs: _LOGGER.debug( - ( - "Setting brightness and color temperature: " - "%s %s%%, %s mireds, %s%% cct" - ), + "Setting brightness and color temperature: %s %s%%, %s mireds, %s%% cct", brightness, - percent_brightness, # pylint: disable=used-before-assignment + percent_brightness, color_temp, - percent_color_temp, # pylint: disable=used-before-assignment + percent_color_temp, ) result = await self._try_command( @@ -832,8 +829,8 @@ class XiaomiPhilipsMoonlightLamp(XiaomiPhilipsBulb): _LOGGER.debug( "Setting brightness and color: %s %s%%, %s", brightness, - percent_brightness, # pylint: disable=used-before-assignment - rgb, # pylint: disable=used-before-assignment + percent_brightness, + rgb, ) result = await self._try_command( @@ -856,7 +853,7 @@ class XiaomiPhilipsMoonlightLamp(XiaomiPhilipsBulb): brightness, percent_brightness, color_temp, - percent_color_temp, # pylint: disable=used-before-assignment + percent_color_temp, ) result = await self._try_command( diff --git a/homeassistant/components/xmpp/notify.py b/homeassistant/components/xmpp/notify.py index 2f5bad116c4..0150e761838 100644 --- a/homeassistant/components/xmpp/notify.py +++ b/homeassistant/components/xmpp/notify.py @@ -198,9 +198,7 @@ async def async_send_message( # noqa: C901 _LOGGER.info("Sending file to %s", recipient) message = self.Message(sto=recipient, stype="chat") message["body"] = url - message["oob"][ # pylint: disable=invalid-sequence-index - "url" - ] = url + message["oob"]["url"] = url try: message.send() except (IqError, IqTimeout, XMPPError) as ex: diff --git a/homeassistant/components/zha/core/cluster_handlers/general.py b/homeassistant/components/zha/core/cluster_handlers/general.py index 622c9e4340e..bd66b0f6c63 100644 --- a/homeassistant/components/zha/core/cluster_handlers/general.py +++ b/homeassistant/components/zha/core/cluster_handlers/general.py @@ -164,9 +164,7 @@ class BasicClusterHandler(ClusterHandler): """Initialize Basic cluster handler.""" super().__init__(cluster, endpoint) if is_hue_motion_sensor(self) and self.cluster.endpoint.endpoint_id == 2: - self.ZCL_INIT_ATTRS = ( # pylint: disable=invalid-name - self.ZCL_INIT_ATTRS.copy() - ) + self.ZCL_INIT_ATTRS = self.ZCL_INIT_ATTRS.copy() self.ZCL_INIT_ATTRS["trigger_indicator"] = True elif ( self.cluster.endpoint.manufacturer == "TexasInstruments" @@ -373,7 +371,7 @@ class OnOffClusterHandler(ClusterHandler): except KeyError: return - self.ZCL_INIT_ATTRS = self.ZCL_INIT_ATTRS.copy() # pylint: disable=invalid-name + self.ZCL_INIT_ATTRS = self.ZCL_INIT_ATTRS.copy() self.ZCL_INIT_ATTRS["backlight_mode"] = True self.ZCL_INIT_ATTRS["power_on_state"] = True diff --git a/homeassistant/components/zha/core/cluster_handlers/manufacturerspecific.py b/homeassistant/components/zha/core/cluster_handlers/manufacturerspecific.py index e46031cce14..450a1aeec97 100644 --- a/homeassistant/components/zha/core/cluster_handlers/manufacturerspecific.py +++ b/homeassistant/components/zha/core/cluster_handlers/manufacturerspecific.py @@ -92,7 +92,7 @@ class TuyaClusterHandler(ClusterHandler): "_TZE200_k6jhsr0q", "_TZE200_9mahtqtg", ): - self.ZCL_INIT_ATTRS = { # pylint: disable=invalid-name + self.ZCL_INIT_ATTRS = { "backlight_mode": True, "power_on_state": True, } @@ -109,7 +109,7 @@ class OppleRemote(ClusterHandler): """Initialize Opple cluster handler.""" super().__init__(cluster, endpoint) if self.cluster.endpoint.model == "lumi.motion.ac02": - self.ZCL_INIT_ATTRS = { # pylint: disable=invalid-name + self.ZCL_INIT_ATTRS = { "detection_interval": True, "motion_sensitivity": True, "trigger_indicator": True, diff --git a/homeassistant/components/zha/core/cluster_handlers/measurement.py b/homeassistant/components/zha/core/cluster_handlers/measurement.py index beeb6296e32..bd483920842 100644 --- a/homeassistant/components/zha/core/cluster_handlers/measurement.py +++ b/homeassistant/components/zha/core/cluster_handlers/measurement.py @@ -67,9 +67,7 @@ class OccupancySensing(ClusterHandler): """Initialize Occupancy cluster handler.""" super().__init__(cluster, endpoint) if is_hue_motion_sensor(self): - self.ZCL_INIT_ATTRS = ( # pylint: disable=invalid-name - self.ZCL_INIT_ATTRS.copy() - ) + self.ZCL_INIT_ATTRS = self.ZCL_INIT_ATTRS.copy() self.ZCL_INIT_ATTRS["sensitivity"] = True diff --git a/homeassistant/components/zha/core/const.py b/homeassistant/components/zha/core/const.py index c90c78243d1..7aab6112ab0 100644 --- a/homeassistant/components/zha/core/const.py +++ b/homeassistant/components/zha/core/const.py @@ -7,7 +7,7 @@ import logging import bellows.zigbee.application import voluptuous as vol import zigpy.application -from zigpy.config import CONF_DEVICE_PATH # noqa: F401 # pylint: disable=unused-import +from zigpy.config import CONF_DEVICE_PATH # noqa: F401 import zigpy.types as t import zigpy_deconz.zigbee.application import zigpy_xbee.zigbee.application diff --git a/homeassistant/components/zha/core/discovery.py b/homeassistant/components/zha/core/discovery.py index 0ca1c136271..92b68bdb159 100644 --- a/homeassistant/components/zha/core/discovery.py +++ b/homeassistant/components/zha/core/discovery.py @@ -16,7 +16,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.entity_registry import async_entries_for_device from homeassistant.helpers.typing import ConfigType -from .. import ( # noqa: F401 pylint: disable=unused-import, +from .. import ( # noqa: F401 alarm_control_panel, binary_sensor, button, @@ -35,7 +35,7 @@ from .. import ( # noqa: F401 pylint: disable=unused-import, from . import const as zha_const, registries as zha_regs # importing cluster handlers updates registries -from .cluster_handlers import ( # noqa: F401 pylint: disable=unused-import, +from .cluster_handlers import ( # noqa: F401 ClusterHandler, closures, general, diff --git a/homeassistant/components/zha/core/endpoint.py b/homeassistant/components/zha/core/endpoint.py index 53a3fb883ef..bdef5ac46af 100644 --- a/homeassistant/components/zha/core/endpoint.py +++ b/homeassistant/components/zha/core/endpoint.py @@ -27,7 +27,7 @@ ATTR_IN_CLUSTERS: Final[str] = "input_clusters" ATTR_OUT_CLUSTERS: Final[str] = "output_clusters" _LOGGER = logging.getLogger(__name__) -CALLABLE_T = TypeVar("CALLABLE_T", bound=Callable) # pylint: disable=invalid-name +CALLABLE_T = TypeVar("CALLABLE_T", bound=Callable) class Endpoint: diff --git a/homeassistant/components/zha/device_tracker.py b/homeassistant/components/zha/device_tracker.py index 04c74a44dbe..bda346624dd 100644 --- a/homeassistant/components/zha/device_tracker.py +++ b/homeassistant/components/zha/device_tracker.py @@ -111,7 +111,7 @@ class ZHADeviceScannerEntity(ScannerEntity, ZhaEntity): return self._battery_level @property # type: ignore[misc] - def device_info( # pylint: disable=overridden-final-method + def device_info( self, ) -> DeviceInfo: """Return device info.""" diff --git a/homeassistant/components/zha/light.py b/homeassistant/components/zha/light.py index 73955614c07..6331b192859 100644 --- a/homeassistant/components/zha/light.py +++ b/homeassistant/components/zha/light.py @@ -1112,13 +1112,13 @@ class LightGroup(BaseLight, ZhaGroupEntity): super().__init__(entity_ids, unique_id, group_id, zha_device, **kwargs) group = self.zha_device.gateway.get_group(self._group_id) - self._GROUP_SUPPORTS_EXECUTE_IF_OFF = True # pylint: disable=invalid-name + self._GROUP_SUPPORTS_EXECUTE_IF_OFF = True for member in group.members: # Ensure we do not send group commands that violate the minimum transition # time of any members. if member.device.manufacturer in DEFAULT_MIN_TRANSITION_MANUFACTURERS: - self._DEFAULT_MIN_TRANSITION_TIME = ( # pylint: disable=invalid-name + self._DEFAULT_MIN_TRANSITION_TIME = ( MinTransitionLight._DEFAULT_MIN_TRANSITION_TIME ) diff --git a/homeassistant/components/zha/sensor.py b/homeassistant/components/zha/sensor.py index c514e02ec57..535733230b9 100644 --- a/homeassistant/components/zha/sensor.py +++ b/homeassistant/components/zha/sensor.py @@ -228,7 +228,7 @@ class Battery(Sensor): return cls(unique_id, zha_device, cluster_handlers, **kwargs) @staticmethod - def formatter(value: int) -> int | None: # pylint: disable=arguments-differ + def formatter(value: int) -> int | None: """Return the state of the entity.""" # per zcl specs battery percent is reported at 200% ¯\_(ツ)_/¯ if not isinstance(value, numbers.Number) or value == -1: diff --git a/tests/components/sensor/test_recorder.py b/tests/components/sensor/test_recorder.py index 65b0a0b9485..1c0200e1b53 100644 --- a/tests/components/sensor/test_recorder.py +++ b/tests/components/sensor/test_recorder.py @@ -1,7 +1,5 @@ """The tests for sensor recorder platform.""" from collections.abc import Callable - -# pylint: disable=invalid-name from datetime import datetime, timedelta import math from statistics import mean diff --git a/tests/components/smartthings/test_init.py b/tests/components/smartthings/test_init.py index f08d1b54985..0630ffd8392 100644 --- a/tests/components/smartthings/test_init.py +++ b/tests/components/smartthings/test_init.py @@ -422,7 +422,7 @@ async def test_broker_regenerates_token(hass: HomeAssistant, config_entry) -> No broker.connect() assert stored_action - await stored_action(None) # pylint:disable=not-callable + await stored_action(None) assert token.refresh.call_count == 1 assert config_entry.data[CONF_REFRESH_TOKEN] == token.refresh_token diff --git a/tests/components/time_date/test_sensor.py b/tests/components/time_date/test_sensor.py index 42f1e260280..96c7edf422b 100644 --- a/tests/components/time_date/test_sensor.py +++ b/tests/components/time_date/test_sensor.py @@ -102,7 +102,6 @@ async def test_states_non_default_timezone(hass: HomeAssistant) -> None: assert device.state == "2017-05-17T20:54:00" -# pylint: disable=no-member async def test_timezone_intervals(hass: HomeAssistant) -> None: """Test date sensor behavior in a timezone besides UTC.""" hass.config.set_time_zone("America/New_York") diff --git a/tests/components/water_heater/test_init.py b/tests/components/water_heater/test_init.py index 66276f0bc88..bc996ab6fa4 100644 --- a/tests/components/water_heater/test_init.py +++ b/tests/components/water_heater/test_init.py @@ -71,14 +71,12 @@ async def test_sync_turn_on(hass: HomeAssistant) -> None: setattr(water_heater, "turn_on", MagicMock()) await water_heater.async_turn_on() - # pylint: disable-next=no-member assert water_heater.turn_on.call_count == 1 # Test with async_turn_on method defined setattr(water_heater, "async_turn_on", AsyncMock()) await water_heater.async_turn_on() - # pylint: disable-next=no-member assert water_heater.async_turn_on.call_count == 1 @@ -91,12 +89,10 @@ async def test_sync_turn_off(hass: HomeAssistant) -> None: setattr(water_heater, "turn_off", MagicMock()) await water_heater.async_turn_off() - # pylint: disable-next=no-member assert water_heater.turn_off.call_count == 1 # Test with async_turn_off method defined setattr(water_heater, "async_turn_off", AsyncMock()) await water_heater.async_turn_off() - # pylint: disable-next=no-member assert water_heater.async_turn_off.call_count == 1 diff --git a/tests/components/websocket_api/test_auth.py b/tests/components/websocket_api/test_auth.py index 51bff1af0d7..aba34aeb44b 100644 --- a/tests/components/websocket_api/test_auth.py +++ b/tests/components/websocket_api/test_auth.py @@ -296,7 +296,6 @@ async def test_auth_sending_unknown_type_disconnects( auth_msg = await ws.receive_json() assert auth_msg["type"] == TYPE_AUTH_REQUIRED - # pylint: disable-next=protected-access await ws._writer._send_frame(b"1" * 130, 0x30) auth_msg = await ws.receive() assert auth_msg.type == WSMsgType.close