forked from platypush/platypush
Added distance_sensor
entity
This commit is contained in:
parent
6fb362a6fb
commit
226034946f
3 changed files with 32 additions and 0 deletions
|
@ -0,0 +1 @@
|
|||
Sensor.vue
|
|
@ -31,6 +31,14 @@
|
|||
}
|
||||
},
|
||||
|
||||
"distance_sensor": {
|
||||
"name": "Sensor",
|
||||
"name_plural": "Sensors",
|
||||
"icon": {
|
||||
"class": "fas fa-ruler-horizontal"
|
||||
}
|
||||
},
|
||||
|
||||
"bluetooth_device": {
|
||||
"name": "Device",
|
||||
"name_plural": "Devices",
|
||||
|
|
23
platypush/entities/distance.py
Normal file
23
platypush/entities/distance.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
from sqlalchemy import Column, Integer, ForeignKey
|
||||
|
||||
from platypush.common.db import Base
|
||||
|
||||
from .sensors import NumericSensor
|
||||
|
||||
|
||||
if 'distance_sensor' not in Base.metadata:
|
||||
|
||||
class DistanceSensor(NumericSensor):
|
||||
"""
|
||||
This class models distance sensors.
|
||||
"""
|
||||
|
||||
__tablename__ = 'distance_sensor'
|
||||
|
||||
id = Column(
|
||||
Integer, ForeignKey(NumericSensor.id, ondelete='CASCADE'), primary_key=True
|
||||
)
|
||||
|
||||
__mapper_args__ = {
|
||||
'polymorphic_identity': __tablename__,
|
||||
}
|
Loading…
Reference in a new issue