Skip to content

Commit

Permalink
Fix custom account config flow setup
Browse files Browse the repository at this point in the history
  • Loading branch information
rjmarques committed Oct 6, 2024
1 parent 4721f8e commit c1c7490
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/ovo_energy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
client_session=async_get_clientsession(hass),
)

if custom_account := entry.data.get(CONF_ACCOUNT) is not None:
if (custom_account := entry.data.get(CONF_ACCOUNT)) is not None:
client.custom_account_id = custom_account

try:
Expand All @@ -49,7 +49,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:

async def async_update_data() -> OVODailyUsage:
"""Fetch data from OVO Energy."""
if custom_account := entry.data.get(CONF_ACCOUNT) is not None:
if (custom_account := entry.data.get(CONF_ACCOUNT)) is not None:
client.custom_account_id = custom_account

async with asyncio.timeout(10):
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/ovo_energy/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async def async_step_user(
client_session=async_get_clientsession(self.hass),
)

if custom_account := user_input.get(CONF_ACCOUNT) is not None:
if (custom_account := user_input.get(CONF_ACCOUNT)) is not None:
client.custom_account_id = custom_account

try:
Expand Down
1 change: 1 addition & 0 deletions tests/components/ovo_energy/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ async def test_full_flow_implementation(hass: HomeAssistant) -> None:
assert result2["type"] is FlowResultType.CREATE_ENTRY
assert result2["data"][CONF_USERNAME] == FIXTURE_USER_INPUT[CONF_USERNAME]
assert result2["data"][CONF_PASSWORD] == FIXTURE_USER_INPUT[CONF_PASSWORD]
assert result2["data"][CONF_ACCOUNT] == FIXTURE_USER_INPUT[CONF_ACCOUNT]


async def test_reauth_authorization_error(hass: HomeAssistant) -> None:
Expand Down

0 comments on commit c1c7490

Please sign in to comment.