From 03fca52345748a1f6b37f71088185ff6a208e9d3 Mon Sep 17 00:00:00 2001 From: Kuba Orlik Date: Fri, 16 Aug 2024 23:38:52 +0200 Subject: [PATCH] Alignment --- src/back/routes/dashboard.sreact.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/back/routes/dashboard.sreact.tsx b/src/back/routes/dashboard.sreact.tsx index 4b5ebf8..f1f96ca 100644 --- a/src/back/routes/dashboard.sreact.tsx +++ b/src/back/routes/dashboard.sreact.tsx @@ -31,7 +31,9 @@ type State = { async function with_unit(s: HA_RESPONSE | Promise) { s = await s; - return `${s.state}${s.attributes.unit_of_measurement as string}`; + return `${parseFloat(s.state).toFixed(1)}${ + s.attributes.unit_of_measurement as string + }`; } async function arrow(entity: string) { @@ -69,8 +71,8 @@ export default new (class DashboardPage extends StatefulPageTemperatura na balkonie: - {with_unit(get_state("input_number.balkon_average"))} {arrow("sensor.balkon_temperature_derivative")} + {with_unit(get_state("input_number.balkon_average"))} @@ -78,10 +80,10 @@ export default new (class DashboardPage extends StatefulPageTemperatura w salonie: + {arrow("sensor.temperatura_w_salonie_derivative")} {with_unit( get_state("sensor.ewelink_th01_temperature") )} - {arrow("sensor.temperatura_w_salonie_derivative")} @@ -97,8 +99,8 @@ export default new (class DashboardPage extends StatefulPageTemperatura na strychu - {with_unit(get_state("sensor.strych_temperature_3"))} {arrow("sensor.strych_temperature_derivative")} + {with_unit(get_state("sensor.strych_temperature_3"))}