Skip to content

v0.3.1-preview:網頁開關插座 - #5

Merged
lee98064 merged 4 commits into
mainfrom
feat/web-relay-control
Nov 12, 2026
Merged

lee98064 merged 4 commits into
mainfrom
feat/web-relay-control

Conversation

@lee98064

Copy link
Copy Markdown
Owner

摘要

v0.3.1-preview(software version 15):管理後台可以直接開關插座。

功能

  • 總覽頁電力卡右上角新增開關按鈕;只有登入的管理員可操作,關閉前會再確認,訪客按下會引導登入
  • 僅 Matter 模式:HomeKit 模式按鈕停用,並提示使用家庭 App 或實體按鍵(原廠程式獨占 MCU)
  • 後端新增 POST /admin/relay-on/relay-off(session+CSRF、操作鎖;不接受 body),沿用既有管理服務 → Matter 程式的請求通道
  • Matter 程式送出 MCU 指令,收到 MCU 確認才回報成功;忙碌、失敗、逾時分別回報 relay-busy/relay-failed/relay-timeout,網頁顯示對應提示;Matter OnOff 狀態自動同步
  • 原廠網頁首次安裝檔改用 v0.3.1,說明、網站、README 與截圖同步更新

驗證

  • HTTP 規則:未登入 401、帶 body 400、HomeKit 409、Matter 未就緒 503、操作進行中 409、成功 202 並寫入正確請求(native 與 MIPS 各 59 項通過)
  • Matter VM:經由實際登入的 HTTP API → 真實 MIPS Matter 程式 → MCU 模擬器,確認精確的 14-byte 開/關指令、complete 回執、/measurements 與 Matter OnOff 屬性;MCU 不確認回報 relay-failed;網頁與 Matter 指令雙向互斥
  • 瀏覽器實測(真實 C 管理服務 fixture):訪客、管理員開/關、取消、HomeKit 停用與 API 拒絕,無頁面錯誤
  • 發布建置:簽章驗證、kernel/Bank 2/公鑰與線上 v0.3.0 相同、validate_catalog_upgrade 14→15;v0.2.11 與 v0.3.0 頁面的更新篩選都會選到 0.3.1
  • v0.3.1 原廠安裝檔:原廠 Boa 模擬、首次匯入後 OTA、公開內容稽核通過
  • 原機安裝驗收由使用者執行

🤖 Generated with Claude Code

lee98064 and others added 4 commits November 12, 2026 18:42
POST /admin/relay-on and /admin/relay-off (session + CSRF, operation
lock) queue a request on the existing admin-to-matterd channel; matterd
issues the MCU command and reports complete only after MCU confirmation,
otherwise relay-busy, relay-failed or relay-timeout. HomeKit mode is
refused with 409. The overview card gains a toggle button that asks
before switching off, and guests are sent to the login dialog.

Tests cover the HTTP rules, and the Matter VM test drives the real API
through matterd to the simulated MCU, including web/Matter exclusion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The factory web install now uses commandkit-matter-v0.3.1-public-first-install.bin.
Screenshots show the new relay toggle, the site and READMEs mention web
on/off, and the release, public audit and first-install verification
for v0.3.1 are recorded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lee98064
lee98064 merged commit 637e0da into main Nov 12, 2026
1 check passed
@lee98064
lee98064 deleted the feat/web-relay-control branch November 12, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant