mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 01:08:12 +00:00
Remove pylint configs flagged by useless-suppression (#99081)
This commit is contained in:
parent
a25a7ebbeb
commit
c287bd1a3b
@ -4,13 +4,8 @@ from __future__ import annotations
|
||||
import json
|
||||
import logging
|
||||
|
||||
# pylint: disable-next=no-name-in-module
|
||||
from azure.servicebus import ServiceBusMessage
|
||||
|
||||
# pylint: disable-next=no-name-in-module
|
||||
from azure.servicebus.aio import ServiceBusClient, ServiceBusSender
|
||||
|
||||
# pylint: disable-next=no-name-in-module
|
||||
from azure.servicebus.exceptions import (
|
||||
MessagingEntityNotFoundError,
|
||||
ServiceBusConnectionError,
|
||||
|
@ -51,7 +51,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
discovergy_data.meters = await discovergy_data.api_client.meters()
|
||||
except discovergyError.InvalidLogin as err:
|
||||
raise ConfigEntryAuthFailed("Invalid email or password") from err
|
||||
except Exception as err: # pylint: disable=broad-except
|
||||
except Exception as err:
|
||||
raise ConfigEntryNotReady(
|
||||
"Unexpected error while while getting meters"
|
||||
) from err
|
||||
|
@ -318,7 +318,7 @@ class HomeAssistantHTTP:
|
||||
# By default aiohttp does a linear search for routing rules,
|
||||
# we have a lot of routes, so use a dict lookup with a fallback
|
||||
# to the linear search.
|
||||
self.app._router = FastUrlDispatcher() # pylint: disable=protected-access
|
||||
self.app._router = FastUrlDispatcher()
|
||||
self.hass = hass
|
||||
self.ssl_certificate = ssl_certificate
|
||||
self.ssl_peer_certificate = ssl_peer_certificate
|
||||
|
@ -21,7 +21,7 @@ def get_device_macs(
|
||||
for x in ("MacAddress1", "MacAddress2", "WifiMacAddrWl0", "WifiMacAddrWl1")
|
||||
]
|
||||
# Assume not supported when exception is thrown
|
||||
with suppress(Exception): # pylint: disable=broad-except
|
||||
with suppress(Exception):
|
||||
macs.extend(x.get("WifiMac") for x in wlan_settings["Ssids"]["Ssid"])
|
||||
|
||||
return sorted({format_mac(str(x)) for x in macs if x})
|
||||
|
@ -207,7 +207,6 @@ async def async_setup_platform(
|
||||
async_add_entities([integral])
|
||||
|
||||
|
||||
# pylint: disable-next=hass-invalid-inheritance # needs fixing
|
||||
class IntegrationSensor(RestoreSensor):
|
||||
"""Representation of an integration sensor."""
|
||||
|
||||
|
@ -247,7 +247,7 @@ class MqttValueTemplate:
|
||||
payload, variables=values
|
||||
)
|
||||
)
|
||||
except Exception as ex: # pylint: disable=broad-except
|
||||
except Exception as ex:
|
||||
_LOGGER.error(
|
||||
"%s: %s rendering template for entity '%s', template: '%s'",
|
||||
type(ex).__name__,
|
||||
@ -274,7 +274,7 @@ class MqttValueTemplate:
|
||||
payload, default, variables=values
|
||||
)
|
||||
)
|
||||
except Exception as ex: # pylint: disable=broad-except
|
||||
except Exception as ex:
|
||||
_LOGGER.error(
|
||||
"%s: %s rendering template for entity '%s', template: "
|
||||
"'%s', default value: %s and payload: %s",
|
||||
|
@ -187,8 +187,6 @@ class Filters:
|
||||
if self._included_domains or self._included_entity_globs:
|
||||
return or_(
|
||||
i_entities,
|
||||
# https://github.com/sqlalchemy/sqlalchemy/issues/9190
|
||||
# pylint: disable-next=invalid-unary-operand-type
|
||||
(~e_entities & (i_entity_globs | (~e_entity_globs & i_domains))),
|
||||
).self_group()
|
||||
|
||||
|
@ -548,7 +548,6 @@ class SamsungTVWSBridge(
|
||||
return RESULT_AUTH_MISSING
|
||||
except (ConnectionFailure, OSError, AsyncioTimeoutError) as err:
|
||||
LOGGER.debug("Failing config: %s, %s error: %s", config, type(err), err)
|
||||
# pylint: disable-next=useless-else-on-loop
|
||||
else: # noqa: PLW0120
|
||||
if result:
|
||||
return result
|
||||
|
@ -102,7 +102,6 @@ async def discover_devices(hass, hass_config):
|
||||
async with asyncio.timeout(SCAN_INTERVAL.total_seconds()):
|
||||
channels = {
|
||||
channel["id"]: channel
|
||||
# pylint: disable-next=cell-var-from-loop
|
||||
for channel in await server.get_channels( # noqa: B023
|
||||
include=["iodevice", "state", "connected"]
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user