Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
zeroConf changes
Browse files Browse the repository at this point in the history
  • Loading branch information
maykar authored Jan 20, 2021
1 parent fdc32da commit 52814e7
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions custom_components/plex_assistant/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ async def async_setup(hass, config):
from pychromecast import get_chromecasts
from pychromecast.controllers.plex import PlexController
from homeassistant.helpers.network import get_url
from homeassistant.components.zeroconf import async_get_instance
from .localize import LOCALIZE
from .process_speech import process_speech
from .helpers import (
Expand All @@ -73,18 +74,11 @@ async def async_setup(hass, config):
lang = conf.get(CONF_LANG)
tts_error = conf.get(CONF_TTS_ERROR)
aliases = conf.get(CONF_ALIASES)
zc = await async_get_instance(hass)

_LOGGER = logging.getLogger(__name__)

localize = LOCALIZE[lang] if lang in LOCALIZE.keys() else LOCALIZE["en"]
zc = None

try:
from homeassistant.components.zeroconf import async_get_instance
zc = await async_get_instance(hass)
except:
from zeroconf import Zeroconf
zc = Zeroconf()

directory = hass.config.path() + "/www/plex_assist_tts/"
if tts_error and not os.path.exists(directory):
Expand Down

0 comments on commit 52814e7

Please sign in to comment.