Skip to content

Commit

Permalink
Fix detected blocking call to scandir with args #1491
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Nov 22, 2024
1 parent bc85aca commit 3493a7f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/xiaomi_gateway3/diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async def async_get_config_entry_diagnostics(
except Exception as e:
devices = repr(e)

info = get_info(hass, config_entry)
info = await get_info(hass, config_entry)
info["devices"] = devices
return info

Expand All @@ -29,12 +29,12 @@ async def async_get_device_diagnostics(
except Exception as e:
device = repr(e)

info = get_info(hass, config_entry)
info = await get_info(hass, config_entry)
info["device"] = device
return info


def get_info(hass: HomeAssistant, config_entry: ConfigEntry) -> dict:
async def get_info(hass: HomeAssistant, config_entry: ConfigEntry) -> dict:
try:
errors = [
entry.to_dict()
Expand All @@ -45,7 +45,7 @@ def get_info(hass: HomeAssistant, config_entry: ConfigEntry) -> dict:
errors = repr(e)

return {
"version": source_hash(),
"version": await hass.async_add_executor_job(source_hash),
"options": config_entry.options.copy(),
"errors": errors,
}

0 comments on commit 3493a7f

Please sign in to comment.