Upgrade flake8 to 3.6.0 (#17770)
* Upgrade flake8 to 3.6.0 * flake8/pylint comment tweaks * flake8 F841 fixes * flake8 W605 fix * Ignore pyflakes bug #373 false positives https://github.com/PyCQA/pyflakes/issues/373 * pycodestyle bug #811 workaround https://github.com/PyCQA/pycodestyle/issues/811pull/17796/head
parent
77bf10e37c
commit
43048962f2
homeassistant
components
cloud
cover
device_tracker
google_assistant
light
mqtt
sensor
zwave
helpers
script
|
@ -144,7 +144,7 @@ def _authenticate(cloud, email, password):
|
|||
cognito.authenticate(password=password)
|
||||
return cognito
|
||||
|
||||
except ForceChangePasswordException as err:
|
||||
except ForceChangePasswordException:
|
||||
raise PasswordChangeRequired
|
||||
|
||||
except ClientError as err:
|
||||
|
|
|
@ -106,7 +106,7 @@ class GaradgetCover(CoverDevice):
|
|||
self._state = STATE_OFFLINE
|
||||
self._available = False
|
||||
self._name = DEFAULT_NAME
|
||||
except KeyError as ex:
|
||||
except KeyError:
|
||||
_LOGGER.warning("Garadget device %(device)s seems to be offline",
|
||||
dict(device=self.device_id))
|
||||
self._name = DEFAULT_NAME
|
||||
|
@ -235,7 +235,7 @@ class GaradgetCover(CoverDevice):
|
|||
_LOGGER.error(
|
||||
"Unable to connect to server: %(reason)s", dict(reason=ex))
|
||||
self._state = STATE_OFFLINE
|
||||
except KeyError as ex:
|
||||
except KeyError:
|
||||
_LOGGER.warning("Garadget device %(device)s seems to be offline",
|
||||
dict(device=self.device_id))
|
||||
self._state = STATE_OFFLINE
|
||||
|
|
|
@ -699,8 +699,8 @@ def async_setup_scanner_platform(hass: HomeAssistantType, config: ConfigType,
|
|||
seen.add(mac)
|
||||
|
||||
try:
|
||||
extra_attributes = (await
|
||||
scanner.async_get_extra_attributes(mac))
|
||||
extra_attributes = \
|
||||
await scanner.async_get_extra_attributes(mac)
|
||||
except NotImplementedError:
|
||||
extra_attributes = dict()
|
||||
|
||||
|
|
|
@ -254,7 +254,7 @@ class Tplink3DeviceScanner(Tplink1DeviceScanner):
|
|||
self.sysauth = regex_result.group(1)
|
||||
_LOGGER.info(self.sysauth)
|
||||
return True
|
||||
except (ValueError, KeyError) as _:
|
||||
except (ValueError, KeyError):
|
||||
_LOGGER.error("Couldn't fetch auth tokens! Response was: %s",
|
||||
response.text)
|
||||
return False
|
||||
|
|
|
@ -213,7 +213,7 @@ async def _process(hass, config, message):
|
|||
'requestId': request_id,
|
||||
'payload': {'errorCode': err.code}
|
||||
}
|
||||
except Exception as err: # pylint: disable=broad-except
|
||||
except Exception: # pylint: disable=broad-except
|
||||
_LOGGER.exception('Unexpected error')
|
||||
return {
|
||||
'requestId': request_id,
|
||||
|
|
|
@ -56,7 +56,8 @@ def brightness_from_percentage(percent):
|
|||
class TPLinkSmartBulb(Light):
|
||||
"""Representation of a TPLink Smart Bulb."""
|
||||
|
||||
def __init__(self, smartbulb: 'SmartBulb', name) -> None:
|
||||
# F821: https://github.com/PyCQA/pyflakes/issues/373
|
||||
def __init__(self, smartbulb: 'SmartBulb', name) -> None: # noqa: F821
|
||||
"""Initialize the bulb."""
|
||||
self.smartbulb = smartbulb
|
||||
self._name = name
|
||||
|
|
|
@ -278,8 +278,9 @@ class YeelightLight(Light):
|
|||
def _properties(self) -> dict:
|
||||
return self._bulb.last_properties
|
||||
|
||||
# F821: https://github.com/PyCQA/pyflakes/issues/373
|
||||
@property
|
||||
def _bulb(self) -> 'yeelight.Bulb':
|
||||
def _bulb(self) -> 'yeelight.Bulb': # noqa: F821
|
||||
import yeelight
|
||||
if self._bulb_device is None:
|
||||
try:
|
||||
|
|
|
@ -35,7 +35,7 @@ from homeassistant.util.async_ import (
|
|||
run_callback_threadsafe, run_coroutine_threadsafe)
|
||||
|
||||
# Loading the config flow file will register the flow
|
||||
from . import config_flow # noqa # pylint: disable=unused-import
|
||||
from . import config_flow # noqa pylint: disable=unused-import
|
||||
from .const import CONF_BROKER, CONF_DISCOVERY, DEFAULT_DISCOVERY
|
||||
from .server import HBMQTT_CONFIG_SCHEMA
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ class TcpSensor(Entity):
|
|||
self._state = self._config[CONF_VALUE_TEMPLATE].render(
|
||||
value=value)
|
||||
return
|
||||
except TemplateError as err:
|
||||
except TemplateError:
|
||||
_LOGGER.error(
|
||||
"Unable to render template of %r with value: %r",
|
||||
self._config[CONF_VALUE_TEMPLATE], value)
|
||||
|
|
|
@ -142,7 +142,7 @@ async def async_setup(hass, config):
|
|||
hass, DOMAIN, intent_type, slots, request['input'])
|
||||
if 'plain' in intent_response.speech:
|
||||
snips_response = intent_response.speech['plain']['speech']
|
||||
except intent.UnknownIntent as err:
|
||||
except intent.UnknownIntent:
|
||||
_LOGGER.warning("Received unknown intent %s",
|
||||
request['intent']['intentName'])
|
||||
except intent.IntentError:
|
||||
|
|
|
@ -29,7 +29,7 @@ from homeassistant.helpers.dispatcher import (
|
|||
async_dispatcher_connect, async_dispatcher_send)
|
||||
|
||||
from . import const
|
||||
from . import config_flow # noqa # pylint: disable=unused-import
|
||||
from . import config_flow # noqa pylint: disable=unused-import
|
||||
from .const import (
|
||||
CONF_AUTOHEAL, CONF_DEBUG, CONF_POLLING_INTERVAL,
|
||||
CONF_USB_STICK_PATH, CONF_CONFIG_PATH, CONF_NETWORK_KEY,
|
||||
|
|
|
@ -56,7 +56,7 @@ async def async_call_from_config(hass, config, blocking=False, variables=None,
|
|||
except TemplateError as ex:
|
||||
_LOGGER.error('Error rendering service name template: %s', ex)
|
||||
return
|
||||
except vol.Invalid as ex:
|
||||
except vol.Invalid:
|
||||
_LOGGER.error('Template rendered invalid service: %s',
|
||||
domain_service)
|
||||
return
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
asynctest==0.12.2
|
||||
coveralls==1.2.0
|
||||
flake8-docstrings==1.3.0
|
||||
flake8==3.5
|
||||
flake8==3.6.0
|
||||
mock-open==1.3.1
|
||||
mypy==0.641
|
||||
pydocstyle==2.1.1
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
asynctest==0.12.2
|
||||
coveralls==1.2.0
|
||||
flake8-docstrings==1.3.0
|
||||
flake8==3.5
|
||||
flake8==3.6.0
|
||||
mock-open==1.3.1
|
||||
mypy==0.641
|
||||
pydocstyle==2.1.1
|
||||
|
|
|
@ -90,7 +90,7 @@ TEST_REQUIREMENTS = (
|
|||
'pyspcwebgw',
|
||||
'python-forecastio',
|
||||
'python-nest',
|
||||
'pytradfri\[async\]',
|
||||
'pytradfri\\[async\\]',
|
||||
'pyunifi',
|
||||
'pyupnp-async',
|
||||
'pywebpush',
|
||||
|
|
Loading…
Reference in New Issue