Fix event enum string conversion to value

This commit is contained in:
Sebastian Goscik
2023-11-01 21:32:19 +00:00
parent 5fa202005b
commit 701fd9b0a8
3 changed files with 8 additions and 8 deletions

View File

@@ -131,7 +131,7 @@ class MissingEventChecker:
logger.extra_debug(f"Ignoring event '{event.id}'")
await self._db.execute(
"INSERT INTO events VALUES "
f"('{event.id}', '{event.type}', '{event.camera_id}',"
f"('{event.id}', '{event.type.value}', '{event.camera_id}',"
f"'{event.start.timestamp()}', '{event.end.timestamp()}')"
)
await self._db.commit()
@@ -154,7 +154,7 @@ class MissingEventChecker:
shown_warning = True
if event.type != EventType.SMART_DETECT:
event_name = f"{event.id} ({event.type})"
event_name = f"{event.id} ({event.type.value})"
else:
event_name = f"{event.id} ({', '.join(event.smart_detect_types)})"