Use new enums in syncthru (#62399)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-12-20 16:53:50 +01:00 committed by GitHub
parent 75000c317b
commit 23baf6e02a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,8 +4,7 @@ from __future__ import annotations
from pysyncthru import SyncThru, SyncthruState
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_CONNECTIVITY,
DEVICE_CLASS_PROBLEM,
BinarySensorDeviceClass,
BinarySensorEntity,
)
from homeassistant.const import CONF_NAME
@ -77,7 +76,7 @@ class SyncThruBinarySensor(CoordinatorEntity, BinarySensorEntity):
class SyncThruOnlineSensor(SyncThruBinarySensor):
"""Implementation of a sensor that checks whether is turned on/online."""
_attr_device_class = DEVICE_CLASS_CONNECTIVITY
_attr_device_class = BinarySensorDeviceClass.CONNECTIVITY
def __init__(self, syncthru, name):
"""Initialize the sensor."""
@ -93,7 +92,7 @@ class SyncThruOnlineSensor(SyncThruBinarySensor):
class SyncThruProblemSensor(SyncThruBinarySensor):
"""Implementation of a sensor that checks whether the printer works correctly."""
_attr_device_class = DEVICE_CLASS_PROBLEM
_attr_device_class = BinarySensorDeviceClass.PROBLEM
def __init__(self, syncthru, name):
"""Initialize the sensor."""