Fix blocking call error in log

Fixes #18
This commit is contained in:
junkfix 2024-09-04 00:50:04 +01:00 committed by GitHub
parent b7ad97aba7
commit 632dceda4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -120,9 +120,13 @@ async def websocket_create(hass, connection, msg):
elif (action == 'list'):
dirnm = os.path.dirname(hass.config.path(yamlname))
listyaml = []
rec(dirnm, '')
def reca():
rec(dirnm, '')
await hass.async_add_executor_job(reca)
if msg["depth"]>0:
drec(dirnm, '')
def dreca():
drec(dirnm, '')
await hass.async_add_executor_job(dreca)
if (len(listyaml) < 1):
listyaml = ['list_error.'+ext]
connection.send_result(