From d9de230b249c2358451ab9ca54d5614abd333871 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sun, 30 Jan 2022 23:52:17 +0000 Subject: [PATCH] Increase buffer --- main.py | 7 ++++--- pyezviz/mqtt.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 76a5892..6299c0a 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,6 @@ -import os +import os, sys import logging -logging.basicConfig( +logging.basicConfig(stream=sys.stdout, format='[%(asctime)s] %(levelname)s %(module)s/%(funcName)s - %(message)s', level=logging.DEBUG if os.environ.get('DEBUG') else logging.INFO) @@ -49,7 +49,8 @@ if __name__ == '__main__': logging.info('==========================') logging.info('Booting up...') pygame.init() - pygame.mixer.init(buffer=1024) + pygame.mixer.pre_init(buffer=4096) + pygame.mixer.init(buffer=4096) client = EzvizClient(secrets.EZVIZ_EMAIL, secrets.EZVIZ_PASS, 'apiius.ezvizlife.com') try: diff --git a/pyezviz/mqtt.py b/pyezviz/mqtt.py index 8c8f604..c634657 100644 --- a/pyezviz/mqtt.py +++ b/pyezviz/mqtt.py @@ -35,7 +35,7 @@ def on_connect(client, userdata, flags, return_code): """On MQTT connect.""" # pylint: disable=unused-argument if return_code == 0: - logging.info("connected OK Returned code=%s", return_code) + logging.debug("connected OK Returned code=%s", return_code) else: logging.info("Bad connection Returned code=%s", return_code) client.reconnect()