Add emit function to send messages to OSD
This commit is contained in:
parent
156ef04b61
commit
a937679b23
|
@ -6,11 +6,17 @@ import requests
|
|||
import config
|
||||
from plugins import plugins
|
||||
|
||||
def emit(event, data):
|
||||
json = {
|
||||
"event": event,
|
||||
"data": data
|
||||
}
|
||||
return requests.post(config.OSD_URL, json=json)
|
||||
|
||||
def main():
|
||||
data = requests.get(config.CAR_API_URL)
|
||||
for plugin in plugins:
|
||||
plugin.check(data)
|
||||
plugin.check(data, emit)
|
||||
|
||||
if __name__ == "__main__":
|
||||
while True:
|
||||
|
|
Loading…
Reference in New Issue