From d02e3feb6a8227a481705294cc0b068ac4b64637 Mon Sep 17 00:00:00 2001 From: frankdpGH <60138601+frankdpGH@users.noreply.github.com> Date: Sun, 11 Apr 2021 17:37:38 +0200 Subject: [PATCH 1/2] Add pychromecast and force update pychromecast.py if pychromecast is old version : import errors because of the urlparse problem => an update needs to be forced this error creates a reinstall of all pip modules => install socket is not needed as integrated in basic environment --- smarthome.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/smarthome.py b/smarthome.py index 0fc95ac..fc09271 100644 --- a/smarthome.py +++ b/smarthome.py @@ -32,20 +32,25 @@ if 'Chromecast_Name' in configuration and configuration['Chromecast_Name'] != 'add_chromecast_name': try: import pychromecast - import socket ## + except ImportError as e: + logger.error('Installing package pychromecast') + subprocess.call(['pip3', 'install', '--upgrade', '--force-reinstall', 'pychromecast']) + try: from gtts import gTTS - from slugify import slugify except ImportError as e: - logger.error('Installing package pychromecast, socket, gtts and slugify') - subprocess.call(['pip3', 'install', 'pychromecast']) - subprocess.call(['pip3', 'install', 'socket']) ## + logger.error('Installing package gtts') subprocess.call(['pip3', 'install', 'gtts']) + try: + from slugify import slugify + except ImportError as e: + logger.error('Installing package slugify') subprocess.call(['pip3', 'install', 'slugify']) - import pychromecast - import socket ## - from gtts import gTTS - from slugify import slugify + import pychromecast + import socket ## + from gtts import gTTS + from slugify import slugify + logger.info("Starting up chromecasts") try: chromecasts, _ = pychromecast.get_chromecasts() From 7b52a8df8b7bc44fb964ae1377b6cca7de5efb74 Mon Sep 17 00:00:00 2001 From: DewGew Date: Mon, 12 Apr 2021 20:13:55 +0200 Subject: [PATCH 2/2] Fix notification --- const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/const.py b/const.py index 2cb4be5..c17be4f 100644 --- a/const.py +++ b/const.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Constants for Google Assistant.""" -VERSION = '1.10.8' +VERSION = '1.10.9' PUBLIC_URL = 'https://[your public url]' CONFIGFILE = 'config/config.yaml' LOGFILE = 'dzga.log'