kabyru

Local Python Server recieving Companion App Data

Aug 28th, 2019
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. import asyncio
  2. import websockets
  3.  
  4. async def hello(websocket, path):
  5.     fitbitRecieved = await websocket.recv()
  6.     print(f"< {fitbitRecieved}")
  7.  
  8. start_server = websockets.serve(hello, "192.168.1.3", 8785)
  9.  
  10. asyncio.get_event_loop().run_until_complete(start_server)
  11. asyncio.get_event_loop().run_forever()
Advertisement
Add Comment
Please, Sign In to add comment