mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Update flake8 to 3.7.5 (#20761)
* Upgrade flake8 * Upgrade flake8 * Add noqa for hound
This commit is contained in:
parent
2733919cd8
commit
ef6b0b8e0b
@ -323,6 +323,7 @@ class CastDevice(MediaPlayerDevice):
|
||||
|
||||
def __init__(self, cast_info):
|
||||
"""Initialize the cast device."""
|
||||
import pychromecast # noqa: pylint: disable=unused-import
|
||||
self._cast_info = cast_info # type: ChromecastInfo
|
||||
self._chromecast = None # type: Optional[pychromecast.Chromecast]
|
||||
self.cast_status = None
|
||||
|
@ -45,6 +45,8 @@ class BboxDeviceScanner(DeviceScanner):
|
||||
|
||||
def __init__(self, config):
|
||||
"""Get host from config."""
|
||||
from typing import List # noqa: pylint: disable=unused-import
|
||||
|
||||
self.host = config[CONF_HOST]
|
||||
|
||||
"""Initialize the scanner."""
|
||||
|
@ -4,7 +4,7 @@
|
||||
asynctest==0.12.2
|
||||
coveralls==1.2.0
|
||||
flake8-docstrings==1.3.0
|
||||
flake8==3.6.0
|
||||
flake8==3.7.5
|
||||
mock-open==1.3.1
|
||||
mypy==0.650
|
||||
pydocstyle==3.0.0
|
||||
|
@ -5,7 +5,7 @@
|
||||
asynctest==0.12.2
|
||||
coveralls==1.2.0
|
||||
flake8-docstrings==1.3.0
|
||||
flake8==3.6.0
|
||||
flake8==3.7.5
|
||||
mock-open==1.3.1
|
||||
mypy==0.650
|
||||
pydocstyle==3.0.0
|
||||
|
@ -82,7 +82,7 @@ def test_default_setup(hass, mock_connection_factory):
|
||||
# ensure entities have new state value after incoming telegram
|
||||
power_consumption = hass.states.get('sensor.power_consumption')
|
||||
assert power_consumption.state == '0.0'
|
||||
assert power_consumption.attributes.get('unit_of_measurement') is 'kWh'
|
||||
assert power_consumption.attributes.get('unit_of_measurement') == 'kWh'
|
||||
|
||||
# tariff should be translated in human readable and have no unit
|
||||
power_tariff = hass.states.get('sensor.power_tariff')
|
||||
|
@ -214,7 +214,7 @@ async def test_node_discovery(hass, mock_openzwave):
|
||||
hass.async_add_job(mock_receivers[0], node)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert hass.states.get('zwave.mock_node').state is 'unknown'
|
||||
assert hass.states.get('zwave.mock_node').state == 'unknown'
|
||||
|
||||
|
||||
async def test_unparsed_node_discovery(hass, mock_openzwave):
|
||||
@ -257,7 +257,7 @@ async def test_unparsed_node_discovery(hass, mock_openzwave):
|
||||
assert len(mock_logger.warning.mock_calls) == 1
|
||||
assert mock_logger.warning.mock_calls[0][1][1:] == \
|
||||
(14, const.NODE_READY_WAIT_SECS)
|
||||
assert hass.states.get('zwave.unknown_node_14').state is 'unknown'
|
||||
assert hass.states.get('zwave.unknown_node_14').state == 'unknown'
|
||||
|
||||
|
||||
async def test_node_ignored(hass, mock_openzwave):
|
||||
@ -307,7 +307,7 @@ async def test_value_discovery(hass, mock_openzwave):
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert hass.states.get(
|
||||
'binary_sensor.mock_node_mock_value').state is 'off'
|
||||
'binary_sensor.mock_node_mock_value').state == 'off'
|
||||
|
||||
|
||||
async def test_value_discovery_existing_entity(hass, mock_openzwave):
|
||||
|
Loading…
x
Reference in New Issue
Block a user