Closed onigor closed 4 months ago
I am getting the same error. I am not able to create an access_code
@onigor @jose96043, thanks for reporting the issues you had with this. There's a problem since Wyze stopped supporting the old login method in favor of the developer key/token. In short, we no longer get the user_id
value "for free" from the login process, but the lock client needs this user_id
when creating new lock codes. I've updated the code and created a new release version, BUT there is still a change you need to make in your own scripts:
# create a client
client = wyze_sdk.Client(token='<...>', refresh_token='<...>')
# query the user info to get the userid
user_info = client.user_get_info() # <-- this is currently an UNSTRUCTURED wyze response
# there are two options:
# 1. set the user_id globally on your client (doesn't require latest code)
client._user_id = user_info['data']['user_center_id']
# 2. update your call to create_access_code to pass the user_id value (notice no underscore in the prop name)
client.locks.create_access_code(device_mac='<...>', ....., userid='<value from the user_info>')
the response is
Fist thought maybe I was providing the wrong params but doesn't matter what I send, always get the same response.