Remove some unneeded pylint suppressions (#32152)
This commit is contained in:
parent
a9e061270b
commit
9b2544c923
23 changed files with 4 additions and 31 deletions
|
@ -227,7 +227,6 @@ class AlexaCapability:
|
||||||
"""Return properties serialized for an API response."""
|
"""Return properties serialized for an API response."""
|
||||||
for prop in self.properties_supported():
|
for prop in self.properties_supported():
|
||||||
prop_name = prop["name"]
|
prop_name = prop["name"]
|
||||||
# pylint: disable=assignment-from-no-return
|
|
||||||
prop_value = self.get_property(prop_name)
|
prop_value = self.get_property(prop_name)
|
||||||
if prop_value is not None:
|
if prop_value is not None:
|
||||||
result = {
|
result = {
|
||||||
|
|
|
@ -53,7 +53,7 @@ class AbstractConfig(ABC):
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
await self._unsub_proactive_report
|
await self._unsub_proactive_report
|
||||||
except Exception: # pylint: disable=broad-except
|
except Exception:
|
||||||
self._unsub_proactive_report = None
|
self._unsub_proactive_report = None
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,6 @@ class AlmondFlowHandler(config_entry_oauth2_flow.AbstractOAuth2FlowHandler):
|
||||||
)
|
)
|
||||||
return self.async_abort(reason="cannot_connect")
|
return self.async_abort(reason="cannot_connect")
|
||||||
|
|
||||||
# pylint: disable=invalid-name
|
|
||||||
self.CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_POLL
|
self.CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_POLL
|
||||||
|
|
||||||
return self.async_create_entry(
|
return self.async_create_entry(
|
||||||
|
|
|
@ -109,7 +109,6 @@ CONFIG_SCHEMA = vol.Schema(
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-many-ancestors
|
|
||||||
class AmcrestChecker(Http):
|
class AmcrestChecker(Http):
|
||||||
"""amcrest.Http wrapper for catching errors."""
|
"""amcrest.Http wrapper for catching errors."""
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,6 @@ async def async_attach_trigger(hass, config, action, automation_info):
|
||||||
from_match = condition.zone(hass, zone_state, from_state)
|
from_match = condition.zone(hass, zone_state, from_state)
|
||||||
to_match = condition.zone(hass, zone_state, to_state)
|
to_match = condition.zone(hass, zone_state, to_state)
|
||||||
|
|
||||||
# pylint: disable=too-many-boolean-expressions
|
|
||||||
if (
|
if (
|
||||||
trigger_event == EVENT_ENTER
|
trigger_event == EVENT_ENTER
|
||||||
and not from_match
|
and not from_match
|
||||||
|
|
|
@ -53,7 +53,6 @@ async def async_attach_trigger(hass, config, action, automation_info):
|
||||||
from_match = False
|
from_match = False
|
||||||
to_match = condition.zone(hass, zone_state, to_s)
|
to_match = condition.zone(hass, zone_state, to_s)
|
||||||
|
|
||||||
# pylint: disable=too-many-boolean-expressions
|
|
||||||
if (
|
if (
|
||||||
event == EVENT_ENTER
|
event == EVENT_ENTER
|
||||||
and not from_match
|
and not from_match
|
||||||
|
|
|
@ -411,7 +411,6 @@ class Device(RestoreEntity):
|
||||||
self.gps_accuracy = 0
|
self.gps_accuracy = 0
|
||||||
LOGGER.warning("Could not parse gps value for %s: %s", self.dev_id, gps)
|
LOGGER.warning("Could not parse gps value for %s: %s", self.dev_id, gps)
|
||||||
|
|
||||||
# pylint: disable=not-an-iterable
|
|
||||||
await self.async_update()
|
await self.async_update()
|
||||||
|
|
||||||
def stale(self, now: dt_util.dt.datetime = None):
|
def stale(self, now: dt_util.dt.datetime = None):
|
||||||
|
|
|
@ -60,10 +60,8 @@ class HueFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
if (
|
if (
|
||||||
user_input is not None
|
user_input is not None
|
||||||
and self.discovered_bridges is not None
|
and self.discovered_bridges is not None
|
||||||
# pylint: disable=unsupported-membership-test
|
|
||||||
and user_input["id"] in self.discovered_bridges
|
and user_input["id"] in self.discovered_bridges
|
||||||
):
|
):
|
||||||
# pylint: disable=unsubscriptable-object
|
|
||||||
self.bridge = self.discovered_bridges[user_input["id"]]
|
self.bridge = self.discovered_bridges[user_input["id"]]
|
||||||
await self.async_set_unique_id(self.bridge.id, raise_on_progress=False)
|
await self.async_set_unique_id(self.bridge.id, raise_on_progress=False)
|
||||||
# We pass user input to link so it will attempt to link right away
|
# We pass user input to link so it will attempt to link right away
|
||||||
|
|
|
@ -141,7 +141,6 @@ async def _async_setup_entity(
|
||||||
async_add_entities([MqttFan(config, config_entry, discovery_hash)])
|
async_add_entities([MqttFan(config, config_entry, discovery_hash)])
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-many-ancestors
|
|
||||||
class MqttFan(
|
class MqttFan(
|
||||||
MqttAttributes,
|
MqttAttributes,
|
||||||
MqttAvailability,
|
MqttAvailability,
|
||||||
|
|
|
@ -154,7 +154,6 @@ async def async_setup_entity_basic(
|
||||||
async_add_entities([MqttLight(config, config_entry, discovery_hash)])
|
async_add_entities([MqttLight(config, config_entry, discovery_hash)])
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-many-ancestors
|
|
||||||
class MqttLight(
|
class MqttLight(
|
||||||
MqttAttributes,
|
MqttAttributes,
|
||||||
MqttAvailability,
|
MqttAvailability,
|
||||||
|
|
|
@ -125,7 +125,6 @@ async def async_setup_entity_json(
|
||||||
async_add_entities([MqttLightJson(config, config_entry, discovery_hash)])
|
async_add_entities([MqttLightJson(config, config_entry, discovery_hash)])
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-many-ancestors
|
|
||||||
class MqttLightJson(
|
class MqttLightJson(
|
||||||
MqttAttributes,
|
MqttAttributes,
|
||||||
MqttAvailability,
|
MqttAvailability,
|
||||||
|
|
|
@ -99,7 +99,6 @@ async def async_setup_entity_template(
|
||||||
async_add_entities([MqttTemplate(config, config_entry, discovery_hash)])
|
async_add_entities([MqttTemplate(config, config_entry, discovery_hash)])
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-many-ancestors
|
|
||||||
class MqttTemplate(
|
class MqttTemplate(
|
||||||
MqttAttributes,
|
MqttAttributes,
|
||||||
MqttAvailability,
|
MqttAvailability,
|
||||||
|
|
|
@ -99,7 +99,6 @@ async def _async_setup_entity(
|
||||||
async_add_entities([MqttSwitch(config, config_entry, discovery_hash)])
|
async_add_entities([MqttSwitch(config, config_entry, discovery_hash)])
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-many-ancestors
|
|
||||||
class MqttSwitch(
|
class MqttSwitch(
|
||||||
MqttAttributes,
|
MqttAttributes,
|
||||||
MqttAvailability,
|
MqttAvailability,
|
||||||
|
|
|
@ -168,7 +168,6 @@ async def async_setup_entity_legacy(
|
||||||
async_add_entities([MqttVacuum(config, config_entry, discovery_hash)])
|
async_add_entities([MqttVacuum(config, config_entry, discovery_hash)])
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-many-ancestors
|
|
||||||
class MqttVacuum(
|
class MqttVacuum(
|
||||||
MqttAttributes,
|
MqttAttributes,
|
||||||
MqttAvailability,
|
MqttAvailability,
|
||||||
|
|
|
@ -163,7 +163,6 @@ async def async_setup_entity_state(
|
||||||
async_add_entities([MqttStateVacuum(config, config_entry, discovery_hash)])
|
async_add_entities([MqttStateVacuum(config, config_entry, discovery_hash)])
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-many-ancestors
|
|
||||||
class MqttStateVacuum(
|
class MqttStateVacuum(
|
||||||
MqttAttributes,
|
MqttAttributes,
|
||||||
MqttAvailability,
|
MqttAvailability,
|
||||||
|
|
|
@ -228,8 +228,6 @@ class MySensorsLightRGB(MySensorsLight):
|
||||||
class MySensorsLightRGBW(MySensorsLightRGB):
|
class MySensorsLightRGBW(MySensorsLightRGB):
|
||||||
"""RGBW child class to MySensorsLightRGB."""
|
"""RGBW child class to MySensorsLightRGB."""
|
||||||
|
|
||||||
# pylint: disable=too-many-ancestors
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def supported_features(self):
|
def supported_features(self):
|
||||||
"""Flag supported features."""
|
"""Flag supported features."""
|
||||||
|
|
|
@ -115,7 +115,7 @@ async def async_setup(hass, config):
|
||||||
|
|
||||||
return call_data
|
return call_data
|
||||||
|
|
||||||
service_disable_schema = vol.Schema( # pylint: disable=invalid-name
|
service_disable_schema = vol.Schema(
|
||||||
vol.All(
|
vol.All(
|
||||||
{
|
{
|
||||||
vol.Required(SERVICE_DISABLE_ATTR_DURATION): vol.All(
|
vol.Required(SERVICE_DISABLE_ATTR_DURATION): vol.All(
|
||||||
|
|
|
@ -159,14 +159,12 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
||||||
hass.data[DATA_DEVICE_REGISTER][EVENT_KEY_COMMAND] = add_new_device
|
hass.data[DATA_DEVICE_REGISTER][EVENT_KEY_COMMAND] = add_new_device
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-many-ancestors
|
|
||||||
class RflinkLight(SwitchableRflinkDevice, Light):
|
class RflinkLight(SwitchableRflinkDevice, Light):
|
||||||
"""Representation of a Rflink light."""
|
"""Representation of a Rflink light."""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-many-ancestors
|
|
||||||
class DimmableRflinkLight(SwitchableRflinkDevice, Light):
|
class DimmableRflinkLight(SwitchableRflinkDevice, Light):
|
||||||
"""Rflink light device that support dimming."""
|
"""Rflink light device that support dimming."""
|
||||||
|
|
||||||
|
@ -212,7 +210,6 @@ class DimmableRflinkLight(SwitchableRflinkDevice, Light):
|
||||||
return SUPPORT_BRIGHTNESS
|
return SUPPORT_BRIGHTNESS
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-many-ancestors
|
|
||||||
class HybridRflinkLight(SwitchableRflinkDevice, Light):
|
class HybridRflinkLight(SwitchableRflinkDevice, Light):
|
||||||
"""Rflink light device that sends out both dim and on/off commands.
|
"""Rflink light device that sends out both dim and on/off commands.
|
||||||
|
|
||||||
|
@ -276,7 +273,6 @@ class HybridRflinkLight(SwitchableRflinkDevice, Light):
|
||||||
return SUPPORT_BRIGHTNESS
|
return SUPPORT_BRIGHTNESS
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-many-ancestors
|
|
||||||
class ToggleRflinkLight(SwitchableRflinkDevice, Light):
|
class ToggleRflinkLight(SwitchableRflinkDevice, Light):
|
||||||
"""Rflink light device which sends out only 'on' commands.
|
"""Rflink light device which sends out only 'on' commands.
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,6 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
||||||
async_add_entities(devices_from_config(config))
|
async_add_entities(devices_from_config(config))
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-many-ancestors
|
|
||||||
class RflinkSwitch(SwitchableRflinkDevice, SwitchDevice):
|
class RflinkSwitch(SwitchableRflinkDevice, SwitchDevice):
|
||||||
"""Representation of a Rflink switch."""
|
"""Representation of a Rflink switch."""
|
||||||
|
|
||||||
|
|
|
@ -12,10 +12,7 @@ if TYPE_CHECKING:
|
||||||
from .connection import ActiveConnection # noqa
|
from .connection import ActiveConnection # noqa
|
||||||
|
|
||||||
|
|
||||||
WebSocketCommandHandler = Callable[
|
WebSocketCommandHandler = Callable[[HomeAssistant, "ActiveConnection", dict], None]
|
||||||
[HomeAssistant, "ActiveConnection", dict], None
|
|
||||||
] # pylint: disable=invalid-name
|
|
||||||
|
|
||||||
|
|
||||||
DOMAIN = "websocket_api"
|
DOMAIN = "websocket_api"
|
||||||
URL = "/api/websocket"
|
URL = "/api/websocket"
|
||||||
|
|
|
@ -30,7 +30,6 @@ if TYPE_CHECKING:
|
||||||
import homeassistant.components.zha.entity
|
import homeassistant.components.zha.entity
|
||||||
import homeassistant.components.zha.core.channels
|
import homeassistant.components.zha.core.channels
|
||||||
|
|
||||||
# pylint: disable=invalid-name
|
|
||||||
ChannelType = base_channels.ZigbeeChannel
|
ChannelType = base_channels.ZigbeeChannel
|
||||||
ChannelsType = channels.Channels
|
ChannelsType = channels.Channels
|
||||||
ChannelPoolType = channels.ChannelPool
|
ChannelPoolType = channels.ChannelPool
|
||||||
|
|
|
@ -35,7 +35,7 @@ ChangeListener = Callable[
|
||||||
Optional[dict],
|
Optional[dict],
|
||||||
],
|
],
|
||||||
Awaitable[None],
|
Awaitable[None],
|
||||||
] # pylint: disable=invalid-name
|
]
|
||||||
|
|
||||||
|
|
||||||
class CollectionError(HomeAssistantError):
|
class CollectionError(HomeAssistantError):
|
||||||
|
|
|
@ -41,7 +41,6 @@ def clear_secret_cache() -> None:
|
||||||
__SECRET_CACHE.clear()
|
__SECRET_CACHE.clear()
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-many-ancestors
|
|
||||||
class SafeLineLoader(yaml.SafeLoader):
|
class SafeLineLoader(yaml.SafeLoader):
|
||||||
"""Loader class that keeps track of line numbers."""
|
"""Loader class that keeps track of line numbers."""
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue