- 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>
34 lines
1.8 KiB
Python
34 lines
1.8 KiB
Python
"""Module manifest — see core/modules/model.py and APPS_PLATFORM §4."""
|
|
from core.modules.model import ConfigField, DeviceApp, Limit, Module, Mount, Perm, SettingDef
|
|
|
|
MODULE = Module(
|
|
key='signage',
|
|
kind='app',
|
|
name='Digital signage',
|
|
description='Menus and promotions on TVs: playlists of menu boards, pictures, videos and texts (phase 5, steps 5.4a-5.6c).',
|
|
permissions=(
|
|
Perm('signage.manage', 'Edit signage content', roles=('owner', 'store_manager', 'staff_manager')),
|
|
),
|
|
limits=(
|
|
Limit('devices', 'Number of signage screens', free=0, licensed_default=1),
|
|
),
|
|
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'),
|
|
ConfigField('orientation', 'enum', default='landscape', choices=('landscape', 'portrait')),
|
|
ConfigField('rotation', 'int', default=0, choices=(0, 90, 180, 270)),
|
|
)),
|
|
)
|