Round sensor readings for bom (#39513)
parent
5fafaa3c4f
commit
e3354895f8
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue