timestamp = now
state = "dontpurgeme"
self.session.add(recorder.get_model("States")(
entity_id="test.recorder2",
domain="sensor",
state=state,
attributes=json.dumps(attributes),
last_changed=timestamp,
last_updated=timestamp,
created=timestamp,
event_id=event_id + 1000
))
self.session.commit()
def _add_test_events(self):
Add a few events for testing.
now = datetime.now()