Bump Brother library to version 0.1.20 (#43628)

This commit is contained in:
Maciej Bieniek 2020-11-28 21:17:16 +01:00 committed by GitHub
parent 337b8d279e
commit a4ae2d210e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 12 deletions

View file

@ -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