Skip to content

Commit

Permalink
Merge branch 'master' into jeremypoulter/issue29
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremypoulter committed Jul 6, 2024
2 parents 0d78a55 + d098e00 commit e914b2d
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 133 deletions.
126 changes: 21 additions & 105 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"@vitejs/plugin-legacy": "^4.1.1",
"bulma": "^0.9.4",
"rollup-plugin-visualizer": "^5.12.0",
"sass": "^1.77.4",
"svelte": "^4.2.17",
"svelte-preprocess": "^5.1.4",
"terser": "^5.31.0",
"sass": "^1.77.6",
"svelte": "^4.2.18",
"svelte-preprocess": "^6.0.1",
"terser": "^5.31.1",
"vite": "^4.5.3",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-pwa": "^0.20.0",
Expand Down
15 changes: 8 additions & 7 deletions src/components/blocks/configuration/Dev.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
if (res=="error") {
button_send_state = "error"
return false
}
}
else {
button_send_state = "ok"
rapi_cmd_result.push(res)
Expand All @@ -70,7 +70,7 @@
button_export_state = "loading"
// get usefull data
let data = {}
// copy stores
data.target = {...$claims_target_store}
// get claims store not cached here
Expand All @@ -87,7 +87,7 @@
data.config = {...$config_store}
data.limits = {...$limit_store}
data.tesla = {...$tesla_store}
data.uistates = {...$uistates_store}
Expand Down Expand Up @@ -121,9 +121,10 @@
<div class="mb-2">
<div>
<div class="is-size-7 has-text-left my-2 mx-2">
{#each rapi_cmd_result as { cmd, ret } }
&gt; {cmd} <br>
&lt; {ret} <br>
{#each rapi_cmd_result as { cmd, ret, error } }
&gt; <span class="rapi-cmd">{cmd}</span><br>
&lt; {#if ret !== undefined}<span class="rapi-res">{ret}</span>{/if}
{#if error !== undefined}<span class="rapi-error">{error}</span>{/if} <br>
{/each}
</div>
<form on:submit|preventDefault={send_rapi_cmd}>
Expand Down Expand Up @@ -155,4 +156,4 @@
{#if opened}
<Terminal mode={mode} bind:opened={opened}/>
{/if}
<!-- </Modal> -->
<!-- </Modal> -->
12 changes: 6 additions & 6 deletions src/components/blocks/monitoring/Data.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { _ } from 'svelte-i18n'
import {status_store} from "../../../lib/stores/status.js"
import { derived} from "svelte/store"
import {round, s2mns} from "../../../lib/utils.js"
import {round, temp_round, s2mns} from "../../../lib/utils.js"
import {sec2time, displayRange} from "../../../lib/utils.js"
let evelapsed = derived(uistates_store, store => s2mns(store.vehicle_state_update))
Expand All @@ -29,10 +29,10 @@
{name: $_("monitoring-sensors-current"), value: $status_store.amp/1000, unit: $_("units.A")},
{name: $_("monitoring-sensors-voltage"), value: $status_store.voltage, unit: $_("units.V")},
{name: $_("monitoring-sensors-evsetemp"), value: round($status_store.temp/10,1), unit: $_("units.C")},
{name: "temp1", value: !$status_store.temp1.isNaN?round($status_store.temp1/10,1):"", unit: $_("units.C")},
{name: "temp2", value: !$status_store.temp2.isNaN?round($status_store.temp2/10,1):"", unit: $_("units.C")},
{name: "temp3", value: !$status_store.temp3.isNaN?round($status_store.temp3/10,1):"", unit: $_("units.C")},
{name: "temp4", value: !$status_store.temp3.isNaN?round($status_store.temp4/10,1):"", unit: $_("units.C")},
{name: "temp1", value: temp_round($status_store.temp1), unit: $_("units.C")},
{name: "temp2", value: temp_round($status_store.temp2), unit: $_("units.C")},
{name: "temp3", value: temp_round($status_store.temp3), unit: $_("units.C")},
{name: "temp4", value: temp_round($status_store.temp4), unit: $_("units.C")},
{name: $_("monitoring-sensors-sensorscale"), value: $config_store.scale},
{name: $_("monitoring-sensors-sensoroffset"), value: $config_store.offset}
]
Expand Down Expand Up @@ -84,4 +84,4 @@
<Expandable data={data_vehicle} bind:expanded={expanded.vehicle} on:message={handleMessage} />
{/if}
<Expandable data={data_service} bind:expanded={expanded.service} on:message={handleMessage} />
</div>
</div>
2 changes: 1 addition & 1 deletion src/lib/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@
"missing-ohm": "Ohm Key is missing"
},
"dev": {
"rapi-cmd": "Rapi Commands",
"rapi-cmd": "RAPI Commands",
"send": "Send",
"clear": "Clear",
"consoles": "Consoles",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@
"missing-ohm": "Falta Clave Ohm"
},
"dev": {
"rapi-cmd": "Comando Rapi",
"rapi-cmd": "Comando RAPI",
"send": "enviar",
"clear": "Limpiar",
"consoles": "Consolas",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@
"missing-ohm": "Clef Ohm manquante"
},
"dev": {
"rapi-cmd": "Commandes Rapi",
"rapi-cmd": "Commandes RAPI",
"send": "Envoyer",
"clear": "Effacer",
"consoles": "Consoles",
Expand Down
9 changes: 8 additions & 1 deletion src/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ export function round(value, precision = null) {
return Math.round(value * multiplier) / multiplier;
}

export function temp_round(value) {
if (isNaN(value)) {
return ""
}
return round(value/10,1)
}

export let getBreakpoint = function () {
const mobilemini = 410
const mobile = 640
Expand Down Expand Up @@ -488,4 +495,4 @@ export function compareVersion(last, old) {
if (last [i] < old[i]) return -1
}
return last.length == old.length ? 0 : (last.length < old.length ? -1 : 1)
}
}
Loading

0 comments on commit e914b2d

Please sign in to comment.