Skip to content

Commit f8ad47e

Browse files
committed
Update example
1 parent 47cad50 commit f8ad47e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,17 @@ import time
3939

4040
from pyoverkiz.const import SUPPORTED_SERVERS
4141
from pyoverkiz.client import OverkizClient
42+
from aiohttp import ClientSession
4243

4344
USERNAME = ""
4445
PASSWORD = ""
4546

47+
4648
async def main() -> None:
47-
async with OverkizClient(USERNAME, PASSWORD, server=SUPPORTED_SERVERS["somfy_europe"]) as client:
49+
50+
session = ClientSession()
51+
server = SUPPORTED_SERVERS["somfy_europe"](session)
52+
async with OverkizClient(USERNAME, PASSWORD, server=server) as client:
4853
try:
4954
await client.login()
5055
except Exception as exception: # pylint: disable=broad-except
@@ -63,6 +68,8 @@ async def main() -> None:
6368

6469
time.sleep(2)
6570

71+
72+
asyncio.run(main())
6673
asyncio.run(main())
6774
```
6875

0 commit comments

Comments
 (0)