This commit is contained in:
Johann Kellerman 2017-02-08 23:16:39 +02:00 committed by Paulus Schoutsen
parent 4f20a2d3ea
commit 612aa1cf21

View File

@ -118,10 +118,12 @@ def run_information(point_in_time: Optional[datetime]=None):
start=_INSTANCE.recording_start, start=_INSTANCE.recording_start,
closed_incorrect=False) closed_incorrect=False)
with session_scope(): with session_scope() as session:
return query('RecorderRuns').filter( res = query(recorder_runs).filter(
(recorder_runs.start < point_in_time) & (recorder_runs.start < point_in_time) &
(recorder_runs.end > point_in_time)).first() (recorder_runs.end > point_in_time)).first()
session.expunge(res)
return res
def setup(hass: HomeAssistant, config: ConfigType) -> bool: def setup(hass: HomeAssistant, config: ConfigType) -> bool: