Round sensor readings for bom (#39513)
This commit is contained in:
1 parent
5fafaa3c4f
commit
e3354895f8
1 file changed
+5
-1
@@ -231,7 +231,11 @@ class BOMCurrentData:
|
||||
through the entire BOM provided dataset.
|
||||
"""
|
||||
condition_readings = (entry[condition] for entry in self._data)
|
||||
return next((x for x in condition_readings if x != "-"), None)
|
||||
reading = next((x for x in condition_readings if x != "-"), None)
|
||||
|
||||
if isinstance(reading, (int, float)):
|
||||
return round(reading, 2)
|
||||
return reading
|
||||
|
||||
def should_update(self):
|
||||
"""Determine whether an update should occur.
|
||||
|
||||
Reference in new issue
Block a user