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
|
@ -3,7 +3,7 @@
|
|||
"name": "Brother Printer",
|
||||
"documentation": "https://www.home-assistant.io/integrations/brother",
|
||||
"codeowners": ["@bieniu"],
|
||||
"requirements": ["brother==0.1.18"],
|
||||
"requirements": ["brother==0.1.20"],
|
||||
"zeroconf": [{"type": "_printer._tcp.local.", "name":"Brother*"}],
|
||||
"config_flow": true,
|
||||
"quality_scale": "platinum"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -383,7 +383,7 @@ bravia-tv==1.0.8
|
|||
broadlink==0.16.0
|
||||
|
||||
# homeassistant.components.brother
|
||||
brother==0.1.18
|
||||
brother==0.1.20
|
||||
|
||||
# homeassistant.components.brottsplatskartan
|
||||
brottsplatskartan==0.0.1
|
||||
|
|
|
@ -207,7 +207,7 @@ bravia-tv==1.0.8
|
|||
broadlink==0.16.0
|
||||
|
||||
# homeassistant.components.brother
|
||||
brother==0.1.18
|
||||
brother==0.1.20
|
||||
|
||||
# homeassistant.components.bsblan
|
||||
bsblan==0.4.0
|
||||
|
|
|
@ -16,7 +16,7 @@ from homeassistant.const import (
|
|||
from homeassistant.setup import async_setup_component
|
||||
from homeassistant.util.dt import UTC, utcnow
|
||||
|
||||
from tests.async_mock import patch
|
||||
from tests.async_mock import Mock, patch
|
||||
from tests.common import async_fire_time_changed, load_fixture
|
||||
from tests.components.brother import init_integration
|
||||
|
||||
|
@ -39,9 +39,7 @@ async def test_sensors(hass):
|
|||
disabled_by=None,
|
||||
)
|
||||
test_time = datetime(2019, 11, 11, 9, 10, 32, tzinfo=UTC)
|
||||
with patch(
|
||||
"homeassistant.components.brother.sensor.utcnow", return_value=test_time
|
||||
), patch(
|
||||
with patch("brother.datetime", utcnow=Mock(return_value=test_time)), patch(
|
||||
"brother.Brother._get_data",
|
||||
return_value=json.loads(load_fixture("brother_printer_data.json")),
|
||||
):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue