Skip to content

nexus player state incorrect #45

@tungmeister

Description

@tungmeister

I've just setup the component for use with my nexux player and I've an issue that the state is always shown as 'playing' other than when the ambient display mode is on at which point it switches to 'idle'. I believe the issue is because the state is being reported based on the audo_state property always reporting as 'playing'.

looking at the 'GET_PROPERTIES' it looks as though the state would work better if derived from the 'media_session_state' attribute as this a 0 when nothing is playing a 1 or 3 when playing and a 2 when paused. see my responses:

{
"entity_id": "media_player.living_room_display","command": "GET_PROPERTIES"
}

adb_response: {'screen_on': True, 'awake': True, 'wake_lock_size': 4, 'media_session_state': 0, 'current_app': 'com.google.android.tvlauncher', 'audio_state': 'playing', 'device': 'hdmi', 'is_volume_muted': False, 'volume': None}

adb_response: {'screen_on': True, 'awake': True, 'wake_lock_size': 5, 'media_session_state': 3, 'current_app': 'com.google.android.youtube.tv', 'audio_state': 'playing', 'device': 'hdmi', 'is_volume_muted': False, 'volume': None}

adb_response: {'screen_on': True, 'awake': True, 'wake_lock_size': 5, 'media_session_state': 3, 'current_app': 'com.netflix.ninja', 'audio_state': 'playing', 'device': 'hdmi', 'is_volume_muted': False, 'volume': None}

adb_response: {'screen_on': True, 'awake': True, 'wake_lock_size': 6, 'media_session_state': 1, 'current_app': 'de.cyberdream.dreamepg.tvh.tv.player', 'audio_state': 'playing', 'device': 'hdmi', 'is_volume_muted': False, 'volume': None}

adb_response: {'screen_on': True, 'awake': True, 'wake_lock_size': 5, 'media_session_state': 2, 'current_app': 'com.google.android.youtube.tv', 'audio_state': 'playing', 'device': 'hdmi', 'is_volume_muted': False, 'volume': None}

adb_response: {'screen_on': True, 'awake': True, 'wake_lock_size': 5, 'media_session_state': 2, 'current_app': 'com.netflix.ninja', 'audio_state': 'playing', 'device': 'hdmi', 'is_volume_muted': False, 'volume': None}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions