Add optional photo providers, layout studio and scoped integrations
This commit is contained in:
@@ -32,10 +32,15 @@ class DeviceRegistry:
|
||||
for id, entry in devices.items():
|
||||
if not entry.get("enabled", True):
|
||||
continue
|
||||
if entry.get("driver") != "kokonna":
|
||||
raise ValueError("Unsupported configured device driver")
|
||||
if not __import__("re").fullmatch(r"[a-z0-9-]{1,60}", id):
|
||||
raise ValueError("Invalid configured device ID")
|
||||
if entry.get("driver") == "generic_http_frame":
|
||||
from pigway_frame_flow.drivers.generic_http import GenericHTTPDriver
|
||||
|
||||
self.drivers[id] = GenericHTTPDriver(id, entry, settings)
|
||||
continue
|
||||
if entry.get("driver") != "kokonna":
|
||||
raise ValueError("Unsupported configured device driver")
|
||||
client: MockClient | KokonnaClient
|
||||
if settings.mock:
|
||||
root = settings.data_dir / "cache" / id
|
||||
@@ -71,4 +76,8 @@ class DeviceRegistry:
|
||||
|
||||
def official_widgets(self, id: str):
|
||||
self.get(id)
|
||||
if id not in self.official:
|
||||
raise FlowError(
|
||||
E.UNSUPPORTED_CAPABILITY, "This driver has no official widgets", 422
|
||||
)
|
||||
return self.official[id].widgets()
|
||||
|
||||
Reference in New Issue
Block a user