mirror of
https://github.com/esphome/esphome.git
synced 2025-09-05 21:02:20 +01:00
Add optional minimum esphome version to microWakeWord manifest (#6240)
This commit is contained in:
@@ -57,6 +57,7 @@ from esphome.const import (
|
||||
TYPE_GIT,
|
||||
TYPE_LOCAL,
|
||||
VALID_SUBSTITUTIONS_CHARACTERS,
|
||||
__version__ as ESPHOME_VERSION,
|
||||
)
|
||||
from esphome.core import (
|
||||
CORE,
|
||||
@@ -1895,6 +1896,16 @@ def version_number(value):
|
||||
raise Invalid("Not a valid version number") from e
|
||||
|
||||
|
||||
def validate_esphome_version(value: str):
|
||||
min_version = Version.parse(value)
|
||||
current_version = Version.parse(ESPHOME_VERSION)
|
||||
if current_version < min_version:
|
||||
raise Invalid(
|
||||
f"Your ESPHome version is too old. Please update to at least {min_version}"
|
||||
)
|
||||
return value
|
||||
|
||||
|
||||
def platformio_version_constraint(value):
|
||||
# for documentation on valid version constraints:
|
||||
# https://docs.platformio.org/en/latest/core/userguide/platforms/cmd_install.html#cmd-platform-install
|
||||
|
Reference in New Issue
Block a user