|
|
|
@ -31,7 +31,9 @@ type State = {
|
|
|
|
|
|
|
|
|
|
async function with_unit(s: HA_RESPONSE | Promise<HA_RESPONSE>) {
|
|
|
|
|
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 StatefulPage<State, typeof actio
|
|
|
|
|
<td style="text-align: right">Temperatura na balkonie:</td>
|
|
|
|
|
<td>
|
|
|
|
|
<strong>
|
|
|
|
|
{with_unit(get_state("input_number.balkon_average"))}
|
|
|
|
|
{arrow("sensor.balkon_temperature_derivative")}
|
|
|
|
|
{with_unit(get_state("input_number.balkon_average"))}
|
|
|
|
|
</strong>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
@ -78,10 +80,10 @@ export default new (class DashboardPage extends StatefulPage<State, typeof actio
|
|
|
|
|
<td style="text-align: right">Temperatura w salonie:</td>
|
|
|
|
|
<td>
|
|
|
|
|
<strong>
|
|
|
|
|
{arrow("sensor.temperatura_w_salonie_derivative")}
|
|
|
|
|
{with_unit(
|
|
|
|
|
get_state("sensor.ewelink_th01_temperature")
|
|
|
|
|
)}
|
|
|
|
|
{arrow("sensor.temperatura_w_salonie_derivative")}
|
|
|
|
|
</strong>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
@ -97,8 +99,8 @@ export default new (class DashboardPage extends StatefulPage<State, typeof actio
|
|
|
|
|
<td style="text-align: right">Temperatura na strychu</td>
|
|
|
|
|
<td>
|
|
|
|
|
<strong>
|
|
|
|
|
{with_unit(get_state("sensor.strych_temperature_3"))}
|
|
|
|
|
{arrow("sensor.strych_temperature_derivative")}
|
|
|
|
|
{with_unit(get_state("sensor.strych_temperature_3"))}
|
|
|
|
|
</strong>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|