2021-06-15 12:50:51 -07:00
|
|
|
import requests
|
|
|
|
|
|
|
|
|
2021-06-17 19:50:16 -07:00
|
|
|
def get_img():
|
2021-06-15 12:50:51 -07:00
|
|
|
raw_img = requests.get('http://localhost:8080/get_capture.bmp').content
|
|
|
|
|
2021-06-17 19:50:16 -07:00
|
|
|
with open('img.bmp', 'wb+') as f:
|
2021-06-15 12:50:51 -07:00
|
|
|
f.write(raw_img)
|
|
|
|
|
2021-06-17 19:50:16 -07:00
|
|
|
return 'img.bmp'
|
2021-06-15 12:50:51 -07:00
|
|
|
|
|
|
|
|
2021-06-17 19:50:16 -07:00
|
|
|
def touch(x, y, is_long):
|
2021-06-17 14:33:40 -07:00
|
|
|
requests.get(f'http://localhost:8080/set_touch?x={x}&y={y}&hold={1 if is_long else 0}')
|