Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #258 from DewGew/beta
Browse files Browse the repository at this point in the history
Fixes install issue for chromecast notification
  • Loading branch information
DewGew authored Apr 13, 2021
2 parents 21209b7 + 7b52a8d commit ee5f4b8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion const.py
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
23 changes: 14 additions & 9 deletions smarthome.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit ee5f4b8

Please sign in to comment.