From b6a869fe6262f22d4d88fe3ca3bce954472f4b79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20S=C3=A1nchez-Gallego?= Date: Thu, 23 Nov 2023 15:16:30 -0800 Subject: [PATCH] Use Union for Python 3.9 --- src/lvmnps/nps/core.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lvmnps/nps/core.py b/src/lvmnps/nps/core.py index 87991ed..d5a3e70 100644 --- a/src/lvmnps/nps/core.py +++ b/src/lvmnps/nps/core.py @@ -11,7 +11,7 @@ import abc import asyncio -from typing import Any, Sequence, TypedDict +from typing import Any, Sequence, TypedDict, Union from pydantic import BaseModel, ConfigDict @@ -61,7 +61,8 @@ async def off(self): await self._client.set_state(self, on=False) -OutletArgType = OutletModel | int | str | Sequence[str | int | OutletModel] +# Unions needed for Python 3.9 +OutletArgType = Union[OutletModel, int, str, Sequence[Union[str, int, OutletModel]]] class ImplementationsDict(TypedDict):