Bump Brother library to version 0.1.20 (#43628)
This commit is contained in:
parent
337b8d279e
commit
a4ae2d210e
5 changed files with 6 additions and 12 deletions
|
@ -1,9 +1,6 @@
|
|||
"""Support for the Brother service."""
|
||||
from datetime import timedelta
|
||||
|
||||
from homeassistant.const import DEVICE_CLASS_TIMESTAMP
|
||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||
from homeassistant.util.dt import utcnow
|
||||
|
||||
from .const import (
|
||||
ATTR_BLACK_DRUM_COUNTER,
|
||||
|
@ -79,8 +76,7 @@ class BrotherPrinterSensor(CoordinatorEntity):
|
|||
def state(self):
|
||||
"""Return the state."""
|
||||
if self.kind == ATTR_UPTIME:
|
||||
uptime = utcnow() - timedelta(seconds=self.coordinator.data.get(self.kind))
|
||||
return uptime.replace(microsecond=0).isoformat()
|
||||
return self.coordinator.data.get(self.kind).isoformat()
|
||||
return self.coordinator.data.get(self.kind)
|
||||
|
||||
@property
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue