diff --git a/homeassistant/components/apcupsd/__init__.py b/homeassistant/components/apcupsd/__init__.py index 01f7416519009678cf308f36f856c6b020d22e58..1f99d5410ec93cd091287997779b432e668e5290 100644 --- a/homeassistant/components/apcupsd/__init__.py +++ b/homeassistant/components/apcupsd/__init__.py @@ -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) diff --git a/homeassistant/components/aquostv/media_player.py b/homeassistant/components/aquostv/media_player.py index f71f41dc2939024b8e868c9cd42129d682fd9c29..5cd13aa3b0e5e172c3cb3c6f7f747eebc03c6a96 100644 --- a/homeassistant/components/aquostv/media_player.py +++ b/homeassistant/components/aquostv/media_player.py @@ -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 diff --git a/homeassistant/components/arduino/__init__.py b/homeassistant/components/arduino/__init__.py index 61b03a3160de667a907d835615db297bf300f90b..76b8c663c94ffd6e9f331e0be735e7d23ce64973 100644 --- a/homeassistant/components/arduino/__init__.py +++ b/homeassistant/components/arduino/__init__.py @@ -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): diff --git a/homeassistant/components/bloomsky/__init__.py b/homeassistant/components/bloomsky/__init__.py index 6373471fe7a6c65e45b78b6d91efb5576aa11a82..5b21a2a62f0613ec1308318082b8429c89d69396 100644 --- a/homeassistant/components/bloomsky/__init__.py +++ b/homeassistant/components/bloomsky/__init__.py @@ -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: diff --git a/homeassistant/components/mochad/__init__.py b/homeassistant/components/mochad/__init__.py index 683681b50a0978317e1ded30da6ee099e7be2798..50156b2b4b3f8c2c05254ff3bf91e511a907a9f5 100644 --- a/homeassistant/components/mochad/__init__.py +++ b/homeassistant/components/mochad/__init__.py @@ -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: diff --git a/homeassistant/components/scsgate/__init__.py b/homeassistant/components/scsgate/__init__.py index 21e3608a51b5de7a7f34f8ceea6535345dcbf5ef..b32b91e562576dc4b53d1acbba21b98f4ae59331 100644 --- a/homeassistant/components/scsgate/__init__.py +++ b/homeassistant/components/scsgate/__init__.py @@ -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) diff --git a/homeassistant/components/sleepiq/__init__.py b/homeassistant/components/sleepiq/__init__.py index 2b4d9d010a3a6b90cf51703ece0196a61f9c9c21..3399fcb43c55a08b4df557200293998823dce780 100644 --- a/homeassistant/components/sleepiq/__init__.py +++ b/homeassistant/components/sleepiq/__init__.py @@ -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] diff --git a/homeassistant/components/verisure/__init__.py b/homeassistant/components/verisure/__init__.py index 32735bf06c13a6d473d49ffd2866e5d6cbadbe26..757e299792acef65832cc9bb2346a3d25815ff5e 100644 --- a/homeassistant/components/verisure/__init__.py +++ b/homeassistant/components/verisure/__init__.py @@ -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 diff --git a/homeassistant/components/zigbee/__init__.py b/homeassistant/components/zigbee/__init__.py index 48c96b7591fa9b79bf8b80b9e1b4a760a4028aa7..fd9b42398fea8aecea1256e7a2f5ac2aeb6fc342 100644 --- a/homeassistant/components/zigbee/__init__.py +++ b/homeassistant/components/zigbee/__init__.py @@ -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 diff --git a/homeassistant/util/dt.py b/homeassistant/util/dt.py index 084888c188cbc48c134f9b12663f87a151508d1f..8efad848e87fadb0fc0877311dd01667cfc39157 100644 --- a/homeassistant/util/dt.py +++ b/homeassistant/util/dt.py @@ -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) diff --git a/homeassistant/util/yaml/loader.py b/homeassistant/util/yaml/loader.py index ba4d1e775763101366125546aba2512f3d1c2a77..3727a156b9744cb253246e8ddf378d2d8794e95d 100644 --- a/homeassistant/util/yaml/loader.py +++ b/homeassistant/util/yaml/loader.py @@ -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 diff --git a/pylintrc b/pylintrc index bb51444447a00f7336ffa16c6a41d721196df4f1..1b08c40793adef5aaac6ffd526d4c5e03a1a27a5 100644 --- a/pylintrc +++ b/pylintrc @@ -34,7 +34,6 @@ disable= abstract-method, cyclic-import, duplicate-code, - global-statement, inconsistent-return-statements, locally-disabled, not-context-manager,