def update_check(self, existing, new):
old_state = existing.state<EOL>if '<STR_LIT>' in existing.session_raw:<EOL><INDENT>try:<EOL><INDENT>old_theme = existing.session_raw['<STR_LIT>']['<STR_LIT>']<EOL><DEDENT>except KeyError:<EOL><INDENT>old_theme = False<EOL><DEDENT><DEDENT>else:<EOL><INDENT>old_theme = False<EOL><DEDENT>if '<STR_LIT>' in new:<EOL><INDENT>if new['<STR_LIT>']['<STR_LIT>']:<EOL><INDENT>new_state = STATE_PAUSED<EOL><DEDENT>else:<EOL><INDENT>new_state = STATE_PLAYING<EOL><DEDENT>try:<EOL><INDENT>new_theme = new['<STR_LIT>']['<STR_LIT>']<EOL><DEDENT>except KeyError:<EOL><INDENT>new_theme = False<EOL><DEDENT><DEDENT>else:<EOL><INDENT>new_state = STATE_IDLE<EOL>new_theme = False<EOL><DEDENT>if old_theme or new_theme:<EOL><INDENT>return False<EOL><DEDENT>elif old_state == STATE_PLAYING or new_state == STATE_PLAYING:<EOL><INDENT>return True<EOL><DEDENT>elif old_state != new_state:<EOL><INDENT>return True<EOL><DEDENT>else:<EOL><INDENT>return False<EOL><DEDENT>
Check device state to see if we need to fire the callback.

        True if either state is 'Playing'
        False if both states are: 'Paused', 'Idle', or 'Off'
        True on any state transition.