Dirty fix for "Subscripted generics cannot be used with class and instance checks" on Python < 3.10

This commit is contained in:
Fabio Manganiello 2023-04-01 22:52:24 +02:00
parent 98ec018292
commit 0047d85b9d
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -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