mirror of
https://github.com/home-assistant/core.git
synced 2025-09-11 15:51:47 +02:00
Fix Enigma2 startup hang (#149756)
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
"""Data update coordinator for the Enigma2 integration."""
|
"""Data update coordinator for the Enigma2 integration."""
|
||||||
|
|
||||||
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from openwebif.api import OpenWebIfDevice, OpenWebIfStatus
|
from openwebif.api import OpenWebIfDevice, OpenWebIfStatus
|
||||||
@@ -30,6 +31,8 @@ from .const import CONF_SOURCE_BOUQUET, DOMAIN
|
|||||||
|
|
||||||
LOGGER = logging.getLogger(__package__)
|
LOGGER = logging.getLogger(__package__)
|
||||||
|
|
||||||
|
SETUP_TIMEOUT = 10
|
||||||
|
|
||||||
type Enigma2ConfigEntry = ConfigEntry[Enigma2UpdateCoordinator]
|
type Enigma2ConfigEntry = ConfigEntry[Enigma2UpdateCoordinator]
|
||||||
|
|
||||||
|
|
||||||
@@ -79,7 +82,7 @@ class Enigma2UpdateCoordinator(DataUpdateCoordinator[OpenWebIfStatus]):
|
|||||||
async def _async_setup(self) -> None:
|
async def _async_setup(self) -> None:
|
||||||
"""Provide needed data to the device info."""
|
"""Provide needed data to the device info."""
|
||||||
|
|
||||||
about = await self.device.get_about()
|
about = await asyncio.wait_for(self.device.get_about(), timeout=SETUP_TIMEOUT)
|
||||||
self.device.mac_address = about["info"]["ifaces"][0]["mac"]
|
self.device.mac_address = about["info"]["ifaces"][0]["mac"]
|
||||||
self.device_info["model"] = about["info"]["model"]
|
self.device_info["model"] = about["info"]["model"]
|
||||||
self.device_info["manufacturer"] = about["info"]["brand"]
|
self.device_info["manufacturer"] = about["info"]["brand"]
|
||||||
|
Reference in New Issue
Block a user