1515from homeassistant .core import HomeAssistant
1616from homeassistant .exceptions import ConfigEntryNotReady
1717
18- from .const import DISCOVERY_TIMEOUT
18+ from .const import DISCOVERY_TIMEOUT , DOMAIN
1919from .coordinator import GoveeLocalApiCoordinator , GoveeLocalConfigEntry
2020
2121PLATFORMS : list [Platform ] = [Platform .LIGHT ]
@@ -52,7 +52,11 @@ async def await_cleanup():
5252 _LOGGER .error ("Start failed, errno: %d" , ex .errno )
5353 return False
5454 _LOGGER .error ("Port %s already in use" , LISTENING_PORT )
55- raise ConfigEntryNotReady from ex
55+ raise ConfigEntryNotReady (
56+ translation_domain = DOMAIN ,
57+ translation_key = "port_in_use" ,
58+ translation_placeholders = {"port" : LISTENING_PORT },
59+ ) from ex
5660
5761 await coordinator .async_config_entry_first_refresh ()
5862
@@ -61,7 +65,9 @@ async def await_cleanup():
6165 while not coordinator .devices :
6266 await asyncio .sleep (delay = 1 )
6367 except TimeoutError as ex :
64- raise ConfigEntryNotReady from ex
68+ raise ConfigEntryNotReady (
69+ translation_domain = DOMAIN , translation_key = "no_devices_found"
70+ ) from ex
6571
6672 entry .runtime_data = coordinator
6773 await hass .config_entries .async_forward_entry_setups (entry , PLATFORMS )
0 commit comments