forked from platypush/platypush
Added MotionSensor entities
This commit is contained in:
parent
a892bad34c
commit
dfb13127ee
3 changed files with 28 additions and 0 deletions
|
@ -0,0 +1 @@
|
||||||
|
Sensor.vue
|
|
@ -15,6 +15,14 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"motion_sensor": {
|
||||||
|
"name": "Sensor",
|
||||||
|
"name_plural": "Sensors",
|
||||||
|
"icon": {
|
||||||
|
"class": "fas fa-person-running"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
"device": {
|
"device": {
|
||||||
"name": "Device",
|
"name": "Device",
|
||||||
"name_plural": "Devices",
|
"name_plural": "Devices",
|
||||||
|
|
19
platypush/entities/motion.py
Normal file
19
platypush/entities/motion.py
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
from sqlalchemy import Column, Integer, ForeignKey
|
||||||
|
|
||||||
|
from platypush.common.db import Base
|
||||||
|
|
||||||
|
from .sensors import BinarySensor
|
||||||
|
|
||||||
|
|
||||||
|
if 'motion_sensor' not in Base.metadata:
|
||||||
|
|
||||||
|
class MotionSensor(BinarySensor):
|
||||||
|
__tablename__ = 'motion_sensor'
|
||||||
|
|
||||||
|
id = Column(
|
||||||
|
Integer, ForeignKey(BinarySensor.id, ondelete='CASCADE'), primary_key=True
|
||||||
|
)
|
||||||
|
|
||||||
|
__mapper_args__ = {
|
||||||
|
'polymorphic_identity': __tablename__,
|
||||||
|
}
|
Loading…
Reference in a new issue