1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-02 10:02:23 +01:00
This commit is contained in:
J. Nick Koston
2025-06-22 21:24:17 +02:00
parent 8831999ea6
commit 68b13340fb

View File

@@ -1,5 +1,7 @@
"""Helpers for config validation using voluptuous."""
from __future__ import annotations
from contextlib import contextmanager
from dataclasses import dataclass
from datetime import datetime
@@ -348,7 +350,7 @@ def icon(value):
)
def sub_device_id(value):
def sub_device_id(value) -> core.ID:
# Lazy import to avoid circular imports
from esphome.core.config import Device
@@ -1931,7 +1933,7 @@ class Version:
return f"{self.major}.{self.minor}.{self.patch}"
@classmethod
def parse(cls, value: str) -> "Version":
def parse(cls, value: str) -> Version:
match = re.match(r"^(\d+).(\d+).(\d+)-?\w*$", value)
if match is None:
raise ValueError(f"Not a valid version number {value}")