Added relevant attributes to light entities

This commit is contained in:
Fabio Manganiello 2022-04-29 23:29:04 +02:00
parent 90f067de61
commit 975d37c562
Signed by: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -1,4 +1,4 @@
from sqlalchemy import Column, Integer, ForeignKey from sqlalchemy import Column, Integer, String, ForeignKey, Boolean, Float
from .devices import Device from .devices import Device
@ -7,6 +7,12 @@ class Light(Device):
__tablename__ = 'light' __tablename__ = 'light'
id = Column(Integer, ForeignKey(Device.id, ondelete='CASCADE'), primary_key=True) 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)
colormode = Column(String)
__mapper_args__ = { __mapper_args__ = {
'polymorphic_identity': __tablename__, 'polymorphic_identity': __tablename__,