Bump pysyncthru to 0.7.0 (#38832)
* Bump pysyncthru version to 0.7.0 This change includes a heavier refactoring, using a more reliable source for the device status and parsing display strings only for additional details * Fix test flow to ensure a status is set
This commit is contained in:
parent
72472cd11f
commit
fceba0bb88
5 changed files with 8 additions and 6 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue