mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 07:37:34 +00:00
Replace MediaPlayerState.STANDBY with MediaPlayerState.OFF in cambridge_audio (#148133)
This commit is contained in:
parent
70624f72b6
commit
b6b6de24ac
@ -107,7 +107,7 @@ class CambridgeAudioDevice(CambridgeAudioEntity, MediaPlayerEntity):
|
|||||||
"""Return the state of the device."""
|
"""Return the state of the device."""
|
||||||
media_state = self.client.play_state.state
|
media_state = self.client.play_state.state
|
||||||
if media_state == "NETWORK":
|
if media_state == "NETWORK":
|
||||||
return MediaPlayerState.STANDBY
|
return MediaPlayerState.OFF
|
||||||
if self.client.state.power:
|
if self.client.state.power:
|
||||||
if media_state == "play":
|
if media_state == "play":
|
||||||
return MediaPlayerState.PLAYING
|
return MediaPlayerState.PLAYING
|
||||||
|
@ -45,7 +45,6 @@ from homeassistant.const import (
|
|||||||
STATE_ON,
|
STATE_ON,
|
||||||
STATE_PAUSED,
|
STATE_PAUSED,
|
||||||
STATE_PLAYING,
|
STATE_PLAYING,
|
||||||
STATE_STANDBY,
|
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.exceptions import HomeAssistantError, ServiceValidationError
|
from homeassistant.exceptions import HomeAssistantError, ServiceValidationError
|
||||||
@ -156,8 +155,8 @@ async def test_entity_supported_features_with_control_bus(
|
|||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
("power_state", "play_state", "media_player_state"),
|
("power_state", "play_state", "media_player_state"),
|
||||||
[
|
[
|
||||||
(True, "NETWORK", STATE_STANDBY),
|
(True, "NETWORK", STATE_OFF),
|
||||||
(False, "NETWORK", STATE_STANDBY),
|
(False, "NETWORK", STATE_OFF),
|
||||||
(False, "play", STATE_OFF),
|
(False, "play", STATE_OFF),
|
||||||
(True, "play", STATE_PLAYING),
|
(True, "play", STATE_PLAYING),
|
||||||
(True, "pause", STATE_PAUSED),
|
(True, "pause", STATE_PAUSED),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user