Add window class for Abode binary sensors (#32854)
* Add window class for binary sensor
This commit is contained in:
parent
c1908d16b5
commit
8d68f34650
1 changed files with 6 additions and 1 deletions
|
@ -1,7 +1,10 @@
|
|||
"""Support for Abode Security System binary sensors."""
|
||||
import abodepy.helpers.constants as CONST
|
||||
|
||||
from homeassistant.components.binary_sensor import BinarySensorDevice
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DEVICE_CLASS_WINDOW,
|
||||
BinarySensorDevice,
|
||||
)
|
||||
|
||||
from . import AbodeDevice
|
||||
from .const import DOMAIN
|
||||
|
@ -38,4 +41,6 @@ class AbodeBinarySensor(AbodeDevice, BinarySensorDevice):
|
|||
@property
|
||||
def device_class(self):
|
||||
"""Return the class of the binary sensor."""
|
||||
if self._device.get_value("is_window") == "1":
|
||||
return DEVICE_CLASS_WINDOW
|
||||
return self._device.generic_type
|
||||
|
|
Loading…
Add table
Reference in a new issue