No need for sensor.vl53l1x.transform_entities to call the parent.

This commit is contained in:
Fabio Manganiello 2023-04-01 23:54:43 +02:00
parent 99572f9731
commit f24d0773d1
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -111,23 +111,21 @@ class SensorDistanceVl53l1xPlugin(SensorPlugin):
@override @override
def transform_entities(self, entities: Mapping[str, int]) -> List[Device]: def transform_entities(self, entities: Mapping[str, int]) -> List[Device]:
return super().transform_entities( # type: ignore return [
[ Device(
Device( id='vl53l1x',
id='vl53l1x', name='VL53L1X Distance Sensor',
name='VL53L1X Distance Sensor', children=[
children=[ DistanceSensor(
DistanceSensor( id=f'vl53l1x:{key}',
id=f'vl53l1x:{key}', name=f'{key} distance',
name=f'{key} distance', value=value,
value=value, unit='mm',
unit='mm', )
) for key, value in entities.items()
for key, value in entities.items() ],
], )
) ]
]
)
# vim:sw=4:ts=4:et: # vim:sw=4:ts=4:et: