Update texts and improve power reprenestation

This commit is contained in:
Simon Stürz 2025-11-11 12:34:57 +01:00
parent 643aadeae7
commit ea75705cb0
4 changed files with 21 additions and 9 deletions

View File

@ -658,6 +658,18 @@ class DashboardApp {
if (value === null || value === undefined || value === '') if (value === null || value === undefined || value === '')
return '—'; return '—';
if ((key === 'currentPower' || key === 'sessionEnergy') && typeof value === 'number') {
if (!Number.isFinite(value))
return '—';
const unit = key === 'currentPower' ? 'kW' : 'kWh';
if (key === 'currentPower') {
value = value / 1000;
return `${value.toFixed(2)} ${unit}`;
}
return `${value.toFixed(2)} ${unit}`;
}
if (typeof value === 'boolean') if (typeof value === 'boolean')
return value ? 'Yes' : 'No'; return value ? 'Yes' : 'No';

View File

@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>nymea EV Dash · Help</title> <title>EV Dash · Help</title>
<style> <style>
:root { :root {
--primary-color: #0050a0; --primary-color: #0050a0;
@ -249,7 +249,7 @@
</main> </main>
<footer> <footer>
<span id="appVersion">nymea EV Dash</span> · &copy; 20132025 chargebyte GmbH. All rights reserved. <span id="appVersion">EV Dash</span> · &copy; 2025 chargebyte GmbH. All rights reserved.
</footer> </footer>
<script src="app.js"></script> <script src="app.js"></script>

View File

@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>nymea EV Dash</title> <title>EV Dash</title>
<style> <style>
:root { :root {
--primary-color: #0050a0; --primary-color: #0050a0;
@ -21,7 +21,7 @@
body { body {
margin: 0; margin: 0;
font-family: "Segoe UI", Roboto, sans-serif; font-family: "UniversLTStd", "Segoe UI", Roboto, sans-serif;
background: var(--background-color); background: var(--background-color);
color: var(--text-color); color: var(--text-color);
min-height: 100vh; min-height: 100vh;
@ -422,23 +422,23 @@
<section id="loginOverlay" class="login-view" aria-labelledby="loginTitle"> <section id="loginOverlay" class="login-view" aria-labelledby="loginTitle">
<div class="login-panel"> <div class="login-panel">
<h2 id="loginTitle">Sign in</h2> <h2 id="loginTitle">Sign in</h2>
<p>Authenticate with your nymea credentials to obtain a session token for the dashboard.</p> <p>Please enter your credentials.</p>
<div id="loginError" class="error-message hidden" role="alert"></div> <div id="loginError" class="error-message hidden" role="alert"></div>
<form id="loginForm" autocomplete="on"> <form id="loginForm" autocomplete="on">
<label for="username">Username <label for="username">Username
<input type="text" id="username" name="username" autocomplete="username" required placeholder="nymea user"> <input type="text" id="username" name="username" autocomplete="username" required placeholder="user">
</label> </label>
<label for="password">Password <label for="password">Password
<input type="password" id="password" name="password" autocomplete="current-password" required placeholder="••••••••"> <input type="password" id="password" name="password" autocomplete="current-password" required placeholder="••••••••">
</label> </label>
<p class="helper-text">Tokens remain valid for one hour. Reloading the dashboard reuses an active session automatically.</p> <p class="helper-text">Contact the administrator in order to receive a valid login.</p>
<button type="submit" id="loginButton" class="primary">Sign in</button> <button type="submit" id="loginButton" class="primary">Sign in</button>
</form> </form>
</div> </div>
</section> </section>
<footer> <footer>
<span id="appVersion">nymea EV Dash</span> · &copy; 20132025 chargebyte GmbH. All rights reserved. <span id="appVersion">EV Dash</span> · &copy; 2025 chargebyte GmbH. All rights reserved.
</footer> </footer>
<script src="app.js"></script> <script src="app.js"></script>

View File

@ -328,7 +328,7 @@ QJsonObject EvDashEngine::packCharger(Thing *charger) const
chargerObject.insert("connected", charger->stateValue("connected").toBool()); chargerObject.insert("connected", charger->stateValue("connected").toBool());
chargerObject.insert("chargingCurrent", charger->stateValue("maxChargingCurrent").toDouble()); chargerObject.insert("chargingCurrent", charger->stateValue("maxChargingCurrent").toDouble());
chargerObject.insert("chargingAllowed", charger->stateValue("power").toBool()); chargerObject.insert("chargingAllowed", charger->stateValue("power").toBool());
chargerObject.insert("currentPower", charger->stateValue("currentPower").toBool()); chargerObject.insert("currentPower", charger->stateValue("currentPower").toDouble());
chargerObject.insert("pluggedIn", charger->stateValue("pluggedIn").toBool()); chargerObject.insert("pluggedIn", charger->stateValue("pluggedIn").toBool());
if (charger->hasState("currentVersion")) if (charger->hasState("currentVersion"))