Merge pull request #14831 from home-assistant/sim-sensor

Limit sensor.simulated to 3 decimals (fixes #14773)
This commit is contained in:
Diogo Gomes authored and GitHub committed 2018-06-05 21:06:11 +01:00
commit 4bccb0d2a1
2 files changed
+17 -23

No files matched your search

+1 -1
View File
@@ -100,7 +100,7 @@ class SimulatedSensor(Entity):
else:
periodic = amp * (math.sin((2*math.pi*time_delta/period) + phase))
noise = self._random.gauss(mu=0, sigma=fwhm)
return mean + periodic + noise
return round(mean + periodic + noise, 3)
async def async_update(self):
"""Update the sensor."""