s/TimeDurationSensor/TimeDuration/g

This commit is contained in:
Fabio Manganiello 2023-04-02 00:57:48 +02:00
parent 839c6108a0
commit d964167631
Signed by: blacklight
GPG key ID: D90FBA7F76362774
3 changed files with 6 additions and 6 deletions

View file

@ -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

View file

@ -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'),
),