Kiosk Satellite Bridge
Subsystem:
window.lcards.core.kioskSatelliteBridgeClass:KioskSatelliteBridge(src/core/services/KioskSatelliteBridge.js, extendsBaseService) Backend:custom_components/lcards/palette.py,lcards/palette/getinwebsocket_api.py
Overview
Native apps on a Kiosk Satellite kiosk, such as the LCARdS voice skin plugin, draw outside the dashboard's WebView and can't read its CSS. The bridge gives them the dashboard's colours: when the page runs inside Kiosk Satellite it resolves the colours the dashboard draws with into concrete #rrggbb values and stores them in this device's record, where an app finds them by the LCARdS device name.
| Step | Where | What |
|---|---|---|
| Resolve | KioskSatelliteBridge.resolve() | Each palette role from its source, read on the visible view's container when the view has its own theme, else on the page root |
| Write | deviceIdentityManager.writeDeviceData({ palette }, { replace: true }) | lcards/storage/device/set; only when the colours, alert mode or theme changed |
| Announce | _announce_palette() in websocket_api.py | lcards_event {action: palette_changed, device_name} when a device write changed what palette/get returns |
| Read | lcards/palette/get {device_name} | { device_name, palette, last_seen } for the most recently seen device with that name |
The bridge runs only when window.kioskSatellite exists and the integration advertises kiosk_palette in lcards/info capabilities. It is a lazy chunk: LCARdSCore imports it only inside Kiosk Satellite, so window.lcards.core.kioskSatelliteBridge is null on every other dashboard.
Palette Roles
| Role | Source | Used for (voice skin) |
|---|---|---|
structure | theme:colors.ui.primary | Sweeps, elbows, bars |
structure2 | theme:colors.ui.secondary | The second structure colour |
dark | theme:colors.ui.quaternary | Inactive blocks, empty segments |
emphasis | theme:colors.ui.tertiary | Accent: titles, the lit phase |
data | theme:colors.grid.cascadeStart | Live readings, the voice level while listening |
data2 | var(--lcars-ui-accent-color, var(--lcars-orange, var(--lcards-orange-medium))) | Readings while the assistant answers: the theme accent (orange in the classic themes, the accent colour in the LCARdS Picard variants) |
text | theme:colors.grid.cascadeEnd | The conversation |
alert | theme:colors.alert.red | The warning end of a band |
The roles follow the theme, the token overrides and the alert mode on screen, because each source is resolved with resolveColor(source, { concrete: true, element }) at the moment of writing (PALETTE_SOURCES in the bridge).
Stored in the device record:
{
"palette": {
"colors": { "structure": "#9fa5bd", "structure2": "#656b83", "dark": "#30374a", "emphasis": "#e7432a",
"data": "#93e1ff", "data2": "#ff9d6e", "text": "#dfe1e8", "alert": "#dd4444" },
"alert_mode": "green_alert",
"theme": "LCARS Picard",
"updated": "2026-12-01T23:10:00.000Z"
}
}When It Writes
The bridge re-resolves after a change has settled (600 ms) and writes only when the palette differs from the last one written (samePalette(), the updated stamp aside):
- Alert mode:
themeManager.subscribeToAlertMode(), plus a second pass at 1.6 s for themed views and sections that shift a little later. - Token overrides: the
lcards:theme-overrides-changedwindow event. - Home Assistant theme or dark mode:
updateHass()compareshass.themesandhass.selectedTheme. - Navigation:
location-changed, since a view can carry its own theme.
A targeted alert (lcards.red_alert with target_device_names) needs nothing extra: the dashboard applies it, so the next palette carries it.
Backend
palette.py holds the rules as pure functions (node test tests/support/palette.test.js runs them in python3):
clean_palette(): only the known roles with#rrggbbvalues, and thealert_mode,themeandupdatedstrings (64 characters at most). Anything else in the record never leaves it.palette_for_name(): matchesdisplay_namewith case and surrounding spaces ignored; with several devices of one name, the most recentlast_seenwins.palette_change(): a write announcespalette_changedwhen the cleaned palette changed, or when the device was renamed while it has a palette (readers by the new name refetch).
lcards/palette/get is open to every signed-in user: the plugin runs as the Home Assistant user of Kiosk Satellite's token, and colours aren't sensitive. Both storage/device/set and the admin storage/devices/set announce changes. The event reaches apps through lcards/subscribe, which non-admin users may open; dashboards ignore the action.
Device Name
An app finds the palette by the LCARdS device name (display_name), not the device id it can't know. The voice skin uses its "LCARdS device name" setting, or Kiosk Satellite's own device name when that is empty. The Config Panel's Users & Devices tab offers the kiosk's name as this device's name when the page runs in Kiosk Satellite (deviceIdentityManager.kioskName(), from kioskSatellite.getDeviceInfo()), so both names can match in one tap. It never renames on its own.
Debugging
const bridge = window.lcards.core.kioskSatelliteBridge;
bridge.active // sharing the palette on this page
bridge.resolve() // the palette it would write now
bridge.palette // the palette last written
await bridge.publish()From any browser: hass.connection.sendMessagePromise({ type: 'lcards/palette/get', device_name: 'Kitchen Tablet' }).
See Also
- Device Identity: the record the palette lives in, and the device name
- Theme System: tokens, overrides and alert modes
- Colour resolution