Remove EzViz junk

This commit is contained in:
2022-01-30 17:05:24 -07:00
parent 6e669608bf
commit a091d161cb
10 changed files with 2 additions and 2181 deletions
+2 -22
View File
@@ -8,7 +8,6 @@ import time
import json
import pygame
from pyezviz import EzvizClient, MQTTClient
import secrets
@@ -34,16 +33,6 @@ def backdoor():
play_sound(CHIME)
play_sound(BACKDOOR)
def on_message(client, userdata, mqtt_message):
message = json.loads(mqtt_message.payload)
#print(json.dumps(mqtt_message, indent=4))
if message['alert'] == 'somebody there ring the door': # lmao
logging.info('Received door bell press alert')
if 'E80451501' in message['ext']:
logging.info('Backdoor pressed')
backdoor()
if __name__ == '__main__':
logging.info('')
logging.info('==========================')
@@ -52,14 +41,5 @@ if __name__ == '__main__':
pygame.mixer.pre_init(buffer=4096)
pygame.mixer.init(buffer=4096)
client = EzvizClient(secrets.EZVIZ_EMAIL, secrets.EZVIZ_PASS, 'apiius.ezvizlife.com')
try:
logging.info('Logging into EZVIZ client...')
token = client.login()
mqtt = MQTTClient(token, on_message)
logging.info('Starting MQTT...')
mqtt.start()
except Exception as exp:
logging.exception(str(exp))
finally:
client.close_session()
backdoor()