Use enums in ping (#62066)
This commit is contained in:
parent
42fab1bb51
commit
a5cf783e6a
1 changed files with 3 additions and 3 deletions
|
@ -13,8 +13,8 @@ from icmplib import NameLookupError, async_ping
|
|||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DEVICE_CLASS_CONNECTIVITY,
|
||||
PLATFORM_SCHEMA,
|
||||
BinarySensorDeviceClass,
|
||||
BinarySensorEntity,
|
||||
)
|
||||
from homeassistant.const import CONF_HOST, CONF_NAME, STATE_ON
|
||||
|
@ -99,9 +99,9 @@ class PingBinarySensor(RestoreEntity, BinarySensorEntity):
|
|||
return self._available
|
||||
|
||||
@property
|
||||
def device_class(self) -> str:
|
||||
def device_class(self) -> BinarySensorDeviceClass:
|
||||
"""Return the class of this sensor."""
|
||||
return DEVICE_CLASS_CONNECTIVITY
|
||||
return BinarySensorDeviceClass.CONNECTIVITY
|
||||
|
||||
@property
|
||||
def is_on(self) -> bool:
|
||||
|
|
Loading…
Add table
Reference in a new issue