@callback
def qr_state_listener(entity, old_state, new_state):
    'Handle device state changes.'
    self._refresh_()
Handle device state changes.
@callback
def qr_state_listener(entity, old_state, new_state):
    
    self._refresh_()