mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Added sensor state rounding (#8499)
This commit is contained in:
parent
cca0d3ed44
commit
1a1571cd52
@ -104,6 +104,9 @@ class PiHoleSensor(Entity):
|
||||
@property
|
||||
def state(self):
|
||||
"""Return the state of the device."""
|
||||
try:
|
||||
return round(self._api.data[self._var_id], 2)
|
||||
except TypeError:
|
||||
return self._api.data[self._var_id]
|
||||
|
||||
# pylint: disable=no-member
|
||||
|
Loading…
x
Reference in New Issue
Block a user