Fix logbook entry

This commit is contained in:
Paulus Schoutsen 2018-09-28 17:04:25 +02:00
parent 3d6198d8dc
commit 43cde6aeae

View file

@ -11,6 +11,7 @@ import logging
import attr import attr
import voluptuous as vol import voluptuous as vol
from homeassistant.loader import bind_hass
from homeassistant.components import sun from homeassistant.components import sun
from homeassistant.components.http import HomeAssistantView from homeassistant.components.http import HomeAssistantView
from homeassistant.const import ( from homeassistant.const import (
@ -67,11 +68,13 @@ LOG_MESSAGE_SCHEMA = vol.Schema({
}) })
@bind_hass
def log_entry(hass, name, message, domain=None, entity_id=None): def log_entry(hass, name, message, domain=None, entity_id=None):
"""Add an entry to the logbook.""" """Add an entry to the logbook."""
hass.add_job(async_log_entry, hass, name, message, domain, entity_id) hass.add_job(async_log_entry, hass, name, message, domain, entity_id)
@bind_hass
def async_log_entry(hass, name, message, domain=None, entity_id=None): def async_log_entry(hass, name, message, domain=None, entity_id=None):
"""Add an entry to the logbook.""" """Add an entry to the logbook."""
data = { data = {