From 87d9578b735fa93535775fa286ca0279edddfee9 Mon Sep 17 00:00:00 2001 From: Anders Evenrud Date: Thu, 5 Oct 2023 18:18:43 +0200 Subject: [PATCH] refactor(nexa): use old style union in typing Adds compatability with Python <= 3.9 Fixes #29 --- custom_components/nexa_bridge_x/nexa.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/nexa_bridge_x/nexa.py b/custom_components/nexa_bridge_x/nexa.py index 1b0e605..a4a96b2 100644 --- a/custom_components/nexa_bridge_x/nexa.py +++ b/custom_components/nexa_bridge_x/nexa.py @@ -8,7 +8,7 @@ from __future__ import annotations from functools import reduce from datetime import timedelta -from typing import cast, Any +from typing import cast, Any, Union from homeassistant.helpers.httpx_client import get_async_client from homeassistant.exceptions import ConfigEntryAuthFailed from homeassistant.config_entries import ConfigEntry @@ -41,7 +41,7 @@ _LOGGER = logging.getLogger(__name__) # TODO: Add correct typing -NexaNodeValueType = str | int | float | bool +NexaNodeValueType = Union[str, int, float, bool] NexaEnergyData = Any NexaLegacyEnergyData = Any NexaEnergyNodeData = Any