Don't swap the argument of SensorPlugin.publish_entities with a list if not required

This commit is contained in:
Fabio Manganiello 2023-04-01 23:06:37 +02:00
parent 0047d85b9d
commit 8e0f88ea16
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -333,8 +333,7 @@ class SensorPlugin(RunnablePlugin, SensorEntityManager, ABC):
def publish_entities(
self, entities: SensorDataType, *args, **kwargs
) -> Collection[Entity]:
entities_args = [entities] if isinstance(entities, (int, float)) else entities
return super().publish_entities(entities_args, *args, **kwargs) # type: ignore
return super().publish_entities(entities, *args, **kwargs) # type: ignore
@abstractmethod
@action