From ec4b148a71c91ff7d926be49ff65fce3a04e1c72 Mon Sep 17 00:00:00 2001 From: Stu Gott Date: Fri, 20 Jan 2017 20:09:03 -0500 Subject: [PATCH] TTS: Invalidate broken file cache entries If a cached file cannot be read by the TTS component, then it should be removed from the file cache--or it will remain broken. --- homeassistant/components/tts/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/homeassistant/components/tts/__init__.py b/homeassistant/components/tts/__init__.py index 0f731a51485..5ee92747196 100644 --- a/homeassistant/components/tts/__init__.py +++ b/homeassistant/components/tts/__init__.py @@ -346,6 +346,7 @@ class SpeechManager(object): try: data = yield from self.hass.loop.run_in_executor(None, load_speech) except OSError: + del self.file_cache[key] raise HomeAssistantError("Can't read {}".format(voice_file)) self._async_store_to_memcache(key, filename, data)