mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Add window class for Abode binary sensors (#32854)
* Add window class for binary sensor
This commit is contained in:
parent
c1908d16b5
commit
8d68f34650
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user