Use enums in senses (#62050)
This commit is contained in:
parent
65b67d9d91
commit
b6ed3e87e0
2 changed files with 13 additions and 12 deletions
|
@ -1,8 +1,11 @@
|
|||
"""Support for monitoring a Sense energy sensor device."""
|
||||
import logging
|
||||
|
||||
from homeassistant.components.binary_sensor import BinarySensorEntity
|
||||
from homeassistant.const import ATTR_ATTRIBUTION, DEVICE_CLASS_POWER
|
||||
from homeassistant.components.binary_sensor import (
|
||||
BinarySensorDeviceClass,
|
||||
BinarySensorEntity,
|
||||
)
|
||||
from homeassistant.const import ATTR_ATTRIBUTION
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
from homeassistant.helpers.entity_registry import async_get_registry
|
||||
|
@ -113,7 +116,7 @@ class SenseDevice(BinarySensorEntity):
|
|||
@property
|
||||
def device_class(self):
|
||||
"""Return the device class of the binary sensor."""
|
||||
return DEVICE_CLASS_POWER
|
||||
return BinarySensorDeviceClass.POWER
|
||||
|
||||
@property
|
||||
def should_poll(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue