Files
houseplan-card/src/zigbee-topology-overlay-bridge.ts
T
Matysh 565acb6046 Fix Zigbee topology layer order
Issue: #464
User-Visible: yes
2026-09-06 00:48:54 +03:00

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>`;
}