mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 11:47:30 +01:00
Improve error messages
This commit is contained in:
parent
b5f6b32fad
commit
1267680379
@ -175,7 +175,7 @@ def validate_config(config):
|
|||||||
dependencies = getattr(component, 'DEPENDENCIES', [])
|
dependencies = getattr(component, 'DEPENDENCIES', [])
|
||||||
for dependency in dependencies:
|
for dependency in dependencies:
|
||||||
if dependency not in _ALL_COMPONENTS:
|
if dependency not in _ALL_COMPONENTS:
|
||||||
result.add_error(u"Component {} requires {}".format(domain, dependency))
|
result.add_error(u"Component {} requires component {}".format(domain, dependency))
|
||||||
success = False
|
success = False
|
||||||
if not success:
|
if not success:
|
||||||
continue
|
continue
|
||||||
@ -209,7 +209,7 @@ def validate_config(config):
|
|||||||
dependencies = getattr(platform, 'DEPENDENCIES', [])
|
dependencies = getattr(platform, 'DEPENDENCIES', [])
|
||||||
for dependency in dependencies:
|
for dependency in dependencies:
|
||||||
if dependency not in _ALL_COMPONENTS:
|
if dependency not in _ALL_COMPONENTS:
|
||||||
result.add_error(u"Platform {}.{} requires {}".format(domain, p_name,
|
result.add_error(u"Platform {}.{} requires component {}".format(domain, p_name,
|
||||||
dependency))
|
dependency))
|
||||||
success = False
|
success = False
|
||||||
if not success:
|
if not success:
|
||||||
|
@ -205,12 +205,12 @@ def shorthand_input_pin(value):
|
|||||||
PCF8574_OUTPUT_PIN_SCHEMA = vol.Schema({
|
PCF8574_OUTPUT_PIN_SCHEMA = vol.Schema({
|
||||||
vol.Required(CONF_PCF8574): cv.use_variable_id(pcf8574.PCF8574Component),
|
vol.Required(CONF_PCF8574): cv.use_variable_id(pcf8574.PCF8574Component),
|
||||||
vol.Required(CONF_NUMBER): vol.Coerce(int),
|
vol.Required(CONF_NUMBER): vol.Coerce(int),
|
||||||
vol.Optional(CONF_MODE): vol.All(vol.Upper, "OUTPUT"),
|
vol.Optional(CONF_MODE): vol.All(vol.Upper, cv.one_of("OUTPUT")),
|
||||||
vol.Optional(CONF_INVERTED, default=False): cv.boolean,
|
vol.Optional(CONF_INVERTED, default=False): cv.boolean,
|
||||||
})
|
})
|
||||||
|
|
||||||
PCF8574_INPUT_PIN_SCHEMA = PCF8574_OUTPUT_PIN_SCHEMA.extend({
|
PCF8574_INPUT_PIN_SCHEMA = PCF8574_OUTPUT_PIN_SCHEMA.extend({
|
||||||
vol.Optional(CONF_MODE): vol.All(vol.Upper, vol.Any("INPUT", "INPUT_PULLUP")),
|
vol.Optional(CONF_MODE): vol.All(vol.Upper, cv.one_of("INPUT", "INPUT_PULLUP")),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user