mirror of
https://github.com/home-assistant/core.git
synced 2026-05-03 19:41:15 +02:00
Round sensor readings for bom (#39513)
This commit is contained in:
@@ -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