Commit 857a813 1 parent 55ae69f commit 857a813 Copy full SHA for 857a813
File tree 1 file changed +3
-3
lines changed
custom_components/zha_toolkit
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -104,8 +104,8 @@ async def znp_restore(
104
104
event_data ["restore_file" ] = fname
105
105
106
106
# Read backup file
107
- with open (fname , encoding = "utf_8" ) as f :
108
- backup = json .load ( f )
107
+ async with aiofiles . open (fname , encoding = "utf_8" ) as f :
108
+ backup = json .loads ( await f . read () )
109
109
110
110
# validate the backup file
111
111
LOGGER .info ("Validating backup contents" )
@@ -203,7 +203,7 @@ async def znp_nvram_restore(
203
203
204
204
LOGGER .info ("Restoring NVRAM from '%s'" , fname )
205
205
async with aiofiles .open (fname , "r" , encoding = "utf_8" ) as f :
206
- nvram_obj = json .load (await f .read ())
206
+ nvram_obj = json .loads (await f .read ())
207
207
208
208
await nvram_write (app ._znp , nvram_obj )
209
209
LOGGER .info ("Restored NVRAM from '%s'" , fname )
You can’t perform that action at this time.
0 commit comments