Use enums in senses (#62050)

This commit is contained in:
Robert Hillis 2021-12-16 08:25:12 -05:00 committed by GitHub
parent 65b67d9d91
commit b6ed3e87e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 12 deletions

View file

@ -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):