From 0047d85b9da7578eb74d864d78bf010682b49094 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 1 Apr 2023 22:52:24 +0200 Subject: [PATCH] Dirty fix for "Subscripted generics cannot be used with class and instance checks" on Python < 3.10 --- 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 83d730bc37..3bd38635b7 100644 --- a/platypush/plugins/sensor/__init__.py +++ b/platypush/plugins/sensor/__init__.py @@ -333,7 +333,7 @@ class SensorPlugin(RunnablePlugin, SensorEntityManager, ABC): def publish_entities( self, entities: SensorDataType, *args, **kwargs ) -> Collection[Entity]: - entities_args = [entities] if isinstance(entities, Numeric) else entities + entities_args = [entities] if isinstance(entities, (int, float)) else entities return super().publish_entities(entities_args, *args, **kwargs) # type: ignore @abstractmethod