mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-29 03:09:36 +00:00
25 lines
1.1 KiB
TypeScript
25 lines
1.1 KiB
TypeScript
import { html, nothing, type TemplateResult } from 'lit';
|
|
import { zigbeeTopologySettingsOf } from './zigbee-topology-settings';
|
|
import type { HaRegistrySnapshot } from './ha-binding-status';
|
|
import type { DevItem } from './types';
|
|
import type { ZigbeeTopologyHass } from './zigbee-topology-runtime';
|
|
|
|
export function renderZigbeeTopologyOverlay(input: {
|
|
hass: ZigbeeTopologyHass;
|
|
settings: unknown;
|
|
devices: readonly DevItem[];
|
|
registry: HaRegistrySnapshot;
|
|
currentSpace: string;
|
|
spaces?: readonly { id?: unknown; title?: unknown }[];
|
|
viewKey: unknown;
|
|
view: boolean;
|
|
kiosk: boolean;
|
|
}): TemplateResult | typeof nothing {
|
|
if (!input.view || input.kiosk || input.hass?.user?.is_admin !== true
|
|
|| !zigbeeTopologySettingsOf(input.settings).enabled) return nothing;
|
|
void import('./hp-zigbee-topology-overlay');
|
|
return html`<hp-zigbee-topology-overlay aria-hidden="true" .hass=${input.hass} .devices=${input.devices}
|
|
.registry=${input.registry} .currentSpace=${input.currentSpace} .spaces=${input.spaces}
|
|
.viewKey=${input.viewKey}></hp-zigbee-topology-overlay>`;
|
|
}
|