mirror of
https://github.com/andvikt/mega_hacs.git
synced 2026-02-02 23:47:47 +05:00
tune restore
This commit is contained in:
@@ -92,9 +92,7 @@ class MegaView(HomeAssistantView):
|
|||||||
_LOGGER.debug(f"Request: %s from '%s'", data, request.remote)
|
_LOGGER.debug(f"Request: %s from '%s'", data, request.remote)
|
||||||
make_ints(data)
|
make_ints(data)
|
||||||
if data.get('st') == '1':
|
if data.get('st') == '1':
|
||||||
hass.async_create_task(hub.reload())
|
hass.async_create_task(self.later_restore(hub))
|
||||||
if hub.restore_on_restart:
|
|
||||||
hass.async_create_task(self.later_restore(hub))
|
|
||||||
return Response(status=200)
|
return Response(status=200)
|
||||||
port = data.get('pt')
|
port = data.get('pt')
|
||||||
data = data.copy()
|
data = data.copy()
|
||||||
@@ -164,7 +162,9 @@ class MegaView(HomeAssistantView):
|
|||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
await asyncio.sleep(0.2)
|
await asyncio.sleep(0.2)
|
||||||
await hub.restore_states()
|
if hub.restore_on_restart:
|
||||||
|
await hub.restore_states()
|
||||||
|
await hub.reload()
|
||||||
|
|
||||||
async def later_update(self, hub):
|
async def later_update(self, hub):
|
||||||
await asyncio.sleep(1)
|
await asyncio.sleep(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user