mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 16:38:16 +01:00
Invalid config for waveshare models with no full_update_every (#4066)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
parent
9370ff3dfa
commit
f83f1bff19
1 changed files with 7 additions and 3 deletions
|
@ -88,13 +88,17 @@ MODELS = {
|
|||
}
|
||||
|
||||
|
||||
def validate_full_update_every_only_type_a(value):
|
||||
def validate_full_update_every_only_types_ac(value):
|
||||
if CONF_FULL_UPDATE_EVERY not in value:
|
||||
return value
|
||||
if MODELS[value[CONF_MODEL]][0] == "b":
|
||||
full_models = []
|
||||
for key, val in sorted(MODELS.items()):
|
||||
if val[0] != "b":
|
||||
full_models.append(key)
|
||||
raise cv.Invalid(
|
||||
"The 'full_update_every' option is only available for models "
|
||||
"'1.54in', '1.54inV2', '2.13in', '2.90in', and '2.90inV2'."
|
||||
+ ", ".join(full_models)
|
||||
)
|
||||
return value
|
||||
|
||||
|
@ -116,7 +120,7 @@ CONFIG_SCHEMA = cv.All(
|
|||
)
|
||||
.extend(cv.polling_component_schema("1s"))
|
||||
.extend(spi.spi_device_schema()),
|
||||
validate_full_update_every_only_type_a,
|
||||
validate_full_update_every_only_types_ac,
|
||||
cv.has_at_most_one_key(CONF_PAGES, CONF_LAMBDA),
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue