hcra/server/backends/port8080.py
Samuel Sloniker a67f765bd2 Move parts of backends into new imgproc.py
A lot of code was unnecesarily shared between the backends. This places
much of that code in a new file, `imgproc.py`
2021-06-17 19:50:16 -07:00

15 lines
315 B
Python

import requests
def get_img():
raw_img = requests.get('http://localhost:8080/get_capture.bmp').content
with open('img.bmp', 'wb+') as f:
f.write(raw_img)
return 'img.bmp'
def touch(x, y, is_long):
requests.get(f'http://localhost:8080/set_touch?x={x}&y={y}&hold={1 if is_long else 0}')