Open Olen opened 1 year ago
Should be able to do something like
var displayVal = hass.formatEntityState(hass.states[sensor[attr]]);
Around line 305. But as we hide the unit on small screens, we would need to split the unit from the number and do some various validations anyway, so maybe this is not really feasible. After all, the WS sends the info from the sensor, so it should be correct. Although #39 could possibly be fixed by this? Are there other ways to get precision for a sensor from the hass-object?
Partial fix in the latest beta. Precision is now fetched gtom formatEntityState, but unit is still fetched from the WS-request.
Replace hard coded labels and units of measurement with https://developers.home-assistant.io/docs/frontend/data#entity-state-formatting
This allows us to simplify the WS data and ensures consistent values.