Added `Volume` and `Muted` entities

This commit is contained in:
Fabio Manganiello 2023-01-22 21:04:46 +01:00
parent bb637a1411
commit fd76642082
Signed by: blacklight
GPG Key ID: D90FBA7F76362774
4 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1 @@
Switch.vue

View File

@ -0,0 +1 @@
Dimmer.vue

View File

@ -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",

View 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__,
}