Replace MediaPlayerState.STANDBY with MediaPlayerState.OFF in cambridge_audio (#148133)

This commit is contained in:
Erik Montnemery 2025-07-04 21:54:11 +02:00 committed by GitHub
parent 70624f72b6
commit b6b6de24ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 4 deletions

View File

@ -107,7 +107,7 @@ class CambridgeAudioDevice(CambridgeAudioEntity, MediaPlayerEntity):
"""Return the state of the device."""
media_state = self.client.play_state.state
if media_state == "NETWORK":
return MediaPlayerState.STANDBY
return MediaPlayerState.OFF
if self.client.state.power:
if media_state == "play":
return MediaPlayerState.PLAYING

View File

@ -45,7 +45,6 @@ from homeassistant.const import (
STATE_ON,
STATE_PAUSED,
STATE_PLAYING,
STATE_STANDBY,
)
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError, ServiceValidationError
@ -156,8 +155,8 @@ async def test_entity_supported_features_with_control_bus(
@pytest.mark.parametrize(
("power_state", "play_state", "media_player_state"),
[
(True, "NETWORK", STATE_STANDBY),
(False, "NETWORK", STATE_STANDBY),
(True, "NETWORK", STATE_OFF),
(False, "NETWORK", STATE_OFF),
(False, "play", STATE_OFF),
(True, "play", STATE_PLAYING),
(True, "pause", STATE_PAUSED),