def _add_test_states(self):
Add multiple states to the db for testing.
now = int(time.time())
five_days_ago = now - (60*60*24*5)
attributes = {"test_attr": 5, "test_attr_10": "nice"}
self.hass.pool.block_till_done()
recorder._INSTANCE.block_till_done()
After Change
def _add_test_states(self):
Add multiple states to the db for testing.
now = datetime.now()
five_days_ago = now - timedelta(days=5)
attributes = {"test_attr": 5, "test_attr_10": "nice"}
self.hass.pool.block_till_done()
recorder._INSTANCE.block_till_done()