From f6a6828450e7443a5de729ad0fbe53a99d144319 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 23 Sep 2022 13:34:12 +0000 Subject: [PATCH] Run formatting --- custom_components/powercalc/config_flow.py | 8 +++++--- tests/test_config_flow.py | 9 ++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/custom_components/powercalc/config_flow.py b/custom_components/powercalc/config_flow.py index ed5524f26..ad47b5e87 100644 --- a/custom_components/powercalc/config_flow.py +++ b/custom_components/powercalc/config_flow.py @@ -62,9 +62,9 @@ SensorType, ) from .errors import ModelNotSupported, StrategyConfigurationError -from .power_profile.power_profile import PowerProfile from .power_profile.library import ModelInfo, ProfileLibrary from .power_profile.model_discovery import get_power_profile +from .power_profile.power_profile import PowerProfile from .sensors.daily_energy import DEFAULT_DAILY_UPDATE_FREQUENCY from .strategy.factory import PowerCalculatorStrategyFactory from .strategy.strategy_interface import PowerCalculationStrategyInterface @@ -199,7 +199,9 @@ async def async_step_integration_discovery( ) -> FlowResult: """Handle integration discovery.""" - self.skip_advanced_step = True # We don't want to ask advanced option when discovered + self.skip_advanced_step = ( + True # We don't want to ask advanced option when discovered + ) self.sensor_config.update(discovery_info) self.selected_sensor_type = SensorType.VIRTUAL_POWER self.name = discovery_info[CONF_NAME] @@ -356,7 +358,7 @@ async def async_step_lut(self, user_input: dict[str, str] = None) -> FlowResult: self.sensor_config.update( { CONF_MANUFACTURER: self.power_profile.manufacturer, - CONF_MODEL: self.power_profile.model + CONF_MODEL: self.power_profile.model, } ) return await self.async_step_power_advanced() diff --git a/tests/test_config_flow.py b/tests/test_config_flow.py index 1b2ae0785..e7572f1b3 100644 --- a/tests/test_config_flow.py +++ b/tests/test_config_flow.py @@ -86,7 +86,9 @@ async def test_discovery_flow(hass: HomeAssistant): # Confirm selected manufacturer/model assert result["type"] == data_entry_flow.FlowResultType.FORM - result = await hass.config_entries.flow.async_configure(result["flow_id"], {CONF_CONFIRM_AUTODISCOVERED_MODEL: True}) + result = await hass.config_entries.flow.async_configure( + result["flow_id"], {CONF_CONFIRM_AUTODISCOVERED_MODEL: True} + ) assert result["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY assert result["data"] == { @@ -280,10 +282,7 @@ async def test_lut_autodiscover_flow(hass: HomeAssistant): _assert_default_virtual_power_entry_data( CalculationStrategy.LUT, result["data"], - { - CONF_MANUFACTURER: light_entity.manufacturer, - CONF_MODEL: light_entity.model - } + {CONF_MANUFACTURER: light_entity.manufacturer, CONF_MODEL: light_entity.model}, ) await hass.async_block_till_done()