Skip to content

Commit a238235

Browse files
committed
bugfix timeout and translation
1 parent 94c584d commit a238235

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

custom_components/enpal_webparser/config_flow.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ async def validate_wallbox_api(hass) -> bool:
8383
"""
8484
try:
8585
api_client = WallboxApiClient(hass)
86-
status_data = await api_client.get_status()
86+
# Use 15 second timeout to allow addon time to start up
87+
status_data = await api_client.get_status(timeout=15)
8788

8889
if status_data is None:
8990
_LOGGER.warning("[Enpal] Wallbox API not reachable")
@@ -322,6 +323,9 @@ async def async_step_configure(self, user_input=None):
322323
vol.Optional("use_wallbox_addon", default=config["use_wallbox_addon"]): bool,
323324
}),
324325
errors=errors,
326+
description_placeholders={
327+
"url": self._url,
328+
},
325329
)
326330

327331
return self.async_show_form(

custom_components/enpal_webparser/wallbox_api.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,16 @@ async def set_mode_full(self) -> bool:
132132
_LOGGER.info("[Enpal] Setting wallbox to Full mode")
133133
return await self._post("/set_full")
134134

135-
async def get_status(self) -> Optional[dict]:
135+
async def get_status(self, timeout: int = 15) -> Optional[dict]:
136136
"""Get current wallbox status.
137137
138+
Args:
139+
timeout: Request timeout in seconds (default: 15)
140+
138141
Returns:
139142
Status dict from API or None if failed
140143
"""
141-
return await self._get("/status", timeout=10)
144+
return await self._get("/status", timeout=timeout)
142145

143146
async def call_and_refresh_sensors(
144147
self,

0 commit comments

Comments
 (0)