Reset json file to default on schema error (#193)

This commit is contained in:
Pascal Vizeli 2017-09-19 17:51:16 +02:00 committed by GitHub
parent b7820bc6a6
commit 1353d52bd1

View File

@ -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."""