Add window class for Abode binary sensors (#32854)

* Add window class for binary sensor
This commit is contained in:
shred86 2020-03-16 07:03:42 -07:00 committed by GitHub
parent c1908d16b5
commit 8d68f34650
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,10 @@
"""Support for Abode Security System binary sensors.""" """Support for Abode Security System binary sensors."""
import abodepy.helpers.constants as CONST 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 . import AbodeDevice
from .const import DOMAIN from .const import DOMAIN
@ -38,4 +41,6 @@ class AbodeBinarySensor(AbodeDevice, BinarySensorDevice):
@property @property
def device_class(self): def device_class(self):
"""Return the class of the binary sensor.""" """Return the class of the binary sensor."""
if self._device.get_value("is_window") == "1":
return DEVICE_CLASS_WINDOW
return self._device.generic_type return self._device.generic_type