Add TRMNL e-ink feed endpoint /trmnl.json
This commit is contained in:
@@ -14,6 +14,7 @@ from . import db
|
|||||||
from .config import settings
|
from .config import settings
|
||||||
from .generator import generation_exhausted, run_generation, today_local
|
from .generator import generation_exhausted, run_generation, today_local
|
||||||
from .templates import CSS, PAGE_TEMPLATE
|
from .templates import CSS, PAGE_TEMPLATE
|
||||||
|
from .trmnl import trmnl_endpoint
|
||||||
|
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
level=logging.INFO,
|
level=logging.INFO,
|
||||||
@@ -134,6 +135,12 @@ def index():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/trmnl.json")
|
||||||
|
def trmnl(request: Request):
|
||||||
|
"""JSON feed for TRMNL e-ink devices (polling strategy)."""
|
||||||
|
return trmnl_endpoint(request)
|
||||||
|
|
||||||
|
|
||||||
@app.get("/health")
|
@app.get("/health")
|
||||||
def health():
|
def health():
|
||||||
today = today_local()
|
today = today_local()
|
||||||
|
|||||||
Reference in New Issue
Block a user