hcra/server/backends/port8080.py

23 lines
370 B
Python
Raw Normal View History

2021-06-15 12:50:51 -07:00
import requests
def get_img():
2021-06-15 12:50:51 -07:00
raw_img = requests.get('http://localhost:8080/get_capture.bmp').content
with open('img.bmp', 'wb+') as f:
2021-06-15 12:50:51 -07:00
f.write(raw_img)
return 'img.bmp'
2021-06-15 12:50:51 -07:00
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}')
def connect():
pass
def disconnect():
pass