Last few tweaks
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -95,4 +95,7 @@ external/*
|
|||||||
Provider/AgentTasks/
|
Provider/AgentTasks/
|
||||||
|
|
||||||
# OTA files
|
# OTA files
|
||||||
*.bundle
|
*.bundle
|
||||||
|
|
||||||
|
#png
|
||||||
|
*.png
|
||||||
|
|||||||
20
Provider/fetch_png.py
Normal file
20
Provider/fetch_png.py
Normal file
@@ -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)
|
||||||
@@ -9,7 +9,7 @@ constexpr int DEVICE_XML_MAX = 2048;
|
|||||||
|
|
||||||
constexpr char kDefaultLayoutXml[] =
|
constexpr char kDefaultLayoutXml[] =
|
||||||
"<screen>\n"
|
"<screen>\n"
|
||||||
" <view width=\"100%\" height=\"100%\" layout=\"flex\" flex_flow=\"column\" style_flex_main_place=\"center\" style_flex_cross_place=\"center\" style_pad_row=\"10\">\n"
|
" <view width=\"100%\" height=\"100%\" layout=\"flex\" flex_flow=\"column\" style_flex_main_place=\"center\" style_flex_track_place=\"center\" style_pad_row=\"10\">\n"
|
||||||
" <lv_label text=\"Hello World\" />\n"
|
" <lv_label text=\"Hello World\" />\n"
|
||||||
" <lv_label bind_text=\"device_mac\" />\n"
|
" <lv_label bind_text=\"device_mac\" />\n"
|
||||||
" </view>\n"
|
" </view>\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user