Reduce precision in returned values to meaningful digits (#49382)
This commit is contained in:
parent
3cef96e78a
commit
f0cd87e031
1 changed files with 2 additions and 0 deletions
|
@ -290,6 +290,8 @@ class FroniusTemplateSensor(SensorEntity):
|
|||
"""Update the internal state."""
|
||||
state = self.parent.data.get(self._name)
|
||||
self._state = state.get("value")
|
||||
if isinstance(self._state, float):
|
||||
self._state = round(self._state, 2)
|
||||
self._unit = state.get("unit")
|
||||
|
||||
async def async_added_to_hass(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue