From af99d3fb3754badf77e71e183b30bf2cbd27c9a5 Mon Sep 17 00:00:00 2001 From: Xavier Moreno Date: Sat, 21 Nov 2020 21:57:48 +0100 Subject: [PATCH] fix(light_controller): import Literal from typing if using python 3.8 or higher --- apps/controllerx/cx_core/type/light_controller.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/controllerx/cx_core/type/light_controller.py b/apps/controllerx/cx_core/type/light_controller.py index 04872c60..9bb47d63 100644 --- a/apps/controllerx/cx_core/type/light_controller.py +++ b/apps/controllerx/cx_core/type/light_controller.py @@ -1,3 +1,4 @@ +import sys from typing import Any, Dict, Optional, Type, Union from cx_const import Light, TypeActionsMapping @@ -8,7 +9,12 @@ from cx_core.stepper.circular_stepper import CircularStepper from cx_core.stepper.minmax_stepper import MinMaxStepper from cx_core.type_controller import Entity, TypeController -from typing_extensions import Literal + +if sys.version_info[1] < 8: + from typing_extensions import Literal +else: + from typing import Literal + DEFAULT_MANUAL_STEPS = 10 DEFAULT_AUTOMATIC_STEPS = 10