forked from home-assistant/core
Merge pull request #475 from toddeye/group-state-openclose
Add STATE_OPEN/STATE_CLOSED to groupable states
This commit is contained in:
@@ -12,7 +12,8 @@ from homeassistant.helpers.entity import Entity
|
|||||||
import homeassistant.util as util
|
import homeassistant.util as util
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_ENTITY_ID, STATE_ON, STATE_OFF,
|
ATTR_ENTITY_ID, STATE_ON, STATE_OFF,
|
||||||
STATE_HOME, STATE_NOT_HOME, STATE_UNKNOWN)
|
STATE_HOME, STATE_NOT_HOME, STATE_OPEN, STATE_CLOSED,
|
||||||
|
STATE_UNKNOWN)
|
||||||
|
|
||||||
DOMAIN = "group"
|
DOMAIN = "group"
|
||||||
DEPENDENCIES = []
|
DEPENDENCIES = []
|
||||||
@@ -22,7 +23,8 @@ ENTITY_ID_FORMAT = DOMAIN + ".{}"
|
|||||||
ATTR_AUTO = "auto"
|
ATTR_AUTO = "auto"
|
||||||
|
|
||||||
# List of ON/OFF state tuples for groupable states
|
# List of ON/OFF state tuples for groupable states
|
||||||
_GROUP_TYPES = [(STATE_ON, STATE_OFF), (STATE_HOME, STATE_NOT_HOME)]
|
_GROUP_TYPES = [(STATE_ON, STATE_OFF), (STATE_HOME, STATE_NOT_HOME),
|
||||||
|
(STATE_OPEN, STATE_CLOSED)]
|
||||||
|
|
||||||
|
|
||||||
def _get_group_on_off(state):
|
def _get_group_on_off(state):
|
||||||
|
Reference in New Issue
Block a user