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

View File

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