From c99dd127e03f1807e239014deef2d3647e392fa6 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Mon, 21 Dec 2020 12:49:07 +0530 Subject: [PATCH] Add daemon.py and plugins --- daemon.py | 18 ++++++++++++++++++ plugins/__init__.py | 1 + 2 files changed, 19 insertions(+) create mode 100755 daemon.py create mode 100644 plugins/__init__.py diff --git a/daemon.py b/daemon.py new file mode 100755 index 0000000..eadfef8 --- /dev/null +++ b/daemon.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python +import time + +import requests + +import config +from plugins import plugins + + +def main(): + data = requests.get(config.CAR_API_URL) + for plugin in plugins: + plugin.check(data) + +if __name__ == "__main__": + while True: + main() + time.sleep(config.DELAY) diff --git a/plugins/__init__.py b/plugins/__init__.py new file mode 100644 index 0000000..bf320ab --- /dev/null +++ b/plugins/__init__.py @@ -0,0 +1 @@ +plugins = []