Make homekit aware of DEVICE_CLASS_GATE (#33936)
This commit is contained in:
parent
9b7e31eca3
commit
8e188d7e75
1 changed files with 2 additions and 1 deletions
|
@ -6,6 +6,7 @@ from zlib import adler32
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components import cover
|
from homeassistant.components import cover
|
||||||
|
from homeassistant.components.cover import DEVICE_CLASS_GARAGE, DEVICE_CLASS_GATE
|
||||||
from homeassistant.components.media_player import DEVICE_CLASS_TV
|
from homeassistant.components.media_player import DEVICE_CLASS_TV
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_DEVICE_CLASS,
|
ATTR_DEVICE_CLASS,
|
||||||
|
@ -200,7 +201,7 @@ def get_accessory(hass, driver, state, aid, config):
|
||||||
device_class = state.attributes.get(ATTR_DEVICE_CLASS)
|
device_class = state.attributes.get(ATTR_DEVICE_CLASS)
|
||||||
features = state.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
|
features = state.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
|
||||||
|
|
||||||
if device_class == "garage" and features & (
|
if device_class in (DEVICE_CLASS_GARAGE, DEVICE_CLASS_GATE) and features & (
|
||||||
cover.SUPPORT_OPEN | cover.SUPPORT_CLOSE
|
cover.SUPPORT_OPEN | cover.SUPPORT_CLOSE
|
||||||
):
|
):
|
||||||
a_type = "GarageDoorOpener"
|
a_type = "GarageDoorOpener"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue