feat(backend): signage widgets, the message of the day, the weather (platform-v2 step 5.4c)
- Widget on text and menu slides: logo (a picture), name, date (short/long), clock (seconds), message (the venue's or its own text), QR code (ordering / QR menu / a link; the screen gets the link), weather (1-3 days); position (corners, top / bottom bar) and size. Logos count as media usage. - The screen gets `venue`: name, message of the day, weather. - PUT /api/signage/message (one place, every screen told at once). - services/weather.py: the venue's place (town search through /api/signage/weather/places, PUT/DELETE /weather/place, °C/°F), Open-Meteo every 30 min (signage worker), kept in memory; no place, no internet or older than 3 h → weather null and the widget hides. signage.weather_offline when the town search can't reach the service. Checked against the real service. - tests: test_signage_widgets.py (5, a fake Open-Meteo); 520 passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
"""Module manifest — see core/modules/model.py and APPS_PLATFORM §4."""
|
||||
from core.modules.model import ConfigField, DeviceApp, Limit, Module, Mount, Perm
|
||||
from core.modules.model import ConfigField, DeviceApp, Limit, Module, Mount, Perm, SettingDef
|
||||
|
||||
MODULE = Module(
|
||||
key='signage',
|
||||
@@ -15,6 +15,15 @@ MODULE = Module(
|
||||
routers=(
|
||||
Mount('routers.signage', '/api/signage'),
|
||||
),
|
||||
settings=(
|
||||
SettingDef('signage.message', '', 'The message of the day on every signage screen with a message widget (Signage > Message of the day).'),
|
||||
SettingDef('signage.weather.place', '', 'The place whose weather the screens show (picked from a town search in Signage).'),
|
||||
SettingDef('signage.weather.latitude', '', 'Latitude of the weather place.'),
|
||||
SettingDef('signage.weather.longitude', '', 'Longitude of the weather place.'),
|
||||
SettingDef('signage.weather.units', 'celsius', "Temperatures in 'celsius' | 'fahrenheit'", type='enum', choices=('celsius', 'fahrenheit')),
|
||||
),
|
||||
# the weather for the screens' widget, every 30 min while there is internet (5.4c)
|
||||
workers=('services.weather:weather_worker',),
|
||||
device_app=DeviceApp(login_modes=('none',), scope=(), config=(
|
||||
# What it plays and how the TV hangs (5.4a); the editor builds for the screen's shape
|
||||
ConfigField('playlist', 'ref', default=None, choices_from='signage_playlists'),
|
||||
|
||||
Reference in New Issue
Block a user