mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 08:47:57 +00:00
Upgrade pylint to 2.12.1 (#60375)
This commit is contained in:
parent
dab2b17a17
commit
25f8d4a189
@ -211,7 +211,7 @@ class Alert(ToggleEntity):
|
||||
)
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
def state(self): # pylint: disable=overridden-final-method
|
||||
"""Return the alert status."""
|
||||
if self._firing:
|
||||
if self._ack:
|
||||
|
@ -39,7 +39,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
class BloomSkySensor(BinarySensorEntity):
|
||||
"""Representation of a single binary sensor in a BloomSky device."""
|
||||
|
||||
def __init__(self, bs, device, sensor_name):
|
||||
def __init__(self, bs, device, sensor_name): # pylint: disable=invalid-name
|
||||
"""Initialize a BloomSky binary sensor."""
|
||||
self._bloomsky = bs
|
||||
self._device_id = device["DeviceID"]
|
||||
|
@ -79,7 +79,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
class BloomSkySensor(SensorEntity):
|
||||
"""Representation of a single sensor in a BloomSky device."""
|
||||
|
||||
def __init__(self, bs, device, sensor_name):
|
||||
def __init__(self, bs, device, sensor_name): # pylint: disable=invalid-name
|
||||
"""Initialize a BloomSky sensor."""
|
||||
self._bloomsky = bs
|
||||
self._device_id = device["DeviceID"]
|
||||
|
@ -103,7 +103,7 @@ class DemoLight(LightEntity):
|
||||
state,
|
||||
available=False,
|
||||
brightness=180,
|
||||
ct=None,
|
||||
ct=None, # pylint: disable=invalid-name
|
||||
effect_list=None,
|
||||
effect=None,
|
||||
hs_color=None,
|
||||
|
@ -83,7 +83,6 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
await self.async_set_unique_id(discovery_info[zeroconf.ATTR_PROPERTIES]["SN"])
|
||||
self._abort_if_unique_id_configured()
|
||||
|
||||
# pylint: disable=no-member # https://github.com/PyCQA/pylint/issues/3167
|
||||
self.context[CONF_HOST] = discovery_info[zeroconf.ATTR_HOST]
|
||||
self.context["title_placeholders"] = {
|
||||
PRODUCT: discovery_info[zeroconf.ATTR_PROPERTIES]["Product"],
|
||||
|
@ -62,7 +62,7 @@ _LOGGER = logging.getLogger(__name__)
|
||||
class DhcpServiceInfo(BaseServiceInfo):
|
||||
"""Prepared info from dhcp entries."""
|
||||
|
||||
ip: str # pylint: disable=invalid-name
|
||||
ip: str
|
||||
hostname: str
|
||||
macaddress: str
|
||||
|
||||
|
@ -54,7 +54,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
class DigitalOceanBinarySensor(BinarySensorEntity):
|
||||
"""Representation of a Digital Ocean droplet sensor."""
|
||||
|
||||
def __init__(self, do, droplet_id):
|
||||
def __init__(self, do, droplet_id): # pylint: disable=invalid-name
|
||||
"""Initialize a new Digital Ocean sensor."""
|
||||
self._digital_ocean = do
|
||||
self._droplet_id = droplet_id
|
||||
|
@ -51,7 +51,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
class DigitalOceanSwitch(SwitchEntity):
|
||||
"""Representation of a Digital Ocean droplet switch."""
|
||||
|
||||
def __init__(self, do, droplet_id):
|
||||
def __init__(self, do, droplet_id): # pylint: disable=invalid-name
|
||||
"""Initialize a new Digital Ocean sensor."""
|
||||
self._digital_ocean = do
|
||||
self._droplet_id = droplet_id
|
||||
|
@ -51,7 +51,7 @@ class LinodeBinarySensor(BinarySensorEntity):
|
||||
|
||||
_attr_device_class = DEVICE_CLASS_MOVING
|
||||
|
||||
def __init__(self, li, node_id):
|
||||
def __init__(self, li, node_id): # pylint: disable=invalid-name
|
||||
"""Initialize a new Linode sensor."""
|
||||
self._linode = li
|
||||
self._node_id = node_id
|
||||
|
@ -46,7 +46,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
class LinodeSwitch(SwitchEntity):
|
||||
"""Representation of a Linode Node switch."""
|
||||
|
||||
def __init__(self, li, node_id):
|
||||
def __init__(self, li, node_id): # pylint: disable=invalid-name
|
||||
"""Initialize a new Linode sensor."""
|
||||
self._linode = li
|
||||
self._node_id = node_id
|
||||
|
@ -34,7 +34,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
class LiteJetLight(LightEntity):
|
||||
"""Representation of a single LiteJet light."""
|
||||
|
||||
def __init__(self, config_entry, lj, i, name):
|
||||
def __init__(self, config_entry, lj, i, name): # pylint: disable=invalid-name
|
||||
"""Initialize a LiteJet light."""
|
||||
self._config_entry = config_entry
|
||||
self._lj = lj
|
||||
|
@ -26,7 +26,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
class LiteJetScene(Scene):
|
||||
"""Representation of a single LiteJet scene."""
|
||||
|
||||
def __init__(self, entry_id, lj, i, name):
|
||||
def __init__(self, entry_id, lj, i, name): # pylint: disable=invalid-name
|
||||
"""Initialize the scene."""
|
||||
self._entry_id = entry_id
|
||||
self._lj = lj
|
||||
|
@ -28,7 +28,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
class LiteJetSwitch(SwitchEntity):
|
||||
"""Representation of a single LiteJet switch."""
|
||||
|
||||
def __init__(self, entry_id, lj, i, name):
|
||||
def __init__(self, entry_id, lj, i, name): # pylint: disable=invalid-name
|
||||
"""Initialize a LiteJet switch."""
|
||||
self._entry_id = entry_id
|
||||
self._lj = lj
|
||||
|
@ -94,10 +94,10 @@ class AirSensor(SensorEntity):
|
||||
|
||||
ICON = "mdi:cloud-outline"
|
||||
|
||||
def __init__(self, name, APIdata):
|
||||
def __init__(self, name, api_data):
|
||||
"""Initialize the sensor."""
|
||||
self._name = name
|
||||
self._api_data = APIdata
|
||||
self._api_data = api_data
|
||||
self._site_data = None
|
||||
self._state = None
|
||||
self._updated = None
|
||||
|
@ -41,7 +41,7 @@ def get_service(hass, config, discovery_info=None):
|
||||
class PushBulletNotificationService(BaseNotificationService):
|
||||
"""Implement the notification service for Pushbullet."""
|
||||
|
||||
def __init__(self, pb):
|
||||
def __init__(self, pb): # pylint: disable=invalid-name
|
||||
"""Initialize the service."""
|
||||
self.pushbullet = pb
|
||||
self.pbtargets = {}
|
||||
|
@ -95,7 +95,11 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
class PushBulletNotificationSensor(SensorEntity):
|
||||
"""Representation of a Pushbullet Sensor."""
|
||||
|
||||
def __init__(self, pb, description: SensorEntityDescription):
|
||||
def __init__(
|
||||
self,
|
||||
pb, # pylint: disable=invalid-name
|
||||
description: SensorEntityDescription,
|
||||
):
|
||||
"""Initialize the Pushbullet sensor."""
|
||||
self.entity_description = description
|
||||
self.pushbullet = pb
|
||||
@ -118,10 +122,10 @@ class PushBulletNotificationSensor(SensorEntity):
|
||||
class PushBulletNotificationProvider:
|
||||
"""Provider for an account, leading to one or more sensors."""
|
||||
|
||||
def __init__(self, pb):
|
||||
def __init__(self, pushbullet):
|
||||
"""Start to retrieve pushes from the given Pushbullet instance."""
|
||||
|
||||
self.pushbullet = pb
|
||||
self.pushbullet = pushbullet
|
||||
self._data = None
|
||||
self.listener = None
|
||||
self.thread = threading.Thread(target=self.retrieve_pushes)
|
||||
|
@ -58,12 +58,12 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
class ParticulateMatterSensor(SensorEntity):
|
||||
"""Representation of an Particulate matter sensor."""
|
||||
|
||||
def __init__(self, pmDataCollector, name, pmname):
|
||||
def __init__(self, pm_data_collector, name, pmname):
|
||||
"""Initialize a new PM sensor."""
|
||||
self._name = name
|
||||
self._pmname = pmname
|
||||
self._state = None
|
||||
self._collector = pmDataCollector
|
||||
self._collector = pm_data_collector
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
|
@ -234,7 +234,7 @@ class SpotifyMediaPlayer(MediaPlayerEntity):
|
||||
self,
|
||||
session: OAuth2Session,
|
||||
spotify: Spotify,
|
||||
me: dict,
|
||||
me: dict, # pylint: disable=invalid-name
|
||||
user_id: str,
|
||||
name: str,
|
||||
) -> None:
|
||||
|
@ -1,9 +1,9 @@
|
||||
"""Support for Xiaomi Miio binary sensors."""
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Callable
|
||||
from dataclasses import dataclass
|
||||
import logging
|
||||
from typing import Callable
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DEVICE_CLASS_CONNECTIVITY,
|
||||
|
@ -79,10 +79,10 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
class ZabbixTriggerCountSensor(SensorEntity):
|
||||
"""Get the active trigger count for all Zabbix monitored hosts."""
|
||||
|
||||
def __init__(self, zApi, name="Zabbix"):
|
||||
def __init__(self, zapi, name="Zabbix"):
|
||||
"""Initialize Zabbix sensor."""
|
||||
self._name = name
|
||||
self._zapi = zApi
|
||||
self._zapi = zapi
|
||||
self._state = None
|
||||
self._attributes = {}
|
||||
|
||||
@ -121,9 +121,9 @@ class ZabbixTriggerCountSensor(SensorEntity):
|
||||
class ZabbixSingleHostTriggerCountSensor(ZabbixTriggerCountSensor):
|
||||
"""Get the active trigger count for a single Zabbix monitored host."""
|
||||
|
||||
def __init__(self, zApi, hostid, name=None):
|
||||
def __init__(self, zapi, hostid, name=None):
|
||||
"""Initialize Zabbix sensor."""
|
||||
super().__init__(zApi, name)
|
||||
super().__init__(zapi, name)
|
||||
self._hostid = hostid
|
||||
if not name:
|
||||
self._name = self._zapi.host.get(hostids=self._hostid, output="extend")[0][
|
||||
@ -145,9 +145,9 @@ class ZabbixSingleHostTriggerCountSensor(ZabbixTriggerCountSensor):
|
||||
class ZabbixMultipleHostTriggerCountSensor(ZabbixTriggerCountSensor):
|
||||
"""Get the active trigger count for specified Zabbix monitored hosts."""
|
||||
|
||||
def __init__(self, zApi, hostids, name=None):
|
||||
def __init__(self, zapi, hostids, name=None):
|
||||
"""Initialize Zabbix sensor."""
|
||||
super().__init__(zApi, name)
|
||||
super().__init__(zapi, name)
|
||||
self._hostids = hostids
|
||||
if not name:
|
||||
host_names = self._zapi.host.get(hostids=self._hostids, output="extend")
|
||||
|
@ -56,7 +56,7 @@ from .const import (
|
||||
DOMAIN,
|
||||
)
|
||||
from .discovery_schemas import DISCOVERY_SCHEMAS
|
||||
from .migration import ( # noqa: F401 pylint: disable=unused-import
|
||||
from .migration import ( # noqa: F401
|
||||
async_add_migration_entity_value,
|
||||
async_get_migration_data,
|
||||
async_is_ozw_migrated,
|
||||
|
@ -444,7 +444,6 @@ class FanSpeedDataTemplate:
|
||||
|
||||
Empty lists are not permissible.
|
||||
"""
|
||||
# pylint: disable=no-self-use
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
|
@ -54,6 +54,7 @@ good-names = [
|
||||
"k",
|
||||
"Run",
|
||||
"T",
|
||||
"ip",
|
||||
]
|
||||
|
||||
[tool.pylint."MESSAGES CONTROL"]
|
||||
@ -113,6 +114,7 @@ score = false
|
||||
ignored-classes = [
|
||||
"_CountingAttr", # for attrs
|
||||
]
|
||||
mixin-class-rgx = ".*[Mm]ix[Ii]n"
|
||||
|
||||
[tool.pylint.FORMAT]
|
||||
expected-line-ending-format = "LF"
|
||||
|
@ -14,7 +14,7 @@ jsonpickle==1.4.1
|
||||
mock-open==1.4.0
|
||||
mypy==0.910
|
||||
pre-commit==2.15.0
|
||||
pylint==2.11.1
|
||||
pylint==2.12.1
|
||||
pipdeptree==2.2.0
|
||||
pylint-strict-informational==0.1
|
||||
pytest-aiohttp==0.3.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user