feat: add wifi speaker and television as the media player entity (#706)

This commit is contained in:
Li Shuzhen
2025-07-09 14:02:22 +08:00
committed by GitHub
parent 4c2e10038c
commit aebeaf0245
4 changed files with 531 additions and 2 deletions

View File

@ -75,6 +75,7 @@ SUPPORTED_PLATFORMS: list = [
'fan',
'humidifier',
'light',
'media_player',
'notify',
'number',
'select',

View File

@ -321,6 +321,64 @@ SPEC_DEVICE_TRANS_MAP: dict = {
'optional': {},
'entity': 'electric-blanket'
},
'speaker': {
'required': {
'speaker': {
'required': {
'properties': {
'volume': {'read', 'write'}
}
},
'optional': {
'properties': {'mute'}
}
},
'play-control': {
'required': {
'actions': {'play'}
},
'optional': {
'properties': {'playing-state'},
'actions': {'pause', 'stop', 'next', 'previous'}
}
}
},
'optional': {},
'entity': 'wifi-speaker'
},
'television': {
'required': {
'speaker': {
'required': {
'properties': {
'volume': {'read', 'write'}
}
},
'optional': {
'properties': {'mute'}
}
},
'television': {
'required': {
'actions': {'turn-off'}
},
'optional': {
'properties': {'input-control'},
'actions': {'turn-on'}
}
}
},
'optional': {
'play-control': {
'required': {},
'optional': {
'properties': {'playing-state'},
'actions': {'play', 'pause', 'stop', 'next', 'previous'}
}
}
},
'entity': 'television'
}
}
"""SPEC_SERVICE_TRANS_MAP