From 1353d52bd1f4865033421d95a704661347df3449 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Tue, 19 Sep 2017 17:51:16 +0200 Subject: [PATCH] Reset json file to default on schema error (#193) --- hassio/tools.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hassio/tools.py b/hassio/tools.py index 53a06eb2a..0cd34e0e3 100644 --- a/hassio/tools.py +++ b/hassio/tools.py @@ -123,6 +123,8 @@ class JsonConfig(object): except vol.Invalid as ex: _LOGGER.error("Can't parse %s -> %s", self._file, humanize_error(self._data, ex)) + # reset data to default + self._data = self._schema({}) def save(self): """Store data to config file."""