Added MotionSensor entities

This commit is contained in:
Fabio Manganiello 2023-01-21 14:47:18 +01:00
parent a892bad34c
commit dfb13127ee
Signed by: blacklight
GPG Key ID: D90FBA7F76362774
3 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1 @@
Sensor.vue

View File

@ -15,6 +15,14 @@
}
},
"motion_sensor": {
"name": "Sensor",
"name_plural": "Sensors",
"icon": {
"class": "fas fa-person-running"
}
},
"device": {
"name": "Device",
"name_plural": "Devices",

View 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__,
}