2023-01-22 21:04:46 +01:00
|
|
|
from sqlalchemy import Column, Integer, ForeignKey
|
|
|
|
|
2023-10-04 09:50:10 +02:00
|
|
|
from platypush.common.db import is_defined
|
2023-01-22 21:04:46 +01:00
|
|
|
|
|
|
|
from .dimmers import Dimmer
|
|
|
|
from .switches import Switch
|
|
|
|
|
|
|
|
|
2023-10-04 09:50:10 +02:00
|
|
|
if not is_defined('volume'):
|
2023-01-22 21:04:46 +01:00
|
|
|
|
|
|
|
class Volume(Dimmer):
|
|
|
|
__tablename__ = 'volume'
|
|
|
|
|
|
|
|
id = Column(
|
|
|
|
Integer, ForeignKey(Dimmer.id, ondelete='CASCADE'), primary_key=True
|
|
|
|
)
|
|
|
|
|
2023-10-04 09:50:10 +02:00
|
|
|
__table_args__ = {'extend_existing': True}
|
2023-01-22 21:04:46 +01:00
|
|
|
__mapper_args__ = {
|
|
|
|
'polymorphic_identity': __tablename__,
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-10-04 09:50:10 +02:00
|
|
|
if not is_defined('muted'):
|
2023-01-22 21:04:46 +01:00
|
|
|
|
|
|
|
class Muted(Switch):
|
|
|
|
__tablename__ = 'muted'
|
|
|
|
|
|
|
|
id = Column(
|
|
|
|
Integer, ForeignKey(Switch.id, ondelete='CASCADE'), primary_key=True
|
|
|
|
)
|
|
|
|
|
2023-10-04 09:50:10 +02:00
|
|
|
__table_args__ = {'extend_existing': True}
|
2023-01-22 21:04:46 +01:00
|
|
|
__mapper_args__ = {
|
|
|
|
'polymorphic_identity': __tablename__,
|
|
|
|
}
|