log-viewer/emitter/emitter.py

13 lines
427 B
Python
Raw Normal View History

from pymongo import MongoClient
from bson.objectid import ObjectId
from time import sleep
2022-02-14 09:59:21 +00:00
MONGO_URI="mongodb://127.0.0.1:27017/default"
2022-02-14 09:59:21 +00:00
db = MongoClient(MONGO_URI).get_default_database()
while True:
2022-02-14 09:59:21 +00:00
db.eventlog.insert_one({ "timestamp": "...", "event": "motion-detected", "started": "...", "finished": "...", "component": "motion-detect", "camera": "Server room", "action": "event",
})
sleep(1)