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 untrusted user: 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": { "dimmer": {
"name": "Dimmer", "name": "Dimmer",
"name_plural": "Dimmers", "name_plural": "Dimmers",
@ -103,6 +111,14 @@
} }
}, },
"muted": {
"name": "Switch",
"name_plural": "Switches",
"icon": {
"class": "fas fa-volume-xmark"
}
},
"enum_switch": { "enum_switch": {
"name": "Switch", "name": "Switch",
"name_plural": "Switches", "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__,
}