Added sensor state rounding (#8499)

This commit is contained in:
Kevin Fronczak 2017-07-17 13:21:41 -04:00 committed by Fabian Affolter
parent cca0d3ed44
commit 1a1571cd52

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