SecKatie / wyzeapy

36 stars 26 forks source link

Updated Wyzeapy to be compatible with Wyze Sensors (old model) #5

Closed faanskit closed 2 years ago

faanskit commented 3 years ago

Updated Wyzeapy to be compatible with Wyze Sensors (old model). And fixed #4

CLAassistant commented 3 years ago

CLA assistant check
All committers have signed the CLA.

faanskit commented 3 years ago

The SonarCloud check failing on code I did not touch in this PR. I will not fix this supposed error.

SecKatie commented 3 years ago

The SonarCloud check failing on code I did not touch in this PR. I will not fix this supposed error.

No worries it was changed in the master, so we will just have to make sure the merge happens correctly. SonarCloud is not the best but it is free haha

sonarcloud[bot] commented 3 years ago

SonarCloud Quality Gate failed.

Bug C 2 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

faanskit commented 3 years ago

Sample code for turning notifications on/off

These variants work

from wyzeapy.base_client import AccessTokenError, DeviceTypes, Device, PropertyIDs, ActionNotSupported, Group, EventTypes
from wyzeapy.client import Client
import sys

if __name__ == '__main__':
    if len(sys.argv) == 2:
        wyze_client = Client("username", "password")
        devices = wyze_client.get_devices()
        for device in devices:
            device_type: DeviceTypes = DeviceTypes(device.product_type)
            if device_type == DeviceTypes.CAMERA:
                if sys.argv[1] == "off":
                    device_info = wyze_client.notifications_off(device, PropertyIDs.NOTIFICATIONS)
                elif sys.argv[1] == "on":
                    device_info = wyze_client.notifications_on(device, PropertyIDs.NOTIFICATIONS)
SecKatie commented 3 years ago

Hey @faanskit can you update this to fit the current project?

faanskit commented 3 years ago

Hey @faanskit can you update this to fit the current project?

Sure, but it will take some time before I can do it. Do not have access to a dev enviroment for a few weeks and have not followed what changes has been made.

SecKatie commented 3 years ago

No worries! Whenever you get a chance