From 8d68f34650eb68470113127b9e1a67d2ae753a5b Mon Sep 17 00:00:00 2001 From: shred86 <32663154+shred86@users.noreply.github.com> Date: Mon, 16 Mar 2020 07:03:42 -0700 Subject: [PATCH] Add window class for Abode binary sensors (#32854) * Add window class for binary sensor --- homeassistant/components/abode/binary_sensor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/abode/binary_sensor.py b/homeassistant/components/abode/binary_sensor.py index c4cdadf9bd9..916ed2e2613 100644 --- a/homeassistant/components/abode/binary_sensor.py +++ b/homeassistant/components/abode/binary_sensor.py @@ -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