2022-11-27 22:38:58 +01:00
|
|
|
from sqlalchemy import Column, Integer, ForeignKey
|
|
|
|
|
2022-12-04 16:27:28 +01:00
|
|
|
from platypush.common.db import Base
|
|
|
|
|
2022-11-27 22:38:58 +01:00
|
|
|
from .sensors import NumericSensor
|
|
|
|
|
|
|
|
|
2022-12-04 16:27:28 +01:00
|
|
|
if 'illuminance_sensor' not in Base.metadata:
|
2022-11-27 22:38:58 +01:00
|
|
|
|
|
|
|
class IlluminanceSensor(NumericSensor):
|
|
|
|
__tablename__ = 'illuminance_sensor'
|
|
|
|
|
|
|
|
id = Column(
|
|
|
|
Integer, ForeignKey(NumericSensor.id, ondelete='CASCADE'), primary_key=True
|
|
|
|
)
|
|
|
|
|
|
|
|
__mapper_args__ = {
|
|
|
|
'polymorphic_identity': __tablename__,
|
|
|
|
}
|