Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # C:\temp\python3.9\Scripts> pip install websockets
- # used for debuging Shelly 1 plus device
- # turn on Device -> Debug -> Websocket debug:
- import websockets
- import asyncio
- print("Hello!")
- async def listen():
- url = "ws://192.168.0.199/debug/log"
- async with websockets.connect(url) as ws:
- while True:
- msg = await ws.recv()
- print(msg)
- asyncio.get_event_loop().run_until_complete(listen())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement