Use new enums in sleepiq (#62203)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-12-19 13:15:09 +01:00 committed by GitHub
parent 19fc15c3ac
commit 340ffc96dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,6 @@
"""Support for SleepIQ sensors."""
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_OCCUPANCY,
BinarySensorDeviceClass,
BinarySensorEntity,
)
@ -40,9 +40,9 @@ class IsInBedBinarySensor(SleepIQSensor, BinarySensorEntity):
return self._state is True
@property
def device_class(self):
def device_class(self) -> BinarySensorDeviceClass:
"""Return the class of this sensor."""
return DEVICE_CLASS_OCCUPANCY
return BinarySensorDeviceClass.OCCUPANCY
def update(self):
"""Get the latest data from SleepIQ and updates the states."""