10000 components/husqvarna_automower_ble: Raise ConfigEntryNotReady on init… · home-assistant/core@a32271c · GitHub
[go: up one dir, main page]

Skip to content

Commit a32271c

Browse files
committed
components/husqvarna_automower_ble: Raise ConfigEntryNotReady on init errors
Signed-off-by: Alistair Francis <alistair@alistair23.me>
1 parent 7a18d19 commit a32271c

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

homeassistant/components/husqvarna_automower_ble/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
3636
hass, address, connectable=True
3737
) or await get_device(address)
3838
if not await mower.connect(device):
39-
raise ConfigEntryAuthFailed(f"Unable to connect to device {address}")
39+
raise ConfigEntryNotReady
4040
except (TimeoutError, BleakError) as exception:
4141
raise ConfigEntryNotReady(
4242
f"Unable to connect to device {address} due to {exception}"

tests/components/husqvarna_automower_ble/test_init.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,4 @@ async def test_setup_invalid_pin(
6666
await hass.config_entries.async_setup(mock_config_entry.entry_id)
6767
await hass.async_block_till_done()
6868

69-
assert mock_config_entry.state is ConfigEntryState.SETUP_ERROR
70-
71-
flows = hass.config_entries.flow.async_progress()
72-
assert len(flows) == 1
73-
assert flows[0]["step_id"] == "reauth_confirm"
74-
75-
hass.config_entries.flow.async_abort(flows[0]["flow_id"])
76-
assert not hass.config_entries.flow.async_progress()
69+
assert mock_config_entry.state is ConfigEntryState.SETUP_RETRY

0 commit comments

Comments
 (0)
0