feat(backend): customer display looks on the media library, one per display (platform-v2 step 5.3)
- display_looks (Alembic 0028): named idle screens, one default; config is
the 3.4 design with pictures as media library ids. 0028 turns the setting
customer_display.idle into the look "Main" and moves its data/display_media
pictures into the library (the old folder stays on disk).
- A display shows the look in its device config `look` (ref ConfigField,
choices_from "display_looks", validated in device_config) or the default.
- /api/display/looks (GET also for core.devices.manage), POST, PUT,
POST /{id}/default, DELETE (not the default; its displays go back to it);
/api/display/displays and PUT /displays/{id}/look. A change sends
display.settings only to the displays showing that look.
- /api/display/settings, /api/display/media* and their error codes are gone;
GET /api/display/state keeps its shape (logo card size, image/slides full).
- Looks register their media usage (a picture in a look can't be deleted).
- tests: test_customer_display.py (7, incl. two displays two slideshows and
the 0028 data move); 501 passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
"""Module manifest — see core/modules/model.py and APPS_PLATFORM §4."""
|
||||
from core.modules.model import DeviceApp, Limit, Module, Mount, Perm, SettingDef
|
||||
from core.modules.model import ConfigField, DeviceApp, Limit, Module, Mount, Perm
|
||||
|
||||
MODULE = Module(
|
||||
key='customer_display',
|
||||
kind='app',
|
||||
name='Customer display',
|
||||
description='Screen facing the customer at a counter POS: the sale, the total, the change, and an idle screen the venue designs (plan step 3.4).',
|
||||
description='Screen facing the customer at a counter POS: the sale, the total, the change, and an idle screen (a look) the venue designs; each display can show its own (plan steps 3.4, 5.3).',
|
||||
depends=('pos_counter',),
|
||||
permissions=(
|
||||
Perm('customer_display.manage', 'Set up the customer display (idle screen, images)', roles=('owner', 'store_manager')),
|
||||
@@ -13,11 +13,11 @@ MODULE = Module(
|
||||
limits=(
|
||||
Limit('devices', 'Number of customer displays', free=0, licensed_default=1),
|
||||
),
|
||||
settings=(
|
||||
SettingDef('customer_display.idle', '{}', 'What customer displays show between sales: style (name, logo, name_logo, blank, image, slideshow, qr), message, images, slide seconds, QR target, theme. Edited in Settings > Customer display.', type='json'),
|
||||
),
|
||||
routers=(
|
||||
Mount('routers.customer_display', '/api/display'),
|
||||
),
|
||||
device_app=DeviceApp(login_modes=('none',), scope=()),
|
||||
device_app=DeviceApp(login_modes=('none',), scope=(), config=(
|
||||
# Its idle screen: one of the venue's looks (Settings > Customer display); none = the default
|
||||
ConfigField('look', 'ref', default=None, choices_from='display_looks'),
|
||||
)),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user