Replace MediaPlayerState.STANDBY with MediaPlayerState.OFF in apple_tv (#148132)

This commit is contained in:
Erik Montnemery 2025-07-04 16:31:44 +02:00 committed by GitHub
parent a046530eaf
commit 04bd1967a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -191,7 +191,7 @@ class AppleTvMediaPlayer(
self._is_feature_available(FeatureName.PowerState) self._is_feature_available(FeatureName.PowerState)
and self.atv.power.power_state == PowerState.Off and self.atv.power.power_state == PowerState.Off
): ):
return MediaPlayerState.STANDBY return MediaPlayerState.OFF
if self._playing: if self._playing:
state = self._playing.device_state state = self._playing.device_state
if state in (DeviceState.Idle, DeviceState.Loading): if state in (DeviceState.Idle, DeviceState.Loading):
@ -200,7 +200,7 @@ class AppleTvMediaPlayer(
return MediaPlayerState.PLAYING return MediaPlayerState.PLAYING
if state in (DeviceState.Paused, DeviceState.Seeking, DeviceState.Stopped): if state in (DeviceState.Paused, DeviceState.Seeking, DeviceState.Stopped):
return MediaPlayerState.PAUSED return MediaPlayerState.PAUSED
return MediaPlayerState.STANDBY # Bad or unknown state? return MediaPlayerState.IDLE # Bad or unknown state?
return None return None
@callback @callback