Skip to content

Kiosk Satellite Bridge ​

Subsystem: window.lcards.core.kioskSatelliteBridgeClass: KioskSatelliteBridge (src/core/services/KioskSatelliteBridge.js, extends BaseService) Backend: custom_components/lcards/palette.py, lcards/palette/get in websocket_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.

StepWhereWhat
ResolveKioskSatelliteBridge.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
WritedeviceIdentityManager.writeDeviceData({ palette }, { replace: true })lcards/storage/device/set; only when the colours, alert mode or theme changed
Announce_announce_palette() in websocket_api.pylcards_event {action: palette_changed, device_name} when a device write changed what palette/get returns
Readlcards/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 ​

RoleSourceUsed for (voice skin)
structuretheme:colors.ui.primarySweeps, elbows, bars
structure2theme:colors.ui.secondaryThe second structure colour
darktheme:colors.ui.quaternaryInactive blocks, empty segments
emphasistheme:colors.ui.tertiaryAccent: titles, the lit phase
datatheme:colors.grid.cascadeStartLive readings, the voice level while listening
data2var(--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)
texttheme:colors.grid.cascadeEndThe conversation
alerttheme:colors.alert.redThe 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:

json
{
  "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-changed window event.
  • Home Assistant theme or dark mode: updateHass() compares hass.themes and hass.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 #rrggbb values, and the alert_mode, theme and updated strings (64 characters at most). Anything else in the record never leaves it.
  • palette_for_name(): matches display_name with case and surrounding spaces ignored; with several devices of one name, the most recent last_seen wins.
  • palette_change(): a write announces palette_changed when 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 ​

javascript
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 ​

Released under the MIT License. | About