Skip to content

Commit 5508bdc

Browse files
committed
Fix readme example
1 parent fb4f7fe commit 5508bdc

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,18 @@ You should not use it to repack a custom firmware.
175175
### As a library
176176

177177
```py
178+
import asyncio
178179
from reolinkfw import ReolinkFirmware, get_info
179180

180-
url = "https://reolink-storage.s3.amazonaws.com/website/firmware/20200523firmware/RLC-410-5MP_20_20052300.zip"
181-
print(get_info(url))
182-
pak = "/home/ben/RLC-410-5MP_20_20052300.pak"
183-
with ReolinkFirmware.from_file(pak) as fw:
184-
print(fw.get_info())
185-
fw.extract()
181+
async def main():
182+
url = "https://reolink-storage.s3.amazonaws.com/website/firmware/20200523firmware/RLC-410-5MP_20_20052300.zip"
183+
print(await get_info(url))
184+
pak = "/home/ben/RLC-410-5MP_20_20052300.pak"
185+
with ReolinkFirmware.from_file(pak) as fw:
186+
print(await fw.get_info())
187+
fw.extract()
188+
189+
asyncio.run(main())
186190
```
187191

188192
In most cases where a URL is used, it will be a direct link to the file

0 commit comments

Comments
 (0)