Bump black to 19.10b0 (#28310)
parent
5b96704c4a
commit
04ab20846a
|
@ -1,6 +1,6 @@
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
rev: 19.3b0
|
rev: 19.10b0
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
args:
|
args:
|
||||||
|
|
|
@ -215,7 +215,11 @@ class TotpSetupFlow(SetupFlow):
|
||||||
|
|
||||||
else:
|
else:
|
||||||
hass = self._auth_module.hass
|
hass = self._auth_module.hass
|
||||||
self._ota_secret, self._url, self._image = await hass.async_add_executor_job(
|
(
|
||||||
|
self._ota_secret,
|
||||||
|
self._url,
|
||||||
|
self._image,
|
||||||
|
) = await hass.async_add_executor_job(
|
||||||
_generate_secret_and_qr_code, # type: ignore
|
_generate_secret_and_qr_code, # type: ignore
|
||||||
str(self._user.name),
|
str(self._user.name),
|
||||||
)
|
)
|
||||||
|
|
|
@ -455,9 +455,13 @@ class AndroidTVDevice(ADBDevice):
|
||||||
return
|
return
|
||||||
|
|
||||||
# Get the updated state and attributes.
|
# Get the updated state and attributes.
|
||||||
state, self._current_app, self._device, self._is_volume_muted, self._volume_level = (
|
(
|
||||||
self.aftv.update()
|
state,
|
||||||
)
|
self._current_app,
|
||||||
|
self._device,
|
||||||
|
self._is_volume_muted,
|
||||||
|
self._volume_level,
|
||||||
|
) = self.aftv.update()
|
||||||
|
|
||||||
self._state = ANDROIDTV_STATES.get(state)
|
self._state = ANDROIDTV_STATES.get(state)
|
||||||
if self._state is None:
|
if self._state is None:
|
||||||
|
|
|
@ -172,14 +172,18 @@ class EnvirophatData:
|
||||||
self.envirophat.leds.off()
|
self.envirophat.leds.off()
|
||||||
|
|
||||||
# accelerometer readings in G
|
# accelerometer readings in G
|
||||||
self.accelerometer_x, self.accelerometer_y, self.accelerometer_z = (
|
(
|
||||||
self.envirophat.motion.accelerometer()
|
self.accelerometer_x,
|
||||||
)
|
self.accelerometer_y,
|
||||||
|
self.accelerometer_z,
|
||||||
|
) = self.envirophat.motion.accelerometer()
|
||||||
|
|
||||||
# raw magnetometer reading
|
# raw magnetometer reading
|
||||||
self.magnetometer_x, self.magnetometer_y, self.magnetometer_z = (
|
(
|
||||||
self.envirophat.motion.magnetometer()
|
self.magnetometer_x,
|
||||||
)
|
self.magnetometer_y,
|
||||||
|
self.magnetometer_z,
|
||||||
|
) = self.envirophat.motion.magnetometer()
|
||||||
|
|
||||||
# temperature resolution of BMP280 sensor: 0.01°C
|
# temperature resolution of BMP280 sensor: 0.01°C
|
||||||
self.temperature = round(self.envirophat.weather.temperature(), 2)
|
self.temperature = round(self.envirophat.weather.temperature(), 2)
|
||||||
|
@ -189,6 +193,9 @@ class EnvirophatData:
|
||||||
self.pressure = round(self.envirophat.weather.pressure() / 100.0, 3)
|
self.pressure = round(self.envirophat.weather.pressure() / 100.0, 3)
|
||||||
|
|
||||||
# Voltage sensor, reading between 0-3.3V
|
# Voltage sensor, reading between 0-3.3V
|
||||||
self.voltage_0, self.voltage_1, self.voltage_2, self.voltage_3 = (
|
(
|
||||||
self.envirophat.analog.read_all()
|
self.voltage_0,
|
||||||
)
|
self.voltage_1,
|
||||||
|
self.voltage_2,
|
||||||
|
self.voltage_3,
|
||||||
|
) = self.envirophat.analog.read_all()
|
||||||
|
|
|
@ -308,9 +308,10 @@ class HangoutsBot:
|
||||||
async def _async_list_conversations(self):
|
async def _async_list_conversations(self):
|
||||||
import hangups
|
import hangups
|
||||||
|
|
||||||
self._user_list, self._conversation_list = await hangups.build_user_conversation_list(
|
(
|
||||||
self._client
|
self._user_list,
|
||||||
)
|
self._conversation_list,
|
||||||
|
) = await hangups.build_user_conversation_list(self._client)
|
||||||
conversations = {}
|
conversations = {}
|
||||||
for i, conv in enumerate(self._conversation_list.get_all()):
|
for i, conv in enumerate(self._conversation_list.get_all()):
|
||||||
users_in_conversation = []
|
users_in_conversation = []
|
||||||
|
|
|
@ -237,7 +237,7 @@ class HERETravelTimeSensor(Entity):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(
|
def device_state_attributes(
|
||||||
self
|
self,
|
||||||
) -> Optional[Dict[str, Union[None, float, str, bool]]]:
|
) -> Optional[Dict[str, Union[None, float, str, bool]]]:
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
if self._here_data.base_time is None:
|
if self._here_data.base_time is None:
|
||||||
|
|
|
@ -64,7 +64,7 @@ def manifest_from_legacy_module(domain: str, module: ModuleType) -> Dict:
|
||||||
|
|
||||||
|
|
||||||
async def _async_get_custom_components(
|
async def _async_get_custom_components(
|
||||||
hass: "HomeAssistant"
|
hass: "HomeAssistant",
|
||||||
) -> Dict[str, "Integration"]:
|
) -> Dict[str, "Integration"]:
|
||||||
"""Return list of custom integrations."""
|
"""Return list of custom integrations."""
|
||||||
try:
|
try:
|
||||||
|
@ -102,7 +102,7 @@ async def _async_get_custom_components(
|
||||||
|
|
||||||
|
|
||||||
async def async_get_custom_components(
|
async def async_get_custom_components(
|
||||||
hass: "HomeAssistant"
|
hass: "HomeAssistant",
|
||||||
) -> Dict[str, "Integration"]:
|
) -> Dict[str, "Integration"]:
|
||||||
"""Return cached list of custom integrations."""
|
"""Return cached list of custom integrations."""
|
||||||
reg_or_evt = hass.data.get(DATA_CUSTOM_COMPONENTS)
|
reg_or_evt = hass.data.get(DATA_CUSTOM_COMPONENTS)
|
||||||
|
|
|
@ -441,7 +441,7 @@ def color_temperature_to_hs(color_temperature_kelvin: float) -> Tuple[float, flo
|
||||||
|
|
||||||
|
|
||||||
def color_temperature_to_rgb(
|
def color_temperature_to_rgb(
|
||||||
color_temperature_kelvin: float
|
color_temperature_kelvin: float,
|
||||||
) -> Tuple[float, float, float]:
|
) -> Tuple[float, float, float]:
|
||||||
"""
|
"""
|
||||||
Return an RGB color from a color temperature in Kelvin.
|
Return an RGB color from a color temperature in Kelvin.
|
||||||
|
|
|
@ -46,7 +46,7 @@ LocationInfo = collections.namedtuple(
|
||||||
|
|
||||||
|
|
||||||
async def async_detect_location_info(
|
async def async_detect_location_info(
|
||||||
session: aiohttp.ClientSession
|
session: aiohttp.ClientSession,
|
||||||
) -> Optional[LocationInfo]:
|
) -> Optional[LocationInfo]:
|
||||||
"""Detect location information."""
|
"""Detect location information."""
|
||||||
data = await _get_ipapi(session)
|
data = await _get_ipapi(session)
|
||||||
|
|
|
@ -225,7 +225,7 @@ def _ordered_dict(loader: SafeLineLoader, node: yaml.nodes.MappingNode) -> Order
|
||||||
|
|
||||||
def _construct_seq(loader: SafeLineLoader, node: yaml.nodes.Node) -> JSON_TYPE:
|
def _construct_seq(loader: SafeLineLoader, node: yaml.nodes.Node) -> JSON_TYPE:
|
||||||
"""Add line number and file name to Load YAML sequence."""
|
"""Add line number and file name to Load YAML sequence."""
|
||||||
obj, = loader.construct_yaml_seq(node)
|
(obj,) = loader.construct_yaml_seq(node)
|
||||||
return _add_reference(obj, loader, node)
|
return _add_reference(obj, loader, node)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
# When updating this file, update .pre-commit-config.yaml too
|
# When updating this file, update .pre-commit-config.yaml too
|
||||||
asynctest==0.13.0
|
asynctest==0.13.0
|
||||||
black==19.3b0
|
black==19.10b0
|
||||||
codecov==2.0.15
|
codecov==2.0.15
|
||||||
flake8-docstrings==1.5.0
|
flake8-docstrings==1.5.0
|
||||||
flake8==3.7.8
|
flake8==3.7.8
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
# When updating this file, update .pre-commit-config.yaml too
|
# When updating this file, update .pre-commit-config.yaml too
|
||||||
asynctest==0.13.0
|
asynctest==0.13.0
|
||||||
black==19.3b0
|
black==19.10b0
|
||||||
codecov==2.0.15
|
codecov==2.0.15
|
||||||
flake8-docstrings==1.5.0
|
flake8-docstrings==1.5.0
|
||||||
flake8==3.7.8
|
flake8==3.7.8
|
||||||
|
|
|
@ -131,7 +131,7 @@ async def test_import_flow_triggered_but_no_ecobee_conf(hass):
|
||||||
|
|
||||||
|
|
||||||
async def test_import_flow_triggered_with_ecobee_conf_and_valid_data_and_valid_tokens(
|
async def test_import_flow_triggered_with_ecobee_conf_and_valid_data_and_valid_tokens(
|
||||||
hass
|
hass,
|
||||||
):
|
):
|
||||||
"""Test expected result if import flow triggers and ecobee.conf exists with valid tokens."""
|
"""Test expected result if import flow triggers and ecobee.conf exists with valid tokens."""
|
||||||
flow = config_flow.EcobeeFlowHandler()
|
flow = config_flow.EcobeeFlowHandler()
|
||||||
|
@ -181,7 +181,7 @@ async def test_import_flow_triggered_with_ecobee_conf_and_invalid_data(hass):
|
||||||
|
|
||||||
|
|
||||||
async def test_import_flow_triggered_with_ecobee_conf_and_valid_data_and_stale_tokens(
|
async def test_import_flow_triggered_with_ecobee_conf_and_valid_data_and_stale_tokens(
|
||||||
hass
|
hass,
|
||||||
):
|
):
|
||||||
"""Test expected result if import flow triggers and ecobee.conf exists with stale tokens."""
|
"""Test expected result if import flow triggers and ecobee.conf exists with stale tokens."""
|
||||||
flow = config_flow.EcobeeFlowHandler()
|
flow = config_flow.EcobeeFlowHandler()
|
||||||
|
|
|
@ -75,7 +75,7 @@ async def test_data_manager_call(data_manager: WithingsDataManager) -> None:
|
||||||
|
|
||||||
|
|
||||||
async def test_data_manager_call_throttle_enabled(
|
async def test_data_manager_call_throttle_enabled(
|
||||||
data_manager: WithingsDataManager
|
data_manager: WithingsDataManager,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test method."""
|
"""Test method."""
|
||||||
hello_func = MagicMock(return_value="HELLO2")
|
hello_func = MagicMock(return_value="HELLO2")
|
||||||
|
@ -90,7 +90,7 @@ async def test_data_manager_call_throttle_enabled(
|
||||||
|
|
||||||
|
|
||||||
async def test_data_manager_call_throttle_disabled(
|
async def test_data_manager_call_throttle_disabled(
|
||||||
data_manager: WithingsDataManager
|
data_manager: WithingsDataManager,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test method."""
|
"""Test method."""
|
||||||
hello_func = MagicMock(return_value="HELLO2")
|
hello_func = MagicMock(return_value="HELLO2")
|
||||||
|
|
|
@ -130,17 +130,17 @@ def test_roller_commands(hass, mock_openzwave):
|
||||||
|
|
||||||
device.open_cover()
|
device.open_cover()
|
||||||
assert mock_network.manager.pressButton.called
|
assert mock_network.manager.pressButton.called
|
||||||
value_id, = mock_network.manager.pressButton.mock_calls.pop(0)[1]
|
(value_id,) = mock_network.manager.pressButton.mock_calls.pop(0)[1]
|
||||||
assert value_id == open_value.value_id
|
assert value_id == open_value.value_id
|
||||||
|
|
||||||
device.close_cover()
|
device.close_cover()
|
||||||
assert mock_network.manager.pressButton.called
|
assert mock_network.manager.pressButton.called
|
||||||
value_id, = mock_network.manager.pressButton.mock_calls.pop(0)[1]
|
(value_id,) = mock_network.manager.pressButton.mock_calls.pop(0)[1]
|
||||||
assert value_id == close_value.value_id
|
assert value_id == close_value.value_id
|
||||||
|
|
||||||
device.stop_cover()
|
device.stop_cover()
|
||||||
assert mock_network.manager.releaseButton.called
|
assert mock_network.manager.releaseButton.called
|
||||||
value_id, = mock_network.manager.releaseButton.mock_calls.pop(0)[1]
|
(value_id,) = mock_network.manager.releaseButton.mock_calls.pop(0)[1]
|
||||||
assert value_id == open_value.value_id
|
assert value_id == open_value.value_id
|
||||||
|
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ def test_roller_invert_percent(hass, mock_openzwave):
|
||||||
|
|
||||||
device.open_cover()
|
device.open_cover()
|
||||||
assert mock_network.manager.pressButton.called
|
assert mock_network.manager.pressButton.called
|
||||||
value_id, = mock_network.manager.pressButton.mock_calls.pop(0)[1]
|
(value_id,) = mock_network.manager.pressButton.mock_calls.pop(0)[1]
|
||||||
assert value_id == open_value.value_id
|
assert value_id == open_value.value_id
|
||||||
|
|
||||||
|
|
||||||
|
@ -193,17 +193,17 @@ def test_roller_reverse_open_close(hass, mock_openzwave):
|
||||||
|
|
||||||
device.open_cover()
|
device.open_cover()
|
||||||
assert mock_network.manager.pressButton.called
|
assert mock_network.manager.pressButton.called
|
||||||
value_id, = mock_network.manager.pressButton.mock_calls.pop(0)[1]
|
(value_id,) = mock_network.manager.pressButton.mock_calls.pop(0)[1]
|
||||||
assert value_id == close_value.value_id
|
assert value_id == close_value.value_id
|
||||||
|
|
||||||
device.close_cover()
|
device.close_cover()
|
||||||
assert mock_network.manager.pressButton.called
|
assert mock_network.manager.pressButton.called
|
||||||
value_id, = mock_network.manager.pressButton.mock_calls.pop(0)[1]
|
(value_id,) = mock_network.manager.pressButton.mock_calls.pop(0)[1]
|
||||||
assert value_id == open_value.value_id
|
assert value_id == open_value.value_id
|
||||||
|
|
||||||
device.stop_cover()
|
device.stop_cover()
|
||||||
assert mock_network.manager.releaseButton.called
|
assert mock_network.manager.releaseButton.called
|
||||||
value_id, = mock_network.manager.releaseButton.mock_calls.pop(0)[1]
|
(value_id,) = mock_network.manager.releaseButton.mock_calls.pop(0)[1]
|
||||||
assert value_id == close_value.value_id
|
assert value_id == close_value.value_id
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1610,10 +1610,10 @@ class TestZWaveServices(unittest.TestCase):
|
||||||
self.hass.block_till_done()
|
self.hass.block_till_done()
|
||||||
|
|
||||||
assert self.zwave_network.manager.pressButton.called
|
assert self.zwave_network.manager.pressButton.called
|
||||||
value_id, = self.zwave_network.manager.pressButton.mock_calls.pop(0)[1]
|
(value_id,) = self.zwave_network.manager.pressButton.mock_calls.pop(0)[1]
|
||||||
assert value_id == reset_value.value_id
|
assert value_id == reset_value.value_id
|
||||||
assert self.zwave_network.manager.releaseButton.called
|
assert self.zwave_network.manager.releaseButton.called
|
||||||
value_id, = self.zwave_network.manager.releaseButton.mock_calls.pop(0)[1]
|
(value_id,) = self.zwave_network.manager.releaseButton.mock_calls.pop(0)[1]
|
||||||
assert value_id == reset_value.value_id
|
assert value_id == reset_value.value_id
|
||||||
|
|
||||||
def test_add_association(self):
|
def test_add_association(self):
|
||||||
|
|
Loading…
Reference in New Issue