{#if valvesSpec && Object.keys(valvesSpec?.properties ?? {}).length} {#each Object.keys(valvesSpec.properties) as property, idx}
{valvesSpec.properties[property].title} {#if (valvesSpec?.required ?? []).includes(property)} *required {/if}
{#if (valves[property] ?? null) !== null}
{#if valvesSpec.properties[property]?.enum ?? null} {:else if (valvesSpec.properties[property]?.type ?? null) === 'boolean'}
{valves[property] ? $i18n.t('Enabled') : $i18n.t('Disabled')}
{ dispatch('change'); }} />
{:else if (valvesSpec.properties[property]?.type ?? null) !== 'string'} { dispatch('change'); }} /> {:else if valvesSpec.properties[property]?.input ?? null} {#if valvesSpec.properties[property]?.input?.type === 'color'}
{ // Convert the color value to uppercase immediately valves[property] = e.target.value.toUpperCase(); dispatch('change'); }} />
{ dispatch('change'); }} />
{:else if valvesSpec.properties[property]?.input?.type === 'map'}
{ valves[property] = value; dispatch('change'); }} /> {#if valves[property]} { dispatch('change'); }} /> {/if}
{/if} {:else} {/if}
{/if} {#if (valvesSpec.properties[property]?.description ?? null) !== null}
{valvesSpec.properties[property].description}
{/if}
{/each} {:else}
{$i18n.t('No valves')}
{/if}