Python API to interface a lock

I am trying to lock/unlock a door using the python API
Looking at the code provided here:

My lock’s name is “lock1” and I am fairly certain the service used to lock things is “lock.lock”

When I run this code, I get a timeout error. If I manually set the timeout to 15, the code runs with no errors, but the door does not lock.
domain = ‘zwave’
switch_name = ‘zwave.lock1’
remote.call_service(api, domain, ‘lock.lock’, {‘entity_id’: ‘{}’.format(switch_name)})