shauntarves/wyze-sdk

client.locks.unlock() and client.locks.lock methods for Locks are not working

Closed this issue · 1 comments

Hello!
I've been trying to use this sdk with my Lock+Gateway, they're synced in my account and everything.
Here is the code to that I'm trying to use:

import os
from wyze_sdk import Client

client = Client(
    email=os.environ['email'],
    password=os.environ['password'],
    key_id=os.environ['key_id'],
    api_key=os.environ['api_key']
)

lock = client.locks.list()[0]
print(client.locks.unlock(lock.mac))

When I run this code is that I recieve the following response: {'ReqID': 'bcfbb1b3fa', 'ErrNo': 0, 'ErrMsg': ''} and doesn't unlock the lock, the same happens with client.locks.lock(lock.mac). Other methods like get_records() are working fine, but is just that I can't lock/unlock!
Is there a problem with my core or the api? Thanks for developing this sdk!

That's not quite how the python client works. You need to use:

client.locks.lock(device_mac=<did>) where <did> should look something like YD.LO1.abcdef01234456789...