Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions custom_components/oppo_udp/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

from homeassistant.const import (
CONF_HOST,
STATE_PAUSED,
STATE_PLAYING,
)
from homeassistant.core import callback
import homeassistant.util.dt as dt_util
Expand Down Expand Up @@ -104,7 +102,7 @@ def state(self):
return MediaPlayerState.PLAYING
if state in [PlayStatus.PAUSE, PlayStatus.SLOW_FORWARD, PlayStatus.SLOW_REVERSE, PlayStatus.FAST_FORWARD, PlayStatus.FAST_REVERSE]:
return MediaPlayerState.PAUSED
return MediaPlayerState.STANDBY
return MediaPlayerState.IDLE
return None

@property
Expand Down Expand Up @@ -178,7 +176,7 @@ def media_position(self):
@property
def media_position_updated_at(self):
"""Last valid time of media position."""
if self.state in (STATE_PLAYING, STATE_PAUSED):
if self.state in (MediaPlayerState.PLAYING, MediaPlayerState.PAUSED):
return dt_util.utcnow()
return None

Expand Down