fix: select native variables by datatype and explain rejected links

This commit is contained in:
jhartworks committed 2026-11-12 10:14:19 +01:00
1 parent 4967dd7950
commit 8c6b23bd22
29 files changed
+2031 -1790

No files matched your search

@@ -99,11 +99,11 @@ export function renderDeviceForm(host: EditorHost, placed: Placement, actions: D
${entityName(host.hass, placed.entity_id)}
</p>
<div class="nf-form">
${kind === "cover" ? entityField(host, t("cover_tilt_entity"), placed.cover_tilt ?? null, undefined, entityOptions(host.hass, (id) => id.startsWith("cover.")), (v) => set({ cover_tilt: v && v !== "none" ? v : null })) : nothing}
${kind === "cover" ? entityField(host, t("cover_tilt_entity"), placed.cover_tilt ?? null, undefined, entityOptions(host.hass, (id) => id.startsWith("cover.")), (v) => set({ cover_tilt: v && v !== "none" ? v : null }), { types: [1, 2], role: "cover" }) : nothing}
${kind === "cover" ? html`
${checkField(host, t("cover_direction_invert"), !!placed.cover_inverted, (on) => set({ cover_inverted: on || undefined }))}
${checkField(host, t("cover_tilt_direction_invert"), !!placed.cover_tilt_inverted, (on) => set({ cover_tilt_inverted: on || undefined }))}
${entityField(host, t("cover_position_entity"), placed.position ?? null, undefined, entityOptions(host.hass, (id) => isPositionVariable(host.hass, id)), (v) => set({ position: v && v !== "none" ? v : null }))}
${entityField(host, t("cover_position_entity"), placed.position ?? null, undefined, entityOptions(host.hass, (id) => isPositionVariable(host.hass, id)), (v) => set({ position: v && v !== "none" ? v : null }), { types: [1, 2] })}
${placed.position ? checkField(host, t("cover_position_invert"), !!placed.position_inverted, (on) => set({ position_inverted: on || undefined })) : nothing}
${hint(t("cover_direction_hint"), "nf-wide")}` : nothing}
${light ? html`${selectField(host, t("lamp_mount"), mount, lampMounts, mountChange, { wide: true })}${glowField(host, placed.glow_scale, (v) => set({ glow_scale: v }))}` : nothing}