mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 21:25:13 +02:00
Humanize service call config validation errors
This commit is contained in:
@@ -19,6 +19,7 @@ from types import MappingProxyType
|
||||
from typing import Optional, Any, Callable, List # NOQA
|
||||
|
||||
import voluptuous as vol
|
||||
from voluptuous.humanize import humanize_error
|
||||
|
||||
from homeassistant.const import (
|
||||
ATTR_DOMAIN, ATTR_FRIENDLY_NAME, ATTR_NOW, ATTR_SERVICE,
|
||||
@@ -571,7 +572,8 @@ class Service(object):
|
||||
self.func(call)
|
||||
except vol.MultipleInvalid as ex:
|
||||
_LOGGER.error('Invalid service data for %s.%s: %s',
|
||||
call.domain, call.service, ex)
|
||||
call.domain, call.service,
|
||||
humanize_error(call.data, ex))
|
||||
|
||||
|
||||
# pylint: disable=too-few-public-methods
|
||||
|
Reference in New Issue
Block a user