diff --git a/.gitignore b/.gitignore index 989d5c0..3f2bfdf 100644 --- a/.gitignore +++ b/.gitignore @@ -95,4 +95,7 @@ external/* Provider/AgentTasks/ # OTA files -*.bundle \ No newline at end of file +*.bundle + +#png +*.png diff --git a/Provider/fetch_png.py b/Provider/fetch_png.py new file mode 100644 index 0000000..71688b0 --- /dev/null +++ b/Provider/fetch_png.py @@ -0,0 +1,20 @@ +import urllib.request +import json +import time + +# 1. Register a fake device +req = urllib.request.Request('http://calendink.local/api/devices/register', data=json.dumps({'mac': 'DE:BU:G0:44:55:66'}).encode('utf-8'), headers={'Content-Type': 'application/json'}) +try: + with urllib.request.urlopen(req) as response: + print("Registered:", response.read().decode()) +except Exception as e: + print("Error registering:", e) + +time.sleep(1) + +# 2. Download the PNG +try: + urllib.request.urlretrieve('http://calendink.local/api/devices/screen.png?mac=DE:BU:G0:44:55:66', 'test_png.png') + print("Downloaded test_png.png") +except Exception as e: + print("Error downloading PNG:", e) diff --git a/Provider/main/device.hpp b/Provider/main/device.hpp index 16c2fa3..9e66284 100644 --- a/Provider/main/device.hpp +++ b/Provider/main/device.hpp @@ -9,7 +9,7 @@ constexpr int DEVICE_XML_MAX = 2048; constexpr char kDefaultLayoutXml[] = "\n" - " \n" + " \n" " \n" " \n" " \n"