Enable pylint global-statement (#33641)
This commit is contained in:
parent
187b6525b4
commit
71a47fc80c
12 changed files with 19 additions and 20 deletions
|
@ -39,7 +39,7 @@ CONFIG_SCHEMA = vol.Schema(
|
|||
|
||||
def setup(hass, config):
|
||||
"""Use config values to set up a function enabling status retrieval."""
|
||||
global DATA
|
||||
global DATA # pylint: disable=global-statement
|
||||
conf = config[DOMAIN]
|
||||
host = conf.get(CONF_HOST)
|
||||
port = conf.get(CONF_PORT)
|
||||
|
|
|
@ -126,7 +126,7 @@ class SharpAquosTVDevice(MediaPlayerDevice):
|
|||
|
||||
def __init__(self, name, remote, power_on_enabled=False):
|
||||
"""Initialize the aquos device."""
|
||||
global SUPPORT_SHARPTV
|
||||
global SUPPORT_SHARPTV # pylint: disable=global-statement
|
||||
self._power_on_enabled = power_on_enabled
|
||||
if self._power_on_enabled:
|
||||
SUPPORT_SHARPTV = SUPPORT_SHARPTV | SUPPORT_TURN_ON
|
||||
|
|
|
@ -28,7 +28,7 @@ def setup(hass, config):
|
|||
|
||||
port = config[DOMAIN][CONF_PORT]
|
||||
|
||||
global BOARD
|
||||
global BOARD # pylint: disable=global-statement
|
||||
try:
|
||||
BOARD = ArduinoBoard(port)
|
||||
except (serial.serialutil.SerialException, FileNotFoundError):
|
||||
|
|
|
@ -31,7 +31,7 @@ def setup(hass, config):
|
|||
"""Set up the BloomSky component."""
|
||||
api_key = config[DOMAIN][CONF_API_KEY]
|
||||
|
||||
global BLOOMSKY
|
||||
global BLOOMSKY # pylint: disable=global-statement
|
||||
try:
|
||||
BLOOMSKY = BloomSky(api_key, hass.config.units.is_metric)
|
||||
except RuntimeError:
|
||||
|
|
|
@ -42,7 +42,7 @@ def setup(hass, config):
|
|||
host = conf.get(CONF_HOST)
|
||||
port = conf.get(CONF_PORT)
|
||||
|
||||
global CONTROLLER
|
||||
global CONTROLLER # pylint: disable=global-statement
|
||||
try:
|
||||
CONTROLLER = MochadCtrl(host, port)
|
||||
except exceptions.ConfigurationError:
|
||||
|
|
|
@ -34,7 +34,7 @@ SCSGATE_SCHEMA = vol.Schema(
|
|||
def setup(hass, config):
|
||||
"""Set up the SCSGate component."""
|
||||
device = config[DOMAIN][CONF_DEVICE]
|
||||
global SCSGATE
|
||||
global SCSGATE # pylint: disable=global-statement
|
||||
|
||||
try:
|
||||
SCSGATE = SCSGate(device=device, logger=_LOGGER)
|
||||
|
|
|
@ -46,7 +46,7 @@ def setup(hass, config):
|
|||
Will automatically load sensor components to support
|
||||
devices discovered on the account.
|
||||
"""
|
||||
global DATA
|
||||
global DATA # pylint: disable=global-statement
|
||||
|
||||
username = config[DOMAIN][CONF_USERNAME]
|
||||
password = config[DOMAIN][CONF_PASSWORD]
|
||||
|
|
|
@ -75,7 +75,7 @@ DEVICE_SERIAL_SCHEMA = vol.Schema({vol.Required(ATTR_DEVICE_SERIAL): cv.string})
|
|||
|
||||
def setup(hass, config):
|
||||
"""Set up the Verisure component."""
|
||||
global HUB
|
||||
global HUB # pylint: disable=global-statement
|
||||
HUB = VerisureHub(config[DOMAIN])
|
||||
HUB.update_overview = Throttle(config[DOMAIN][CONF_SCAN_INTERVAL])(
|
||||
HUB.update_overview
|
||||
|
|
|
@ -71,15 +71,15 @@ PLATFORM_SCHEMA = vol.Schema(
|
|||
|
||||
def setup(hass, config):
|
||||
"""Set up the connection to the Zigbee device."""
|
||||
global DEVICE
|
||||
global GPIO_DIGITAL_OUTPUT_LOW
|
||||
global GPIO_DIGITAL_OUTPUT_HIGH
|
||||
global ADC_PERCENTAGE
|
||||
global DIGITAL_PINS
|
||||
global ANALOG_PINS
|
||||
global CONVERT_ADC
|
||||
global ZIGBEE_EXCEPTION
|
||||
global ZIGBEE_TX_FAILURE
|
||||
global DEVICE # pylint: disable=global-statement
|
||||
global GPIO_DIGITAL_OUTPUT_LOW # pylint: disable=global-statement
|
||||
global GPIO_DIGITAL_OUTPUT_HIGH # pylint: disable=global-statement
|
||||
global ADC_PERCENTAGE # pylint: disable=global-statement
|
||||
global DIGITAL_PINS # pylint: disable=global-statement
|
||||
global ANALOG_PINS # pylint: disable=global-statement
|
||||
global CONVERT_ADC # pylint: disable=global-statement
|
||||
global ZIGBEE_EXCEPTION # pylint: disable=global-statement
|
||||
global ZIGBEE_TX_FAILURE # pylint: disable=global-statement
|
||||
|
||||
GPIO_DIGITAL_OUTPUT_LOW = xb_const.GPIO_DIGITAL_OUTPUT_LOW
|
||||
GPIO_DIGITAL_OUTPUT_HIGH = xb_const.GPIO_DIGITAL_OUTPUT_HIGH
|
||||
|
|
|
@ -31,7 +31,7 @@ def set_default_time_zone(time_zone: dt.tzinfo) -> None:
|
|||
|
||||
Async friendly.
|
||||
"""
|
||||
global DEFAULT_TIME_ZONE
|
||||
global DEFAULT_TIME_ZONE # pylint: disable=global-statement
|
||||
|
||||
# NOTE: Remove in the future in favour of typing
|
||||
assert isinstance(time_zone, dt.tzinfo)
|
||||
|
|
|
@ -295,7 +295,7 @@ def secret_yaml(loader: SafeLineLoader, node: yaml.nodes.Node) -> JSON_TYPE:
|
|||
_LOGGER.debug("Secret %s retrieved from keyring", node.value)
|
||||
return pwd
|
||||
|
||||
global credstash # pylint: disable=invalid-name
|
||||
global credstash # pylint: disable=invalid-name, global-statement
|
||||
|
||||
if credstash:
|
||||
# pylint: disable=no-member
|
||||
|
|
1
pylintrc
1
pylintrc
|
@ -34,7 +34,6 @@ disable=
|
|||
abstract-method,
|
||||
cyclic-import,
|
||||
duplicate-code,
|
||||
global-statement,
|
||||
inconsistent-return-statements,
|
||||
locally-disabled,
|
||||
not-context-manager,
|
||||
|
|
Loading…
Add table
Reference in a new issue