SecKatie / wyzeapy

36 stars 26 forks source link

228 - Get lock/camera battery statuses #20

Closed JoeSchubert closed 2 years ago

JoeSchubert commented 2 years ago

This change supports the Home Assistant integration change request to display lock, keypad and Wyze Cam Outdoor batter levels. By cacheing/updating these values we'll also be able to support the request in Integration Issue #145

Basically, we're going to cache the device_params info from the get_device_list endpoint since they hold the battery info. For now, we'll update this info every 20 minutes which should alleviate too much hammering of Wyze's API. That info will provide updated battery levels, ip addresses, RSSIs etc.

The lock service was modified to reflect these changes and should be fully backward compatible.

SecKatie commented 2 years ago

Ok so my lock doesn't work and I do not have the following in my logs:

My suspicion is that it has something to do with the async def _get_lock_info(self, device: Device) function and "with_keypad": "1" since I do not have a keypad.

JoeSchubert commented 2 years ago

I agree. I wasn't sure how it would respond with that if someone didn't have a keypad. I think I found a different endpoint to use for this, but I'm going to have to tweak how it's processed I think.

SecKatie commented 2 years ago

merged in: cdd681040d1fb36c6bb81cf59e77505cacd0000d