Skip to content

Commit

Permalink
Merge pull request #113 from quimnut/develop
Browse files Browse the repository at this point in the history
check for number before rounding on temps
  • Loading branch information
kevinelliott authored Sep 17, 2024
2 parents 7874f69 + 9739440 commit 41e023c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion templates/static/node.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@
{% if node.telemetry.temperature %}
<span class="mr-4 align-middle" title="Temperature">
<img src="images/icons/temperature.svg" alt="Temperature" class="w-4 h-4 inline-block align-middle">
{{ node.telemetry.temperature | round(1) }}&deg;C
{% if node.telemetry.temperature is number %}
{{ node.telemetry.temperature | round(1) }}&deg;C
{% else %}
{{ node.telemetry.temperature }}
{% endif %}
</span>
{% endif %}
{% if node.telemetry.humidity %}
Expand Down
6 changes: 5 additions & 1 deletion templates/static/telemetry.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,11 @@
</td>
<td class="hidden lg:table-cell p-1 border border-gray-400 text-nowrap" align=right>
{% if item.payload.temperature is defined %}
{{ item.payload.temperature | round(2) }} &deg;C
{% if item.payload.temperature is number %}
{{ item.payload.temperature | round(2) }}&deg;C
{% else %}
{{ item.payload.temperature }}
{% endif %}
{% endif %}
</td>
<td class="hidden lg:table-cell p-1 border border-gray-400 text-nowrap" align=right>
Expand Down

0 comments on commit 41e023c

Please sign in to comment.