mirror of
https://github.com/home-assistant/core.git
synced 2026-12-02 19:57:03 -04:00
Keep webOS TV volume set when the TV speaker is active (#193694)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
d8ad6ae55c
commit
dac45802f4
@@ -125,9 +125,13 @@ class LgWebOSMediaPlayerEntity(WebOsTvEntity, RestoreEntity, MediaPlayerEntity):
|
||||
elif tv_state.sound_output != "lineout":
|
||||
supported = supported | SUPPORT_WEBOSTV_VOLUME
|
||||
volume_status = tv_state.volume_status
|
||||
# webOS 22+ reports volumeSyncable, webOS 4.x supportvolume,
|
||||
# webOS 5/6 neither, so keep volume set when unknown
|
||||
if volume_status.get(
|
||||
# The TV speaker always supports volume set, also when combined
|
||||
# with an output that does not. For other outputs webOS 22+
|
||||
# reports volumeSyncable, webOS 4.x supportvolume, webOS 5/6
|
||||
# neither, so keep volume set when unknown
|
||||
if volume_status.get("soundOutput", "").startswith(
|
||||
"tv_"
|
||||
) or volume_status.get(
|
||||
"volumeSyncable", volume_status.get("supportvolume", True)
|
||||
):
|
||||
supported = supported | MediaPlayerEntityFeature.VOLUME_SET
|
||||
|
||||
@@ -845,6 +845,21 @@ WEBOS_23_TV_SPEAKER_SYNCABLE = {
|
||||
"volumeSyncable": True,
|
||||
"adjustVolume": True,
|
||||
}
|
||||
WEBOS_24_TV_AND_OPTICAL_NOT_SYNCABLE = {
|
||||
"volumeLimitable": True,
|
||||
"activeStatus": True,
|
||||
"maxVolume": 100,
|
||||
"ossActivate": False,
|
||||
"volumeLimiter": "none",
|
||||
"soundOutput": "tv_external_speaker",
|
||||
"volume": 1,
|
||||
"dedicatedSpeakerConnected": False,
|
||||
"mode": "normal",
|
||||
"externalDeviceControl": False,
|
||||
"muteStatus": False,
|
||||
"volumeSyncable": False,
|
||||
"adjustVolume": True,
|
||||
}
|
||||
WEBOS_4_ARC_NO_SUPPORT_VOLUME = {
|
||||
"returnValue": True,
|
||||
"volumeMax": 100,
|
||||
@@ -904,6 +919,18 @@ SUPPORT_WEBOSTV_VOLUME_SET = (
|
||||
SUPPORT_WEBOSTV_VOLUME_SET,
|
||||
id="webos_23_tv_speaker",
|
||||
),
|
||||
pytest.param(
|
||||
"tv_external_speaker",
|
||||
WEBOS_24_TV_AND_OPTICAL_NOT_SYNCABLE,
|
||||
SUPPORT_WEBOSTV_VOLUME_SET,
|
||||
id="webos_24_tv_and_optical_not_syncable",
|
||||
),
|
||||
pytest.param(
|
||||
"tv_speaker",
|
||||
WEBOS_24_ARC_NOT_SYNCABLE,
|
||||
SUPPORT_WEBOSTV | SUPPORT_WEBOSTV_VOLUME,
|
||||
id="webos_22_not_syncable_stale_sound_output",
|
||||
),
|
||||
pytest.param(
|
||||
"external_arc",
|
||||
WEBOS_4_ARC_NO_SUPPORT_VOLUME,
|
||||
|
||||
Reference in New Issue
Block a user