Use new DeviceClass enums in lutron_caseta (#61887)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-12-15 15:17:18 +01:00 committed by GitHub
parent b5d54d9bb1
commit 232d793661
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -2,7 +2,7 @@
from pylutron_caseta import OCCUPANCY_GROUP_OCCUPIED
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_OCCUPANCY,
BinarySensorDeviceClass,
BinarySensorEntity,
)
@ -35,7 +35,7 @@ class LutronOccupancySensor(LutronCasetaDevice, BinarySensorEntity):
@property
def device_class(self):
"""Flag supported features."""
return DEVICE_CLASS_OCCUPANCY
return BinarySensorDeviceClass.OCCUPANCY
@property
def is_on(self):

View File

@ -3,12 +3,12 @@ import logging
from homeassistant.components.cover import (
ATTR_POSITION,
DEVICE_CLASS_SHADE,
DOMAIN,
SUPPORT_CLOSE,
SUPPORT_OPEN,
SUPPORT_SET_POSITION,
SUPPORT_STOP,
CoverDeviceClass,
CoverEntity,
)
@ -58,7 +58,7 @@ class LutronCasetaCover(LutronCasetaDevice, CoverEntity):
@property
def device_class(self):
"""Return the device class."""
return DEVICE_CLASS_SHADE
return CoverDeviceClass.SHADE
async def async_stop_cover(self, **kwargs):
"""Top the cover."""