2018-09-26 16:02:05 +00:00
|
|
|
"""Collection of helper methods.
|
|
|
|
|
|
|
|
All containing methods are legacy helpers that should not be used by new
|
|
|
|
components. Instead call the service directly.
|
|
|
|
"""
|
|
|
|
from homeassistant.components.scene import DOMAIN
|
2019-12-09 12:12:43 +00:00
|
|
|
from homeassistant.const import ATTR_ENTITY_ID, ENTITY_MATCH_ALL, SERVICE_TURN_ON
|
2018-09-26 16:02:05 +00:00
|
|
|
from homeassistant.loader import bind_hass
|
|
|
|
|
|
|
|
|
|
|
|
@bind_hass
|
2019-12-03 00:23:12 +00:00
|
|
|
def activate(hass, entity_id=ENTITY_MATCH_ALL):
|
2018-09-26 16:02:05 +00:00
|
|
|
"""Activate a scene."""
|
|
|
|
data = {}
|
|
|
|
|
|
|
|
if entity_id:
|
|
|
|
data[ATTR_ENTITY_ID] = entity_id
|
|
|
|
|
|
|
|
hass.services.call(DOMAIN, SERVICE_TURN_ON, data)
|