Update recorder. (#2549)

* Update recorder.

models.py:
 - Use scoped_session in models.py to fix shutdown error
__init__.py:
 - Session _commit & retry method
 - Single session var for purge_data
 - Ensure single _INSTANCE
 - repeat purge every 2 days
 - show correct time in log_error

* _commit

* Restore models to old functionality, swap purge, remove _INSTANCE cleanup from tests, typing ignore Base class

* pylint

* Remove recorder from model unit test
This commit is contained in:
Johann Kellerman authored and Paulus Schoutsen committed 2016-07-23 11:25:17 -07:00
1 parent d4f78e8552
commit 4cf618334c
4 files changed
+80 -65

No files matched your search

+2 -2
View File
@@ -1,8 +1,8 @@
"""The tests for the Recorder component."""
# pylint: disable=too-many-public-methods,protected-access
import unittest
# pylint: disable=protected-access
import json
from datetime import datetime, timedelta
import unittest
from unittest.mock import patch
from homeassistant.const import MATCH_ALL