Added sensor state rounding (#8499)

This commit is contained in:
Kevin Fronczak authored and Fabian Affolter committed 2017-07-17 19:21:41 +02:00
1 parent cca0d3ed44
commit 1a1571cd52
1 file changed
+4 -1
+4 -1
View File
@@ -104,7 +104,10 @@ class PiHoleSensor(Entity):
@property
def state(self):
"""Return the state of the device."""
return self._api.data[self._var_id]
try:
return round(self._api.data[self._var_id], 2)
except TypeError:
return self._api.data[self._var_id]
# pylint: disable=no-member
@property