Add isolated read-only official widget integration and searchable catalog

This commit is contained in:
Pigway
2026-10-02 16:20:54 +08:00
parent bfef1ad28d
commit 59fbdf7c1a
13 changed files with 1144 additions and 7 deletions
+5 -1
View File
@@ -8,8 +8,9 @@ from pigway_frame_flow.models import (
class KokonnaDriver:
def __init__(self, client, device_id, sanitize=lambda v: v):
def __init__(self, client, device_id, sanitize=lambda v: v, widgets=None):
self.client, self.device_id, self.sanitize = client, device_id, sanitize
self.widget_reader = widgets
self.cached: Device | None = None
self.cached_at = 0.0
@@ -62,6 +63,9 @@ class KokonnaDriver:
self.cached_at = time.monotonic()
return result
def widgets(self):
return self.widget_reader.read()
def get_current_image(self):
return self.device().current_content.id