mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Prevent get_mac_address from blocking event loop in samsungtv config flow (#60246)
This commit is contained in:
parent
e1de6612be
commit
be94ce42a5
@ -1,6 +1,7 @@
|
|||||||
"""Config flow for Samsung TV."""
|
"""Config flow for Samsung TV."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from functools import partial
|
||||||
import socket
|
import socket
|
||||||
from types import MappingProxyType
|
from types import MappingProxyType
|
||||||
from typing import Any
|
from typing import Any
|
||||||
@ -167,7 +168,9 @@ class SamsungTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
self._udn = _strip_uuid(dev_info.get("udn", info["id"]))
|
self._udn = _strip_uuid(dev_info.get("udn", info["id"]))
|
||||||
if mac := mac_from_device_info(info):
|
if mac := mac_from_device_info(info):
|
||||||
self._mac = mac
|
self._mac = mac
|
||||||
elif mac := getmac.get_mac_address(ip=self._host):
|
elif mac := await self.hass.async_add_executor_job(
|
||||||
|
partial(getmac.get_mac_address, ip=self._host)
|
||||||
|
):
|
||||||
self._mac = mac
|
self._mac = mac
|
||||||
self._device_info = info
|
self._device_info = info
|
||||||
return True
|
return True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user