Use new DeviceClass enums in abode (#61244)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
d03b73eb23
commit
40828e221e
2 changed files with 9 additions and 10 deletions
|
@ -2,7 +2,7 @@
|
|||
import abodepy.helpers.constants as CONST
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DEVICE_CLASS_WINDOW,
|
||||
BinarySensorDeviceClass,
|
||||
BinarySensorEntity,
|
||||
)
|
||||
|
||||
|
@ -42,5 +42,5 @@ class AbodeBinarySensor(AbodeDevice, BinarySensorEntity):
|
|||
def device_class(self):
|
||||
"""Return the class of the binary sensor."""
|
||||
if self._device.get_value("is_window") == "1":
|
||||
return DEVICE_CLASS_WINDOW
|
||||
return BinarySensorDeviceClass.WINDOW
|
||||
return self._device.generic_type
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue