Separate official widget authorization and document account-only RPC capabilities

This commit is contained in:
Pigway
2026-10-03 07:00:07 +08:00
parent 0c18cabc92
commit 142d771ffa
5 changed files with 111 additions and 3 deletions
+13 -2
View File
@@ -83,13 +83,24 @@ class WidgetReader:
cover = selected.get("frameCover") or {}
current_id = cover.get("id", selected.get("coverId"))
current = next((row for row in catalog if row.id == current_id), None)
robot = data.get("robot") or {}
no_widget = (
"frameCoverRobot" in data
and data["frameCoverRobot"] is None
and "frameCoverRobotId" in robot
and robot["frameCoverRobotId"] is None
)
result = WidgetState(
source="live",
configured=True,
catalog=catalog,
current=current,
current_verified=current is not None,
status="OK" if current else "CURRENT_UNVERIFIED",
current_verified=current is not None or no_widget,
status="OK"
if current
else "NO_WIDGET"
if no_widget
else "CURRENT_UNVERIFIED",
)
except FlowError:
raise