mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 08:47:57 +00:00
Fix custom account config flow setup (#127750)
This commit is contained in:
parent
5da3ca4bb1
commit
46d9ac8380
@ -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:
|
||||
@ -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):
|
||||
|
@ -46,7 +46,7 @@ class OVOEnergyFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||
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:
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user