2022-04-29 23:29:04 +02:00
|
|
|
from sqlalchemy import Column, Integer, String, ForeignKey, Boolean, Float
|
2022-04-04 16:50:17 +02:00
|
|
|
|
2022-12-04 16:27:28 +01:00
|
|
|
from platypush.common.db import Base
|
2022-04-04 16:50:17 +02:00
|
|
|
|
2022-12-04 16:27:28 +01:00
|
|
|
from .devices import Device
|
2022-04-04 16:50:17 +02:00
|
|
|
|
2022-12-04 16:27:28 +01:00
|
|
|
|
|
|
|
if 'light' not in Base.metadata:
|
2022-04-04 16:50:17 +02:00
|
|
|
|
2022-10-10 01:38:15 +02:00
|
|
|
class Light(Device):
|
|
|
|
__tablename__ = 'light'
|
2022-04-04 16:50:17 +02:00
|
|
|
|
2022-10-10 01:38:15 +02:00
|
|
|
id = Column(
|
|
|
|
Integer, ForeignKey(Device.id, ondelete='CASCADE'), primary_key=True
|
|
|
|
)
|
|
|
|
on = Column(Boolean)
|
|
|
|
brightness = Column(Float)
|
|
|
|
saturation = Column(Float)
|
|
|
|
hue = Column(Float)
|
|
|
|
temperature = Column(Float)
|
|
|
|
x = Column(Float)
|
|
|
|
y = Column(Float)
|
2022-12-04 16:27:28 +01:00
|
|
|
red = Column(Float)
|
|
|
|
green = Column(Float)
|
|
|
|
blue = Column(Float)
|
2022-10-10 01:38:15 +02:00
|
|
|
colormode = Column(String)
|
|
|
|
effect = Column(String)
|
|
|
|
hue_min = Column(Float)
|
|
|
|
hue_max = Column(Float)
|
|
|
|
saturation_min = Column(Float)
|
|
|
|
saturation_max = Column(Float)
|
|
|
|
brightness_min = Column(Float)
|
|
|
|
brightness_max = Column(Float)
|
|
|
|
temperature_min = Column(Float)
|
|
|
|
temperature_max = Column(Float)
|
|
|
|
|
|
|
|
__mapper_args__ = {
|
|
|
|
'polymorphic_identity': __tablename__,
|
|
|
|
}
|