1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-06 13:22:19 +01:00

Add min_version to esphome config (#3866)

This commit is contained in:
Jesse Hills
2022-10-05 16:30:56 +13:00
committed by GitHub
parent 263b603188
commit c3a8972550
6 changed files with 77 additions and 18 deletions

View File

@@ -1689,7 +1689,7 @@ class Version:
@classmethod
def parse(cls, value: str) -> "Version":
match = re.match(r"(\d+).(\d+).(\d+)", value)
match = re.match(r"^(\d+).(\d+).(\d+)-?\w*$", value)
if match is None:
raise ValueError(f"Not a valid version number {value}")
major = int(match[1])
@@ -1703,7 +1703,7 @@ def version_number(value):
try:
return str(Version.parse(value))
except ValueError as e:
raise Invalid("Not a version number") from e
raise Invalid("Not a valid version number") from e
def platformio_version_constraint(value):