Skip to content

Commit c0f00f6

Browse files
committed
Update example
1 parent 7208e5e commit c0f00f6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

example.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
async def main():
1212
"""Sample code to retrieve the data from an OpenSenseMap station."""
1313
async with aiohttp.ClientSession() as session:
14-
station = OpenSenseMap(SENSOR_ID, loop, session)
14+
station = OpenSenseMap(SENSOR_ID, session)
1515

1616
# Print details about the given station
1717
await station.get_data()
@@ -26,5 +26,5 @@ async def main():
2626
print("Temperature:", station.temperature)
2727

2828

29-
loop = asyncio.get_event_loop()
30-
loop.run_until_complete(main())
29+
if __name__ == "__main__":
30+
asyncio.run(main())

0 commit comments

Comments
 (0)