From 98ec018292a4d39d69d16e81086d35b02c09b491 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 1 Apr 2023 22:42:13 +0200 Subject: [PATCH] Replaced `NoneType` reference. `types.NoneType` is not always available on all Python versions, so we have to make our own type for it. --- platypush/plugins/sensor/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platypush/plugins/sensor/__init__.py b/platypush/plugins/sensor/__init__.py index 939b71ca7d..83d730bc37 100644 --- a/platypush/plugins/sensor/__init__.py +++ b/platypush/plugins/sensor/__init__.py @@ -1,5 +1,4 @@ from abc import ABC, abstractmethod -from types import NoneType from typing import Collection, Iterable, List, Mapping, Optional, Tuple, Type, Union from typing_extensions import override @@ -16,6 +15,7 @@ from platypush.message.event.sensor import ( from platypush.plugins import RunnablePlugin, action from platypush.utils import get_plugin_name_by_class +NoneType = type(None) ThresholdType = Union[Numeric, Tuple[Numeric, Numeric]] ThresholdConfiguration = Union[ThresholdType, Mapping[str, ThresholdType]]