diff --git a/homeassistant/components/syncthru/manifest.json b/homeassistant/components/syncthru/manifest.json index bf62738a02e..f70afa5a695 100644 --- a/homeassistant/components/syncthru/manifest.json +++ b/homeassistant/components/syncthru/manifest.json @@ -3,7 +3,7 @@ "name": "Samsung SyncThru Printer", "documentation": "https://www.home-assistant.io/integrations/syncthru", "config_flow": true, - "requirements": ["pysyncthru==0.5.0", "url-normalize==1.4.1"], + "requirements": ["pysyncthru==0.7.0", "url-normalize==1.4.1"], "ssdp": [ { "deviceType": "urn:schemas-upnp-org:device:Printer:1", diff --git a/homeassistant/components/syncthru/sensor.py b/homeassistant/components/syncthru/sensor.py index 6f7f248a924..c9aa6d8de9c 100644 --- a/homeassistant/components/syncthru/sensor.py +++ b/homeassistant/components/syncthru/sensor.py @@ -2,7 +2,7 @@ import logging -from pysyncthru import SyncThru +from pysyncthru import SYNCTHRU_STATE_HUMAN, SyncThru import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA @@ -101,7 +101,7 @@ class SyncThruSensor(Entity): def __init__(self, syncthru, name): """Initialize the sensor.""" - self.syncthru = syncthru + self.syncthru: SyncThru = syncthru self._attributes = {} self._state = None self._name = name @@ -164,7 +164,8 @@ class SyncThruMainSensor(SyncThruSensor): self.syncthru.url, ) self._active = False - self._state = self.syncthru.device_status() + self._state = SYNCTHRU_STATE_HUMAN[self.syncthru.device_status()] + self._attributes = {"display_text": self.syncthru.device_status_details()} class SyncThruTonerSensor(SyncThruSensor): diff --git a/requirements_all.txt b/requirements_all.txt index 66971ebbe57..1498e37fd09 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1668,7 +1668,7 @@ pysuez==0.1.17 pysupla==0.0.3 # homeassistant.components.syncthru -pysyncthru==0.5.0 +pysyncthru==0.7.0 # homeassistant.components.tankerkoenig pytankerkoenig==0.0.6 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 393a99e5e1a..18878a13833 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -782,7 +782,7 @@ pyspcwebgw==0.4.0 pysqueezebox==0.2.4 # homeassistant.components.syncthru -pysyncthru==0.5.0 +pysyncthru==0.7.0 # homeassistant.components.ecobee python-ecobee-api==0.2.7 diff --git a/tests/components/syncthru/test_config_flow.py b/tests/components/syncthru/test_config_flow.py index aac1923caab..8eb72ee264a 100644 --- a/tests/components/syncthru/test_config_flow.py +++ b/tests/components/syncthru/test_config_flow.py @@ -24,6 +24,7 @@ def mock_connection(aioclient_mock): text=""" { \tstatus: { +\thrDeviceStatus: 2, \tstatus1: " Sleeping... " \t}, \tidentity: {