Bump black to 19.10b0 (#28310)
parent
5b96704c4a
commit
04ab20846a
|
@ -1,6 +1,6 @@
|
|||
repos:
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 19.3b0
|
||||
rev: 19.10b0
|
||||
hooks:
|
||||
- id: black
|
||||
args:
|
||||
|
|
|
@ -215,7 +215,11 @@ class TotpSetupFlow(SetupFlow):
|
|||
|
||||
else:
|
||||
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
|
||||
str(self._user.name),
|
||||
)
|
||||
|
|
|
@ -455,9 +455,13 @@ class AndroidTVDevice(ADBDevice):
|
|||
return
|
||||
|
||||
# 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)
|
||||
if self._state is None:
|
||||
|
|
|
@ -172,14 +172,18 @@ class EnvirophatData:
|
|||
self.envirophat.leds.off()
|
||||
|
||||
# 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
|
||||
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
|
||||
self.temperature = round(self.envirophat.weather.temperature(), 2)
|
||||
|
@ -189,6 +193,9 @@ class EnvirophatData:
|
|||
self.pressure = round(self.envirophat.weather.pressure() / 100.0, 3)
|
||||
|
||||
# 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):
|
||||
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 = {}
|
||||
for i, conv in enumerate(self._conversation_list.get_all()):
|
||||
users_in_conversation = []
|
||||
|
|
|
@ -237,7 +237,7 @@ class HERETravelTimeSensor(Entity):
|
|||
|
||||
@property
|
||||
def device_state_attributes(
|
||||
self
|
||||
self,
|
||||
) -> Optional[Dict[str, Union[None, float, str, bool]]]:
|
||||
"""Return the state attributes."""
|
||||
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(
|
||||
hass: "HomeAssistant"
|
||||
hass: "HomeAssistant",
|
||||
) -> Dict[str, "Integration"]:
|
||||
"""Return list of custom integrations."""
|
||||
try:
|
||||
|
@ -102,7 +102,7 @@ async def _async_get_custom_components(
|
|||
|
||||
|
||||
async def async_get_custom_components(
|
||||
hass: "HomeAssistant"
|
||||
hass: "HomeAssistant",
|
||||
) -> Dict[str, "Integration"]:
|
||||
"""Return cached list of custom integrations."""
|
||||
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(
|
||||
color_temperature_kelvin: float
|
||||
color_temperature_kelvin: float,
|
||||
) -> Tuple[float, float, float]:
|
||||
"""
|
||||
Return an RGB color from a color temperature in Kelvin.
|
||||
|
|
|
@ -46,7 +46,7 @@ LocationInfo = collections.namedtuple(
|
|||
|
||||
|
||||
async def async_detect_location_info(
|
||||
session: aiohttp.ClientSession
|
||||
session: aiohttp.ClientSession,
|
||||
) -> Optional[LocationInfo]:
|
||||
"""Detect location information."""
|
||||
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:
|
||||
"""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)
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
# When updating this file, update .pre-commit-config.yaml too
|
||||
asynctest==0.13.0
|
||||
black==19.3b0
|
||||
black==19.10b0
|
||||
codecov==2.0.15
|
||||
flake8-docstrings==1.5.0
|
||||
flake8==3.7.8
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
# When updating this file, update .pre-commit-config.yaml too
|
||||
asynctest==0.13.0
|
||||
black==19.3b0
|
||||
black==19.10b0
|
||||
codecov==2.0.15
|
||||
flake8-docstrings==1.5.0
|
||||
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(
|
||||
hass
|
||||
hass,
|
||||
):
|
||||
"""Test expected result if import flow triggers and ecobee.conf exists with valid tokens."""
|
||||
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(
|
||||
hass
|
||||
hass,
|
||||
):
|
||||
"""Test expected result if import flow triggers and ecobee.conf exists with stale tokens."""
|
||||
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(
|
||||
data_manager: WithingsDataManager
|
||||
data_manager: WithingsDataManager,
|
||||
) -> None:
|
||||
"""Test method."""
|
||||
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(
|
||||
data_manager: WithingsDataManager
|
||||
data_manager: WithingsDataManager,
|
||||
) -> None:
|
||||
"""Test method."""
|
||||
hello_func = MagicMock(return_value="HELLO2")
|
||||
|
|
|
@ -130,17 +130,17 @@ def test_roller_commands(hass, mock_openzwave):
|
|||
|
||||
device.open_cover()
|
||||
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
|
||||
|
||||
device.close_cover()
|
||||
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
|
||||
|
||||
device.stop_cover()
|
||||
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
|
||||
|
||||
|
||||
|
@ -168,7 +168,7 @@ def test_roller_invert_percent(hass, mock_openzwave):
|
|||
|
||||
device.open_cover()
|
||||
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
|
||||
|
||||
|
||||
|
@ -193,17 +193,17 @@ def test_roller_reverse_open_close(hass, mock_openzwave):
|
|||
|
||||
device.open_cover()
|
||||
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
|
||||
|
||||
device.close_cover()
|
||||
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
|
||||
|
||||
device.stop_cover()
|
||||
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
|
||||
|
||||
|
||||
|
|
|
@ -1610,10 +1610,10 @@ class TestZWaveServices(unittest.TestCase):
|
|||
self.hass.block_till_done()
|
||||
|
||||
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 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
|
||||
|
||||
def test_add_association(self):
|
||||
|
|
Loading…
Reference in New Issue