Skip to content

Commit

Permalink
backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
dgomes committed May 9, 2024
1 parent 46626d8 commit 42035be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions homeassistant/components/v2c/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ async def async_step_user(
try:
data = await evse.get_data()

await self.async_set_unique_id(data.ID)
self._abort_if_unique_id_configured()
if data.ID:
await self.async_set_unique_id(data.ID)
self._abort_if_unique_id_configured()

except TrydanError:
errors["base"] = "cannot_connect"
Expand Down
2 changes: 1 addition & 1 deletion tests/components/v2c/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ async def test_device_id_already_exists(
)
await hass.async_block_till_done()

assert result2["type"] is FlowResultType.FORM
assert result2["type"] is FlowResultType.CREATE_ENTRY

result_2nd_device = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
Expand Down

0 comments on commit 42035be

Please sign in to comment.