mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Fix a config bug in Automation
This commit is contained in:
parent
633d0453be
commit
948a5c97ec
@ -101,7 +101,8 @@ automation 2:
|
|||||||
time_seconds: 0
|
time_seconds: 0
|
||||||
|
|
||||||
execute_service: notify.notify
|
execute_service: notify.notify
|
||||||
service_data: {"message":"It's 4, time for beer!"}
|
service_data:
|
||||||
|
message: It's 4, time for beer!
|
||||||
|
|
||||||
sensor:
|
sensor:
|
||||||
platform: systemmonitor
|
platform: systemmonitor
|
||||||
|
@ -5,11 +5,10 @@ homeassistant.components.automation
|
|||||||
Allows to setup simple automation rules via the config file.
|
Allows to setup simple automation rules via the config file.
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
import json
|
|
||||||
|
|
||||||
from homeassistant.loader import get_component
|
from homeassistant.loader import get_component
|
||||||
from homeassistant.helpers import config_per_platform
|
from homeassistant.helpers import config_per_platform
|
||||||
from homeassistant.util import convert, split_entity_id
|
from homeassistant.util import split_entity_id
|
||||||
from homeassistant.const import ATTR_ENTITY_ID
|
from homeassistant.const import ATTR_ENTITY_ID
|
||||||
|
|
||||||
DOMAIN = "automation"
|
DOMAIN = "automation"
|
||||||
@ -54,8 +53,7 @@ def _get_action(hass, config):
|
|||||||
if CONF_SERVICE in config:
|
if CONF_SERVICE in config:
|
||||||
domain, service = split_entity_id(config[CONF_SERVICE])
|
domain, service = split_entity_id(config[CONF_SERVICE])
|
||||||
|
|
||||||
service_data = convert(
|
service_data = config.get(CONF_SERVICE_DATA, {})
|
||||||
config.get(CONF_SERVICE_DATA), json.loads, {})
|
|
||||||
|
|
||||||
if not isinstance(service_data, dict):
|
if not isinstance(service_data, dict):
|
||||||
_LOGGER.error(
|
_LOGGER.error(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user