From e3354895f859ed75eb3c05f8c56a075ac262b0e7 Mon Sep 17 00:00:00 2001 From: springstan <46536646+springstan@users.noreply.github.com> Date: Wed, 2 Sep 2020 19:59:21 +0200 Subject: [PATCH] Round sensor readings for bom (#39513) --- homeassistant/components/bom/sensor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/bom/sensor.py b/homeassistant/components/bom/sensor.py index 59ee8027180..a32b36796de 100644 --- a/homeassistant/components/bom/sensor.py +++ b/homeassistant/components/bom/sensor.py @@ -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.