Files
epaper-dashboard/plugins/hello.py
T
ki 28124c5617 Initial commit: epaper-dashboard for 7.3" ACeP 7-Color display
- dashboard.py: plugin-based renderer with 4x4 grid layout
- admin.py: web UI with layout editor + plugin configs
- layout.py: pack algorithm, item placement, grid system
- plugins/: clock, weather, system, spotify, strava, gmail, minimax, hello
- network_watchdog.py: WiFi AP/client mode management
- waveshare_epd_init.py: vendor driver stub
2026-08-26 14:12:43 +04:00

28 lines
968 B
Python

"""Demo-Plugin: konfigurierbarer Text."""
import os, sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
from plugins.base import Widget
from palette import fill_for, measure, fit_font, centered_text
class Widget(Widget):
name = "hello"
label = "Hello / Demo"
description = "Zeigt einen konfigurierbaren Text. Responsiv."
category = "general"
config_schema = [
{"key": "text", "label": "Text", "type": "string", "default": "Hello!"},
{"key": "color", "label": "Farbe", "type": "select",
"choices": ["fg", "info", "ok", "warn", "alert", "accent"], "default": "fg"},
]
default_config = {"text": "Hello!", "color": "fg"}
def fetch(self):
return {}
def render(self, draw, fonts, x, y, w, h):
text = self.cfg("text", "Hello!")
font = fit_font(draw, text, fonts, w - 16, h - 16)
centered_text(draw, text, x, y, w, h, font, fill_for(self.cfg("color", "fg")))