while isinstance(check_target, functools.partial):
check_target = check_target.func
- if self._exit:
- LOGGER.debug("scheduling job %s while exiting!", check_target.__name__)
-
if threading.current_thread() is not threading.main_thread():
# called from other thread
if asyncio.iscoroutine(check_target):
@callback
def update_state(self) -> None:
"""Call to update current player state in the player manager."""
+ if self.mass.exit:
+ return
if not self.added_to_mass:
if self.enabled:
# player is now enabled and can be added
@property
def name(self) -> str:
"""Return name of this player."""
- return (
- self._chromecast.name if self._chromecast else self._cast_info.friendly_name
- )
+ return self._cast_info.friendly_name
@property
def powered(self) -> bool:
or self.media_status.player_is_paused
or self.media_status.player_is_idle
)
- return not self.cast_status.volume_muted and not self.cast_status.is_stand_by
+ # Chromecast does not support power so we (ab)use mute instead
+ return not self.cast_status.volume_muted
@property
def should_poll(self) -> bool:
@property
def state(self) -> PlaybackState:
"""Return the state of the player."""
- if self.cast_status and self.cast_status.is_stand_by:
- return PlaybackState.Off
if self.media_status is None:
return PlaybackState.Stopped
if self.media_status.player_is_playing: