mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Update config to use async_add_executor_job (#41452)
This commit is contained in:
parent
8a374590e8
commit
ad5273ded1
@ -189,7 +189,7 @@ class BaseEditConfigView(HomeAssistantView):
|
|||||||
|
|
||||||
async def read_config(self, hass):
|
async def read_config(self, hass):
|
||||||
"""Read the config."""
|
"""Read the config."""
|
||||||
current = await hass.async_add_job(_read, hass.config.path(self.path))
|
current = await hass.async_add_executor_job(_read, hass.config.path(self.path))
|
||||||
if not current:
|
if not current:
|
||||||
current = self._empty_config()
|
current = self._empty_config()
|
||||||
return current
|
return current
|
||||||
|
@ -54,7 +54,7 @@ class ZWaveLogView(HomeAssistantView):
|
|||||||
return Response(text="Invalid datetime", status=HTTP_BAD_REQUEST)
|
return Response(text="Invalid datetime", status=HTTP_BAD_REQUEST)
|
||||||
|
|
||||||
hass = request.app["hass"]
|
hass = request.app["hass"]
|
||||||
response = await hass.async_add_job(self._get_log, hass, lines)
|
response = await hass.async_add_executor_job(self._get_log, hass, lines)
|
||||||
|
|
||||||
return Response(text="\n".join(response))
|
return Response(text="\n".join(response))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user