From 84ff66beccf748e6efda82259e4449dba38f543e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Fri, 28 Jun 2019 00:47:09 +0200 Subject: [PATCH] Don't use aiofiles. It's anoying to install in docker --- custom_components/browser_mod/manifest.json | 2 +- custom_components/browser_mod/mod_view.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/custom_components/browser_mod/manifest.json b/custom_components/browser_mod/manifest.json index 8f13c70..a559ef5 100644 --- a/custom_components/browser_mod/manifest.json +++ b/custom_components/browser_mod/manifest.json @@ -4,5 +4,5 @@ "documentation": "", "dependencies": ["websocket_api", "http"], "codeowners": [], - "requirements": ["aiofiles"] + "requirements": [] } diff --git a/custom_components/browser_mod/mod_view.py b/custom_components/browser_mod/mod_view.py index 83452e0..ec84dfb 100644 --- a/custom_components/browser_mod/mod_view.py +++ b/custom_components/browser_mod/mod_view.py @@ -1,5 +1,4 @@ from aiohttp import web -import aiofiles from homeassistant.components.http import HomeAssistantView from .const import FRONTEND_SCRIPT_URL, DATA_EXTRA_MODULE_URL @@ -28,8 +27,8 @@ class ModView(HomeAssistantView): filecontent = "" try: - async with aiofiles.open(path, mode="r", encoding="utf-8", errors="ignore") as localfile: - filecontent = await localfile.read() + with open(path, mode="r", encoding="utf-8", errors="ignore") as localfile: + filecontent = localfile.read() localfile.close() except Exception as exception: pass