Added exception on connection failure during startup.

This commit is contained in:
Tomaae 2022-01-24 11:50:58 +01:00
parent 8d3e86a988
commit 3b95198ad8

View file

@ -42,6 +42,8 @@ async def async_setup_entry(hass, config_entry):
"""Set up Mikrotik Router as config entry."""
controller = MikrotikControllerData(hass, config_entry)
await controller.async_hwinfo_update()
if not controller.connected():
raise ConfigEntryNotReady(f"Cannot connect to host")
await controller.async_update()