Remove unnnecessary pylint configs from components [e-l]* (#99004)

This commit is contained in:
Ville Skyttä 2023-08-25 10:46:34 +03:00 committed by GitHub
parent 960d66e168
commit e7b6037419
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
37 changed files with 13 additions and 56 deletions

View File

@ -7,7 +7,6 @@ from __future__ import annotations
import logging
# pylint: disable=import-error
from beacontools import BeaconScanner, EddystoneFilter, EddystoneTLMFrame
import voluptuous as vol

View File

@ -225,7 +225,7 @@ class Config:
@callback
def _clear_exposed_cache(self, event: EventType[EventStateChangedData]) -> None:
"""Clear the cache of exposed states."""
self.get_exposed_states.cache_clear() # pylint: disable=no-member
self.get_exposed_states.cache_clear()
def is_state_exposed(self, state: State) -> bool:
"""Cache determine if an entity should be exposed on the emulated bridge."""

View File

@ -4,7 +4,7 @@ from __future__ import annotations
import logging
from typing import Any
import eq3bt as eq3 # pylint: disable=import-error
import eq3bt as eq3
import voluptuous as vol
from homeassistant.components.climate import (

View File

@ -51,9 +51,7 @@ CCCD_INDICATE_BYTES = b"\x02\x00"
DEFAULT_MAX_WRITE_WITHOUT_RESPONSE = DEFAULT_MTU - GATT_HEADER_SIZE
_LOGGER = logging.getLogger(__name__)
_WrapFuncType = TypeVar( # pylint: disable=invalid-name
"_WrapFuncType", bound=Callable[..., Any]
)
_WrapFuncType = TypeVar("_WrapFuncType", bound=Callable[..., Any])
def mac_to_int(address: str) -> int:

View File

@ -4,7 +4,7 @@ from __future__ import annotations
from collections.abc import Callable
import functools
import math
from typing import Any, Generic, TypeVar, cast # pylint: disable=unused-import
from typing import Any, Generic, TypeVar, cast
from aioesphomeapi import (
EntityCategory as EsphomeEntityCategory,

View File

@ -181,7 +181,6 @@ class EsphomeLight(EsphomeEntity[LightInfo, LightState], LightEntity):
try_keep_current_mode = False
if (rgbw_ha := kwargs.get(ATTR_RGBW_COLOR)) is not None:
# pylint: disable-next=invalid-name
*rgb, w = tuple(x / 255 for x in rgbw_ha) # type: ignore[assignment]
color_bri = max(rgb)
# normalize rgb
@ -194,7 +193,6 @@ class EsphomeLight(EsphomeEntity[LightInfo, LightState], LightEntity):
try_keep_current_mode = False
if (rgbww_ha := kwargs.get(ATTR_RGBWW_COLOR)) is not None:
# pylint: disable-next=invalid-name
*rgb, cw, ww = tuple(x / 255 for x in rgbww_ha) # type: ignore[assignment]
color_bri = max(rgb)
# normalize rgb

View File

@ -134,7 +134,6 @@ class EufyHomeLight(LightEntity):
"""Turn the specified light on."""
brightness = kwargs.get(ATTR_BRIGHTNESS)
colortemp = kwargs.get(ATTR_COLOR_TEMP)
# pylint: disable-next=invalid-name
hs = kwargs.get(ATTR_HS_COLOR)
if brightness is not None:

View File

@ -147,6 +147,6 @@ def async_enable_report_state(hass: HomeAssistant, google_config: AbstractConfig
def unsub_all():
unsub()
if unsub_pending:
unsub_pending() # pylint: disable=not-callable
unsub_pending()
return unsub_all

View File

@ -60,9 +60,7 @@ class OAuth2FlowHandler(
def _get_profile() -> str:
"""Get profile from inside the executor."""
users = build( # pylint: disable=no-member
"gmail", "v1", credentials=credentials
).users()
users = build("gmail", "v1", credentials=credentials).users()
return users.getProfile(userId="me").execute()["emailAddress"]
credentials = Credentials(data[CONF_TOKEN][CONF_ACCESS_TOKEN])

View File

@ -505,7 +505,6 @@ def setup_platform(
joined_path = os.path.join(gtfs_dir, sqlite_file)
gtfs = pygtfs.Schedule(joined_path)
# pylint: disable=no-member
if not gtfs.feeds:
pygtfs.append_feed(gtfs, os.path.join(gtfs_dir, data))

View File

@ -82,7 +82,6 @@ NO_STORE = re.compile(
r"|app/entrypoint.js"
r")$"
)
# pylint: enable=implicit-str-concat
# fmt: on
RESPONSE_HEADERS_FILTER = {

View File

@ -41,7 +41,6 @@ SCHEMA_WEBSOCKET_EVENT = vol.Schema(
)
# Endpoints needed for ingress can't require admin because addons can set `panel_admin: false`
# pylint: disable=implicit-str-concat
# fmt: off
WS_NO_ADMIN_ENDPOINTS = re.compile(
r"^(?:"
@ -50,7 +49,6 @@ WS_NO_ADMIN_ENDPOINTS = re.compile(
r")$" # noqa: ISC001
)
# fmt: on
# pylint: enable=implicit-str-concat
_LOGGER: logging.Logger = logging.getLogger(__package__)

View File

@ -113,7 +113,6 @@ SUBSCRIPTION_SCHEMA = vol.All(
dict,
vol.Schema(
{
# pylint: disable=no-value-for-parameter
vol.Required(ATTR_ENDPOINT): vol.Url(),
vol.Required(ATTR_KEYS): KEYS_SCHEMA,
vol.Optional(ATTR_EXPIRATIONTIME): vol.Any(None, cv.positive_int),

View File

@ -224,7 +224,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
# Once we do a rooms update, we cancel the listener
# until the next time lights are added
bridge.reset_jobs.remove(cancel_update_rooms_listener)
cancel_update_rooms_listener() # pylint: disable=not-callable
cancel_update_rooms_listener()
cancel_update_rooms_listener = None
@callback

View File

@ -293,7 +293,6 @@ async def async_setup_entry(
return True
# pylint: disable=invalid-name
class iOSPushConfigView(HomeAssistantView):
"""A view that provides the push categories configuration."""

View File

@ -25,7 +25,6 @@ _LOGGER = logging.getLogger(__name__)
PUSH_URL = "https://ios-push.home-assistant.io/push"
# pylint: disable=invalid-name
def log_rate_limits(hass, target, resp, level=20):
"""Output rate limit log line at given level."""
rate_limits = resp["rateLimits"]

View File

@ -1,5 +1,5 @@
"""Support to emulate keyboard presses on host machine."""
from pykeyboard import PyKeyboard # pylint: disable=import-error
from pykeyboard import PyKeyboard
import voluptuous as vol
from homeassistant.const import (

View File

@ -1,5 +1,4 @@
"""Receive signals from a keyboard and use it as a remote control."""
# pylint: disable=import-error
from __future__ import annotations
import asyncio
@ -331,7 +330,6 @@ class KeyboardRemote:
_LOGGER.debug("Start device monitoring")
await self.hass.async_add_executor_job(self.dev.grab)
async for event in self.dev.async_read_loop():
# pylint: disable=no-member
if event.type is ecodes.EV_KEY:
if event.value in self.key_values:
_LOGGER.debug(

View File

@ -197,7 +197,6 @@ DEVICE_SCHEMA_YAML = vol.All(
import_device_validator,
)
# pylint: disable=no-value-for-parameter
CONFIG_SCHEMA = vol.Schema(
{
DOMAIN: vol.All(

View File

@ -278,7 +278,6 @@ class LimitlessLEDGroup(LightEntity, RestoreEntity):
return ColorMode.COLOR_TEMP
return ColorMode.HS
# pylint: disable=arguments-differ
@state(False)
def turn_off(self, transition_time: int, pipeline: Pipeline, **kwargs: Any) -> None:
"""Turn off a group."""
@ -286,7 +285,6 @@ class LimitlessLEDGroup(LightEntity, RestoreEntity):
pipeline.transition(transition_time, brightness=0.0)
pipeline.off()
# pylint: disable=arguments-differ
@state(True)
def turn_on(self, transition_time: int, pipeline: Pipeline, **kwargs: Any) -> None:
"""Turn on (or adjust property of) a group."""

View File

@ -61,7 +61,7 @@ class LinodeBinarySensor(BinarySensorEntity):
_attr_device_class = BinarySensorDeviceClass.MOVING
def __init__(self, li, node_id): # pylint: disable=invalid-name
def __init__(self, li, node_id):
"""Initialize a new Linode sensor."""
self._linode = li
self._node_id = node_id

View File

@ -57,7 +57,7 @@ def setup_platform(
class LinodeSwitch(SwitchEntity):
"""Representation of a Linode Node switch."""
def __init__(self, li, node_id): # pylint: disable=invalid-name
def __init__(self, li, node_id):
"""Initialize a new Linode sensor."""
self._linode = li
self._node_id = node_id

View File

@ -1,5 +1,4 @@
"""Support for LIRC devices."""
# pylint: disable=import-error
import logging
import threading
import time

View File

@ -126,7 +126,6 @@ def _get_logger_class(hass_overrides: dict[str, int]) -> type[logging.Logger]:
super().setLevel(level)
# pylint: disable=invalid-name
def orig_setLevel(self, level: int | str) -> None:
"""Set the log level."""
super().setLevel(level)

View File

@ -1130,7 +1130,6 @@ async def test_put_light_state_fan(hass_hue, hue_client) -> None:
assert round(fan_json["state"][HUE_API_STATE_BRI] * 100 / 254) == 100
# pylint: disable=invalid-name
async def test_put_with_form_urlencoded_content_type(hass_hue, hue_client) -> None:
"""Test the form with urlencoded content."""
entity_number = ENTITY_NUMBERS_BY_ID["light.ceiling_lights"]
@ -1215,7 +1214,6 @@ async def test_get_empty_groups_state(hue_client) -> None:
assert result_json == {}
# pylint: disable=invalid-name
async def perform_put_test_on_ceiling_lights(
hass_hue, hue_client, content_type=CONTENT_TYPE_JSON
):

View File

@ -302,7 +302,6 @@ async def test_flux_before_sunrise_known_location(
assert call.data[light.ATTR_XY_COLOR] == [0.606, 0.379]
# pylint: disable=invalid-name
async def test_flux_after_sunrise_before_sunset(
hass: HomeAssistant, enable_custom_integrations: None
) -> None:
@ -361,7 +360,6 @@ async def test_flux_after_sunrise_before_sunset(
assert call.data[light.ATTR_XY_COLOR] == [0.439, 0.37]
# pylint: disable=invalid-name
async def test_flux_after_sunset_before_stop(
hass: HomeAssistant, enable_custom_integrations: None
) -> None:
@ -421,7 +419,6 @@ async def test_flux_after_sunset_before_stop(
assert call.data[light.ATTR_XY_COLOR] == [0.506, 0.385]
# pylint: disable=invalid-name
async def test_flux_after_stop_before_sunrise(
hass: HomeAssistant, enable_custom_integrations: None
) -> None:
@ -480,7 +477,6 @@ async def test_flux_after_stop_before_sunrise(
assert call.data[light.ATTR_XY_COLOR] == [0.606, 0.379]
# pylint: disable=invalid-name
async def test_flux_with_custom_start_stop_times(
hass: HomeAssistant, enable_custom_integrations: None
) -> None:
@ -603,7 +599,6 @@ async def test_flux_before_sunrise_stop_next_day(
assert call.data[light.ATTR_XY_COLOR] == [0.606, 0.379]
# pylint: disable=invalid-name
async def test_flux_after_sunrise_before_sunset_stop_next_day(
hass: HomeAssistant, enable_custom_integrations: None
) -> None:
@ -666,7 +661,6 @@ async def test_flux_after_sunrise_before_sunset_stop_next_day(
assert call.data[light.ATTR_XY_COLOR] == [0.439, 0.37]
# pylint: disable=invalid-name
@pytest.mark.parametrize("x", [0, 1])
async def test_flux_after_sunset_before_midnight_stop_next_day(
hass: HomeAssistant, x, enable_custom_integrations: None
@ -730,7 +724,6 @@ async def test_flux_after_sunset_before_midnight_stop_next_day(
assert call.data[light.ATTR_XY_COLOR] == [0.588, 0.386]
# pylint: disable=invalid-name
async def test_flux_after_sunset_after_midnight_stop_next_day(
hass: HomeAssistant, enable_custom_integrations: None
) -> None:
@ -793,7 +786,6 @@ async def test_flux_after_sunset_after_midnight_stop_next_day(
assert call.data[light.ATTR_XY_COLOR] == [0.601, 0.382]
# pylint: disable=invalid-name
async def test_flux_after_stop_before_sunrise_stop_next_day(
hass: HomeAssistant, enable_custom_integrations: None
) -> None:
@ -856,7 +848,6 @@ async def test_flux_after_stop_before_sunrise_stop_next_day(
assert call.data[light.ATTR_XY_COLOR] == [0.606, 0.379]
# pylint: disable=invalid-name
async def test_flux_with_custom_colortemps(
hass: HomeAssistant, enable_custom_integrations: None
) -> None:
@ -918,7 +909,6 @@ async def test_flux_with_custom_colortemps(
assert call.data[light.ATTR_XY_COLOR] == [0.469, 0.378]
# pylint: disable=invalid-name
async def test_flux_with_custom_brightness(
hass: HomeAssistant, enable_custom_integrations: None
) -> None:

View File

@ -26,7 +26,7 @@ class FritzServiceMock(Service):
self.serviceId = serviceId
class FritzConnectionMock: # pylint: disable=too-few-public-methods
class FritzConnectionMock:
"""FritzConnection mocking."""
def __init__(self, services):

View File

@ -616,7 +616,6 @@ async def test_service_group_services_add_remove_entities(hass: HomeAssistant) -
assert "person.one" not in list(group_state.attributes["entity_id"])
# pylint: disable=invalid-name
async def test_service_group_set_group_remove_group(hass: HomeAssistant) -> None:
"""Check if service are available."""
with assert_setup_component(0, "group"):

View File

@ -1,5 +1,4 @@
"""The tests the History component."""
# pylint: disable=invalid-name
from datetime import timedelta
from http import HTTPStatus
import json

View File

@ -1,7 +1,6 @@
"""The tests the History component."""
from __future__ import annotations
# pylint: disable=invalid-name
from datetime import timedelta
from http import HTTPStatus
import json

View File

@ -1,5 +1,4 @@
"""The tests the History component websocket_api."""
# pylint: disable=protected-access,invalid-name
import asyncio
from datetime import timedelta
from unittest.mock import patch

View File

@ -1,5 +1,4 @@
"""The tests the History component websocket_api."""
# pylint: disable=protected-access,invalid-name
import pytest

View File

@ -244,13 +244,13 @@ async def test_hmip_reset_energy_counter_services(
blocking=True,
)
assert hmip_device.mock_calls[-1][0] == "reset_energy_counter"
assert len(hmip_device._connection.mock_calls) == 2 # pylint: disable=W0212
assert len(hmip_device._connection.mock_calls) == 2
await hass.services.async_call(
"homematicip_cloud", "reset_energy_counter", {"entity_id": "all"}, blocking=True
)
assert hmip_device.mock_calls[-1][0] == "reset_energy_counter"
assert len(hmip_device._connection.mock_calls) == 4 # pylint: disable=W0212
assert len(hmip_device._connection.mock_calls) == 4
async def test_hmip_multi_area_device(

View File

@ -763,7 +763,6 @@ async def test_options_priority(hass: HomeAssistant) -> None:
{ATTR_ENTITY_ID: TEST_ENTITY_ID_1},
blocking=True,
)
# pylint: disable-next=unsubscriptable-object
assert client.async_send_set_color.call_args[1][CONF_PRIORITY] == new_priority

View File

@ -44,7 +44,6 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
await hass.async_block_till_done()
hass.bus.async_fire(EVENT_HOMEASSISTANT_STOP)
await hass.async_block_till_done()
# pylint: disable-next=no-member
assert insteon.devices.async_save.call_count == 1
assert mock_close.called

View File

@ -73,7 +73,6 @@ async def test_lock_default(hass: HomeAssistant) -> None:
async def test_lock_states(hass: HomeAssistant) -> None:
"""Test lock entity states."""
# pylint: disable=protected-access
lock = MockLockEntity()
lock.hass = hass

View File

@ -1,5 +1,4 @@
"""The tests for the logbook component."""
# pylint: disable=invalid-name
import asyncio
import collections
from collections.abc import Callable