forked from platypush/platypush
No need for sensor.vl53l1x.transform_entities
to call the parent.
This commit is contained in:
parent
99572f9731
commit
f24d0773d1
1 changed files with 15 additions and 17 deletions
|
@ -111,23 +111,21 @@ class SensorDistanceVl53l1xPlugin(SensorPlugin):
|
|||
|
||||
@override
|
||||
def transform_entities(self, entities: Mapping[str, int]) -> List[Device]:
|
||||
return super().transform_entities( # type: ignore
|
||||
[
|
||||
Device(
|
||||
id='vl53l1x',
|
||||
name='VL53L1X Distance Sensor',
|
||||
children=[
|
||||
DistanceSensor(
|
||||
id=f'vl53l1x:{key}',
|
||||
name=f'{key} distance',
|
||||
value=value,
|
||||
unit='mm',
|
||||
)
|
||||
for key, value in entities.items()
|
||||
],
|
||||
)
|
||||
]
|
||||
)
|
||||
return [
|
||||
Device(
|
||||
id='vl53l1x',
|
||||
name='VL53L1X Distance Sensor',
|
||||
children=[
|
||||
DistanceSensor(
|
||||
id=f'vl53l1x:{key}',
|
||||
name=f'{key} distance',
|
||||
value=value,
|
||||
unit='mm',
|
||||
)
|
||||
for key, value in entities.items()
|
||||
],
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
# vim:sw=4:ts=4:et:
|
||||
|
|
Loading…
Reference in a new issue