Support units on dimmer entities

This commit is contained in:
Fabio Manganiello 2023-01-09 01:01:05 +01:00
parent 32330ca7a8
commit e9c84ff5d4
Signed by: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -1,4 +1,4 @@
from sqlalchemy import Column, Integer, ForeignKey, Float from sqlalchemy import Column, Integer, ForeignKey, Float, String
from platypush.common.db import Base from platypush.common.db import Base
@ -17,6 +17,7 @@ if 'dimmer' not in Base.metadata:
max = Column(Float) max = Column(Float)
step = Column(Float, default=1.0) step = Column(Float, default=1.0)
value = Column(Float) value = Column(Float)
unit = Column(String)
__mapper_args__ = { __mapper_args__ = {
'polymorphic_identity': __tablename__, 'polymorphic_identity': __tablename__,