Skip to content

Commit

Permalink
fix(light_controller): remove "Literal" since minimum Python version …
Browse files Browse the repository at this point in the history
…supported is 3.6
  • Loading branch information
xaviml committed Dec 5, 2020
1 parent 7a208e5 commit 4a827d1
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions apps/controllerx/cx_core/type/light_controller.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
from typing import Any, Dict, Optional, Type, Union

from cx_const import Light, TypeActionsMapping
Expand All @@ -10,12 +9,6 @@
from cx_core.stepper.minmax_stepper import MinMaxStepper
from cx_core.type_controller import Entity, TypeController

if sys.version_info[1] < 8:
from typing_extensions import Literal
else:
from typing import Literal # type: ignore


DEFAULT_MANUAL_STEPS = 10
DEFAULT_AUTOMATIC_STEPS = 10
DEFAULT_MIN_BRIGHTNESS = 1
Expand All @@ -28,7 +21,10 @@
DEFAULT_ADD_TRANSITION = True
DEFAULT_TRANSITION_TURN_TOGGLE = False

ColorMode = Literal["auto", "xy_color", "color_temp"]
ColorMode = str
# Once the minimum supported version of Python is 3.8,
# we can declare the ColorMode as a Literal
# ColorMode = Literal["auto", "xy_color", "color_temp"]


class LightEntity(Entity):
Expand Down

0 comments on commit 4a827d1

Please sign in to comment.