send heartbeat
This commit is contained in:
parent
7de5856829
commit
4a35900bf5
|
@ -23,7 +23,6 @@
|
|||
* Store parsed data in Lodur text fields for copy/paste
|
||||
* Cleanup code into proper functions and classes
|
||||
* Lodur "API" class
|
||||
* Heartbeat
|
||||
|
||||
### Known instabilities
|
||||
|
||||
|
@ -89,4 +88,4 @@ _03. Verrechnungsart_
|
|||
|
||||
<option value="13" rc-id="ak">ADL-/HRF-Einsatz BRAND (ADL = OFW-Fahrzeug)</option>
|
||||
<option value="15" rc-id="tt">Grosstierrettung Stützpunkt (PIF mit Kran)</option>
|
||||
```
|
||||
```
|
||||
|
|
4
main.py
4
main.py
|
@ -8,6 +8,7 @@ from datetime import datetime
|
|||
import asyncio
|
||||
import logging
|
||||
import time
|
||||
import requests
|
||||
import email
|
||||
import email.parser
|
||||
import imaplib
|
||||
|
@ -36,6 +37,7 @@ mqtt_password = os.getenv("MQTT_PASSWORD")
|
|||
lodur_user = os.getenv("LODUR_USER")
|
||||
lodur_password = os.getenv("LODUR_PASSWORD")
|
||||
lodur_base_url = os.getenv("LODUR_BASE_URL")
|
||||
heartbeat_url = os.getenv("HEARTBEAT_URL")
|
||||
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
|
@ -275,6 +277,8 @@ def main():
|
|||
else:
|
||||
logger.error('Unknown type: ' + f_type)
|
||||
|
||||
# send heartbeat
|
||||
requests.get(heartbeat_url)
|
||||
# repeat every
|
||||
time.sleep(_INTERVAL)
|
||||
|
||||
|
|
Loading…
Reference in New Issue