'Execute the change request and pull out the new state.'

def do_change_request(self, requested_state):

    response = requests.put(API_ACTION_URL.format(self.device_id, self.access_token, requested_state), timeout=5)
    if (response.status_code == 200):
        return response.json()['state']
    _LOGGER.error('Error    setting    lock    state:    %s\n%s', requested_state, response.text)
    return self._state
