diff --git a/custom_components/xiaomi_gateway3/diagnostics.py b/custom_components/xiaomi_gateway3/diagnostics.py index d6ff7a25..5de9169f 100644 --- a/custom_components/xiaomi_gateway3/diagnostics.py +++ b/custom_components/xiaomi_gateway3/diagnostics.py @@ -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 @@ -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() @@ -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, }