Added MotionSensor entities

This commit is contained in:
Fabio Manganiello 2023-01-21 14:47:18 +01:00
parent a892bad34c
commit dfb13127ee
Signed by untrusted user: 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": { "device": {
"name": "Device", "name": "Device",
"name_plural": "Devices", "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__,
}