diff --git a/platypush/backend/http/webapp/src/components/panels/Entities/TimeDurationSensor.vue b/platypush/backend/http/webapp/src/components/panels/Entities/TimeDuration.vue similarity index 100% rename from platypush/backend/http/webapp/src/components/panels/Entities/TimeDurationSensor.vue rename to platypush/backend/http/webapp/src/components/panels/Entities/TimeDuration.vue diff --git a/platypush/entities/time.py b/platypush/entities/time.py index b6d3c0032..f5cf6e885 100644 --- a/platypush/entities/time.py +++ b/platypush/entities/time.py @@ -5,14 +5,14 @@ from platypush.common.db import Base from .sensors import NumericSensor -if 'time_duration_sensor' not in Base.metadata: +if 'time_duration' not in Base.metadata: - class TimeDurationSensor(NumericSensor): + class TimeDuration(NumericSensor): """ - A sensor that measures a time duration. + An entity that measures a time duration. """ - __tablename__ = 'time_duration_sensor' + __tablename__ = 'time_duration' id = Column( Integer, ForeignKey(NumericSensor.id, ondelete='CASCADE'), primary_key=True diff --git a/platypush/plugins/bluetooth/_ble/_mappers.py b/platypush/plugins/bluetooth/_ble/_mappers.py index 0eda4570c..f622f6e42 100644 --- a/platypush/plugins/bluetooth/_ble/_mappers.py +++ b/platypush/plugins/bluetooth/_ble/_mappers.py @@ -28,7 +28,7 @@ from platypush.entities.pressure import PressureSensor from platypush.entities.sensors import BinarySensor, NumericSensor, RawSensor from platypush.entities.steps import StepsSensor from platypush.entities.temperature import TemperatureSensor -from platypush.entities.time import TimeDurationSensor +from platypush.entities.time import TimeDuration from platypush.entities.weight import WeightSensor from .._model import Protocol, ServiceClass @@ -80,7 +80,7 @@ _property_to_entity: Dict[str, Callable[[Any, Dict[str, Any]], Entity]] = { value=value, unit=conf.get('unit'), ), - 'duration': lambda value, conf: TimeDurationSensor( + 'duration': lambda value, conf: TimeDuration( value=value, unit=conf.get('unit'), ),