mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Added sensor state rounding (#8499)
This commit is contained in:
parent
cca0d3ed44
commit
1a1571cd52
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user