Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove check that only shows Service Level option on non-EU firmwares #15

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 38 additions & 40 deletions src/components/blocks/configuration/Evse.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
const states_items = [{name: $_("disabled"), value: false}, {name: $_("active"), value: true}]
const service_items = [{name: "Auto", value: 0},{name: "Level 1", value: 1},{name: "Level 2", value: 2}]
const phase_items = [{name: $_("no"), value: false}, {name: $_("yes"), value: true}]

let formdata = {
max_current_soft: {val: 32, status: "", input: undefined, req: false},
default_state: {val: false, status: "", input: undefined, req: false},
Expand All @@ -26,7 +26,7 @@
pause_uses_disabled: {val: null, status: "", input: undefined, req: false},
service: {val: false, status: "", input: undefined, req: false},
led_brightness: {val: "", status: "", input: undefined, req: false}
}
}

let updateFormData = () => {
formdata.max_current_soft.val = $config_store.max_current_soft
Expand All @@ -41,7 +41,7 @@
let setProperty = async (prop) => {
await submitFormData({prop: prop, form: formdata , i18n_path: "config.shaper.missing-"})
}

onMount(()=> {
updateFormData()
mounted = true
Expand All @@ -64,12 +64,12 @@
{@html $_("config.evse.maxcur-help")}
</div>
<div class="is-uppercase has-text-weight-bold is-size-6">{$_("config.evse.maxcur")}</div>
<SliderForm icon="fa6-solid:gauge-high"
bind:value={formdata.max_current_soft.val}
unit={$_("units.A")}
min={$config_store.min_current_hard?$config_store.min_current_hard:6}
max={$config_store.max_current_hard?$config_store.max_current_hard:32}
onchange={()=>setProperty("max_current_soft")}
<SliderForm icon="fa6-solid:gauge-high"
bind:value={formdata.max_current_soft.val}
unit={$_("units.A")}
min={$config_store.min_current_hard?$config_store.min_current_hard:6}
max={$config_store.max_current_hard?$config_store.max_current_hard:32}
onchange={()=>setProperty("max_current_soft")}
/>
</Borders>
</div>
Expand All @@ -84,11 +84,11 @@
{@html $_("config.evse.defaultstate-help")}
</div>
<div class="is-uppercase has-text-weight-bold is-size-6 mb-3">{$_("config.evse.defaultstate")}</div>
<Select
<Select
bind:this={formdata.default_state.input}
bind:value={formdata.default_state.val}
bind:status={formdata.default_state.status}
items={states_items}
bind:value={formdata.default_state.val}
bind:status={formdata.default_state.status}
items={states_items}
onChange={()=>setProperty("default_state")}
/>
</Borders>
Expand All @@ -102,11 +102,11 @@
{@html $_("config.evse.threephase-help")}
</div>
<div class="is-uppercase has-text-weight-bold is-size-6 mb-3">{$_("config.evse.threephase")}</div>
<Select
<Select
bind:this={formdata.is_threephase.input}
bind:value={formdata.is_threephase.val}
bind:status={formdata.is_threephase.status}
items={phase_items}
bind:value={formdata.is_threephase.val}
bind:status={formdata.is_threephase.status}
items={phase_items}
onChange={()=>setProperty("is_threephase")}
/>
</Borders>
Expand All @@ -119,68 +119,66 @@
</div>
<div class="is-uppercase has-text-weight-bold is-size-6 mb-3">{$_("config.evse.random")}</div>
<div class="is-flex is-justify-content-center is-align-items-center">
<div class="inputbox">
<InputForm
is_inline type="number" min=0 max=3600
<div class="inputbox">
<InputForm
is_inline type="number" min=0 max=3600
bind:this={formdata.scheduler_start_window.input}
bind:value={formdata.scheduler_start_window.val}
bind:status={formdata.scheduler_start_window.status}
bind:value={formdata.scheduler_start_window.val}
bind:status={formdata.scheduler_start_window.status}
onChange={()=>setProperty("scheduler_start_window")}
/>
</div>
<div class="ml-2 is-inline-block"> {$_("config.evse.seconds")}</div>
</div>
</Borders>
</div>
{#if !$config_store.firmware.endsWith(".EU") && !$config_store.firmware.endsWith(".T2")}
<div class="my-1 is-flex is-justify-content-center" >
<Borders grow={true}>
<div class="is-uppercase has-text-weight-bold is-size-6 mb-3">{$_("config.evse.service")}</div>
<Select
<Select
bind:this={formdata.service.input}
bind:value={formdata.service.val}
bind:status={formdata.service.status}
items={service_items}
bind:value={formdata.service.val}
bind:status={formdata.service.status}
items={service_items}
onChange={()=>setProperty("service")}
/>
</Borders>
</div>
{/if}
<div class="my-1 is-flex is-justify-content-center" >
<Borders grow={true} has_help={true}>
<div slot="help">
{@html $_("config.evse.pause-help")}
</div>
<div class="is-uppercase has-text-weight-bold is-size-6 mb-3">{$_("config.evse.pause")}</div>
<Switch
name="pausemode"
label="{formdata.pause_uses_disabled.val?"Disable":"Sleep"}"
<Switch
name="pausemode"
label="{formdata.pause_uses_disabled.val?"Disable":"Sleep"}"
bind:this={formdata.pause_uses_disabled.input}
bind:checked={formdata.pause_uses_disabled.val}
bind:status={formdata.pause_uses_disabled.status}
onChange={()=>setProperty("pause_uses_disabled")}
onChange={()=>setProperty("pause_uses_disabled")}
/>
</Borders>
</div>
{#if $config_store.led_brightness != undefined}
<div class="mt-1 is-flex is-justify-content-center " >

<Borders grow={true} has_help>
<div slot="help">
{@html $_("config.evse.led-bn-help")}
</div>
<div class="is-uppercase has-text-weight-bold is-size-6 mb-3">{$_("config.evse.led-bn")}</div>
<SliderForm
icon="ic:outline-light-mode"
bind:value={formdata.led_brightness.val}
min=0 max=255
onchange={()=>setProperty("led_brightness")}
<SliderForm
icon="ic:outline-light-mode"
bind:value={formdata.led_brightness.val}
min=0 max=255
onchange={()=>setProperty("led_brightness")}
/>
</Borders>
</div>
{/if}
</div>
</div>
</div>

</Box>
{/if}
{/if}