Frontend: Thermostat card decimals different

Created on 12 Nov 2019  路  13Comments  路  Source: home-assistant/frontend

Checklist:

  • [x] I updated to the latest version available
  • [x] I cleared the cache of my browser

Home Assistant release with the issue:
101.3

Last working Home Assistant release (if known):
N/A

UI (States or Lovelace UI?):
Lovelace

Browser and Operating System:
Chrome 78/Docker

Description of problem:
The current temperature is displayed without a decimal value, but the set temperature is displayed with a decimal. They should be consistent within the same card. I'd personally prefer just the integer, but I'd be happy as long as they are consistent.

image
image

Javascript errors shown in the web inspector (if applicable):
N/A

Additional information:
N/A

bug

All 13 comments

My thermostat cards display decimals for the current temperature when the decimal is not equal to 0. I believe that decimals are important especially if it is in Celsius. I don't think it is qualified as a bug.

I'm fine with that behavior, I'd just like it to be consistent. So if the decimal is hidden if zero for the current temperature, it should be the same for the set temperature(s).

I'm fine with that behavior, I'd just like it to be consistent. So if the decimal is hidden if zero for the current temperature, it should be the same for the set temperature(s).

I like consistency too but do not see the issue in this particular case.
What if the current temperature will show a decimal, e.g. 22.5掳C, but your set temperature would be 23掳C, still would be inconsistent.

I don't see that as inconsistent; it would just be showing as many places as are needed. It would also improve the function for 掳F, where most thermostats do not report past the integer, so there is no need to show the decimal at all (as is the case with my screenshots above).

It looks like pull request #4221 would fix this.

My PR relies on thermostat specifications: if it declares whole integer as temperature step, then the card report current and set temperatures consistently. If it is not declared, uses the default logic.

That's a better solution than just hiding/showing depending on the value.

That's a better solution than just hiding/showing depending on the value.

I disagree that it is a better solution, it will worsen the interface.
I don't see the point to show a decimal in the current temperature when it is equal to 0. You might want to not show 0 as a decimal in set temperature if it is so important.

My PR relies on thermostat specifications: if it declares whole integer as temperature step, then the card report current and set temperatures consistently. If it is not declared, uses the default logic.

Even if thermostat cannot be set using a decimal, e.g. 0.5掳C, it doesn't mean that not displaying it in the current temperature is correct.
22掳C, 22.5掳C and 23掳C are three differences in temperature.

My PR relies on thermostat specifications: if it declares whole integer as temperature step, then the card report current and set temperatures consistently. If it is not declared, uses the default logic.

Even if thermostat cannot be set using a decimal, e.g. 0.5掳C, it doesn't mean that not displaying it in the current temperature is correct.
22掳C, 22.5掳C and 23掳C are three differences in temperature.

I did not express myself clearly. The behavior of the "current temperature" parameter is in no way modified by my code.
I simply took the step value, already used in the slider, to consistently show the "set temperature" parameter. Therefore, if the thermostat has one-degree steps, the value shown will be integer.

Thank you for explanation, @bannhead
Now it sounds much better and makes sense :)

If you like it could you remove the downvote please? 馃檪

Closed by #4221 in 0.103

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TheZoker picture TheZoker  路  3Comments

move[bot] picture move[bot]  路  3Comments

agneevX picture agneevX  路  3Comments

aaron9060 picture aaron9060  路  3Comments

Lopton picture Lopton  路  4Comments