Add cydweb catalog meta and HTML UI preview for GY30 firmware.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-20 22:13:36 +08:00
parent 430cfc0cf4
commit 81f51dcd16
3 changed files with 69 additions and 0 deletions

View File

@@ -64,3 +64,4 @@ README.md
| 日期 | 说明 |
|------|------|
| 2026-10-20 | 初版:参考 temperature/sgp30test,GY30(BH1750) SDA=GPIO22 / SCL=GPIO27,LUX/LEVEL 双表盘、场景条、趋势图 |
| 2026-10-20 | 增加 `meta.json` 与 `media/preview.html`,供 cydweb 本地目录展示 |

View File

@@ -0,0 +1,58 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>LIGHT</title>
<style>
*{box-sizing:border-box;margin:0;padding:0}
html,body{width:320px;height:240px;overflow:hidden;background:#000;margin:0}
.bezel{width:320px;height:240px;background:#1a1408}
.screen{width:320px;height:240px;background:#0A1018;color:#F2F5FA;font:12px/1.2 system-ui,sans-serif;
overflow:hidden}
.hdr{display:flex;align-items:center;gap:8px;padding:4px 8px;height:24px}
.hdr b{font-size:14px}.up{color:#7E90A8}.sp{margin-left:auto;display:flex;gap:6px;align-items:center;color:#7E90A8}
.led{width:9px;height:9px;border-radius:50%;background:#4CAF7A}
.row{display:flex;gap:6px;padding:0 8px}
.panel{flex:1;height:118px;background:#121C2A;border:1px solid #1E2C40;border-radius:6px;padding:6px 8px;position:relative}
.cap{color:#7E90A8;font-size:11px}
.gauge{width:90px;height:90px;margin:4px auto 0;border-radius:50%;
background:conic-gradient(#F0C040 0 42%, #243247 0);
mask:radial-gradient(farthest-side,transparent 62%,#000 63%);
-webkit-mask:radial-gradient(farthest-side,transparent 62%,#000 63%)}
.panel.lvl .gauge{background:conic-gradient(#4DA3FF 0 58%, #243247 0)}
.val{position:absolute;left:0;right:0;top:44px;text-align:center;font-size:20px;font-weight:700;color:#F0C040}
.panel.lvl .val{color:#4DA3FF}
.unit{font-size:10px;color:#7E90A8}
.rng{position:absolute;left:0;right:0;bottom:6px;text-align:center;color:#7E90A8;font-size:11px}
.bot{margin:6px 8px 0;height:78px;background:#121C2A;border:1px solid #1E2C40;border-radius:6px;display:flex;gap:8px;padding:8px}
.info{width:96px}.ok{color:#4CAF7A;font-size:14px;font-weight:700}
.bar{margin-top:8px;height:8px;background:#243247;border-radius:4px;overflow:hidden}
.bar>i{display:block;height:100%;width:58%;background:#4DA3FF}
.meta{margin-top:8px;color:#7E90A8;font-size:11px}
.chart{flex:1;background:#0E1622;border-radius:4px}
.chart svg{width:100%;height:100%}
</style>
</head>
<body>
<div class="bezel"><div class="screen" id="s">
<div class="hdr"><b>LIGHT</b><span class="up">up 02:18</span>
<span class="sp"><span>OK</span><span class="led"></span></span></div>
<div class="row">
<div class="panel"><div class="cap">LUX</div><div class="gauge"></div>
<div class="val">186<span class="unit"> lx</span></div><div class="rng">42 / 420</div></div>
<div class="panel lvl"><div class="cap">LEVEL</div><div class="gauge"></div>
<div class="val">58<span class="unit"> %</span></div><div class="rng">EV 7.5</div></div>
</div>
<div class="bot">
<div class="info"><div class="ok">INDOOR</div><div class="bar"><i></i></div>
<div class="meta">GY30 BH1750<br/>SDA22 · SCL27</div></div>
<div class="chart"><svg viewBox="0 0 180 60" preserveAspectRatio="none">
<polyline fill="none" stroke="#F0C040" stroke-width="2"
points="0,40 20,38 40,32 60,30 80,28 100,34 120,26 140,24 160,22 180,25"/>
<polyline fill="none" stroke="#4DA3FF" stroke-width="2"
points="0,48 20,46 40,44 60,42 80,40 100,43 120,38 140,36 160,35 180,37"/>
</svg></div>
</div>
</div></div>
</body>
</html>

View File

@@ -0,0 +1,10 @@
{
"boardId": "esp32-2432s028",
"name": "CYD GY30 light dashboard",
"summary": "Lux & perceived-level gauges with scene bar and chart",
"description": "GY30 / BH1750 on SDA=GPIO22 / SCL=GPIO27. Dual arcs for LUX / LEVEL%, scene label, EV, live sparkline. Tap cycles backlight; hold resets min/max.",
"tags": ["light", "gy30", "bh1750", "lux"],
"media": {
"preview": "media/preview.html"
}
}