Skip to content

Commit

Permalink
Fixed DeprecationWarning: The loop argument is deprecated since Pytho…
Browse files Browse the repository at this point in the history
…n 3.8, and scheduled for removal in Python 3.10 #140
  • Loading branch information
sbidy committed Mar 5, 2022
1 parent 5893b31 commit 5164976
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,14 @@ async def main():
# Do operations on multiple lights in parallel
#bulb1 = wizlight("<your bulb1 ip>")
#bulb2 = wizlight("<your bulb2 ip>")
#await asyncio.gather(bulb1.turn_on(PilotBuilder(brightness = 255)),
# --- DEPRECATED in 3.10 see [#140](https://github.com/sbidy/pywizlight/issues/140)
# await asyncio.gather(bulb1.turn_on(PilotBuilder(brightness = 255)),
# bulb2.turn_on(PilotBuilder(warm_white = 255)))
# --- For >3.10 await asyncio.gather() from another coroutine
# async def turn_bulbs_on(bulb1, bulb2):
# await asyncio.gather(bulb1.turn_on(PilotBuilder(warm_white=255)), bulb2.turn_on(PilotBuilder(warm_white=255)))
# def main:
# asyncio.run(async turn_bulbs_on(bulb1, bulb2))

loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Expand Down

0 comments on commit 5164976

Please sign in to comment.