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
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import (
|
from homeassistant.components.binary_sensor import (
|
||||||
DEVICE_CLASS_CONNECTIVITY,
|
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
|
BinarySensorDeviceClass,
|
||||||
BinarySensorEntity,
|
BinarySensorEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.const import CONF_HOST, CONF_NAME, STATE_ON
|
from homeassistant.const import CONF_HOST, CONF_NAME, STATE_ON
|
||||||
|
@ -99,9 +99,9 @@ class PingBinarySensor(RestoreEntity, BinarySensorEntity):
|
||||||
return self._available
|
return self._available
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> BinarySensorDeviceClass:
|
||||||
"""Return the class of this sensor."""
|
"""Return the class of this sensor."""
|
||||||
return DEVICE_CLASS_CONNECTIVITY
|
return BinarySensorDeviceClass.CONNECTIVITY
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_on(self) -> bool:
|
def is_on(self) -> bool:
|
||||||
|
|
Loading…
Add table
Reference in a new issue