From d9641676311b4722f8a59732fdb227cd4ff5bdd7 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 2 Apr 2023 00:57:48 +0200 Subject: [PATCH] `s/TimeDurationSensor/TimeDuration/g` --- .../Entities/{TimeDurationSensor.vue => TimeDuration.vue} | 0 platypush/entities/time.py | 8 ++++---- platypush/plugins/bluetooth/_ble/_mappers.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) rename platypush/backend/http/webapp/src/components/panels/Entities/{TimeDurationSensor.vue => TimeDuration.vue} (100%) 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 b6d3c00321..f5cf6e8857 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 0eda4570cc..f622f6e428 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'), ),