- signage_schedules (Alembic 0030): entries {playlist, days, hours (may pass
midnight), dates, priority} and a fallback playlist. A screen's `schedule`
(ref) wins over its single playlist.
- services/signage_schedule.pick (pure): highest priority, then the most
specific (dates > days > hours), then the later entry; no match → fallback.
- GET /api/signage/screen with a schedule: the schedule (with the venue's time
zone) and every playlist in it, `playlist` = the one playing now, so the
player can switch while the server is down.
- schedule_worker (signage module, 30 s) tells a screen when its pick changes.
- /api/signage/schedules CRUD (playing now, the screens on it); deleting a
playlist takes it out of schedules; changes reach screens through schedules.
- Devices page: a signage screen's Schedule.
- tests: test_signage_schedule.py (6); 526 passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
36 lines
2.1 KiB
Python
36 lines
2.1 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', 'services.signage_schedule:schedule_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'),
|
|
# or a schedule: which playlist plays when (5.4d); it wins over the single playlist
|
|
ConfigField('schedule', 'ref', default=None, choices_from='signage_schedules'),
|
|
ConfigField('orientation', 'enum', default='landscape', choices=('landscape', 'portrait')),
|
|
ConfigField('rotation', 'int', default=0, choices=(0, 90, 180, 270)),
|
|
)),
|
|
)
|