Skip to content

Commit d7cca6e

Browse files
authored
Merge pull request #3 from ov1d1u/fix/import-error
Support both Python <= 3.10 and Python >= 3.11
2 parents 8af7484 + 1fe93eb commit d7cca6e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

components/opentherm/schema.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
# This file contains a schema for all supported sensors, binary sensors and
22
# inputs of the OpenTherm component.
33

4-
from typing import Dict, Generic, Tuple, TypeVar, TypedDict, NotRequired
4+
import sys
5+
from typing import Dict, Generic, Tuple, TypeVar, TypedDict
6+
if sys.version_info >= (3, 11):
7+
from typing import NotRequired
8+
else:
9+
from typing_extensions import NotRequired
510

611
from esphome.const import (
712
UNIT_CELSIUS,

0 commit comments

Comments
 (0)