forked from platypush/platypush
Added Volume
and Muted
entities
This commit is contained in:
parent
bb637a1411
commit
fd76642082
4 changed files with 52 additions and 0 deletions
|
@ -0,0 +1 @@
|
|||
Switch.vue
|
|
@ -0,0 +1 @@
|
|||
Dimmer.vue
|
|
@ -31,6 +31,14 @@
|
|||
}
|
||||
},
|
||||
|
||||
"volume": {
|
||||
"name": "Dimmer",
|
||||
"name_plural": "Dimmers",
|
||||
"icon": {
|
||||
"class": "fas fa-volume-high"
|
||||
}
|
||||
},
|
||||
|
||||
"dimmer": {
|
||||
"name": "Dimmer",
|
||||
"name_plural": "Dimmers",
|
||||
|
@ -103,6 +111,14 @@
|
|||
}
|
||||
},
|
||||
|
||||
"muted": {
|
||||
"name": "Switch",
|
||||
"name_plural": "Switches",
|
||||
"icon": {
|
||||
"class": "fas fa-volume-xmark"
|
||||
}
|
||||
},
|
||||
|
||||
"enum_switch": {
|
||||
"name": "Switch",
|
||||
"name_plural": "Switches",
|
||||
|
|
34
platypush/entities/audio.py
Normal file
34
platypush/entities/audio.py
Normal file
|
@ -0,0 +1,34 @@
|
|||
from sqlalchemy import Column, Integer, ForeignKey
|
||||
|
||||
from platypush.common.db import Base
|
||||
|
||||
from .dimmers import Dimmer
|
||||
from .switches import Switch
|
||||
|
||||
|
||||
if 'volume' not in Base.metadata:
|
||||
|
||||
class Volume(Dimmer):
|
||||
__tablename__ = 'volume'
|
||||
|
||||
id = Column(
|
||||
Integer, ForeignKey(Dimmer.id, ondelete='CASCADE'), primary_key=True
|
||||
)
|
||||
|
||||
__mapper_args__ = {
|
||||
'polymorphic_identity': __tablename__,
|
||||
}
|
||||
|
||||
|
||||
if 'muted' not in Base.metadata:
|
||||
|
||||
class Muted(Switch):
|
||||
__tablename__ = 'muted'
|
||||
|
||||
id = Column(
|
||||
Integer, ForeignKey(Switch.id, ondelete='CASCADE'), primary_key=True
|
||||
)
|
||||
|
||||
__mapper_args__ = {
|
||||
'polymorphic_identity': __tablename__,
|
||||
}
|
Loading…
Reference in a new issue