Final version sample config

This commit is contained in:
Omar Sánchez
2021-10-05 10:04:48 +02:00
parent d23038c3c5
commit f212b586b0
3 changed files with 12 additions and 13 deletions

View File

@@ -16,10 +16,10 @@ Como se usa?
Parametros obligatorios
---------------
-u > Usuario de timenet (Pista Cero = 4c26cc59-ee52-4c47-b7fe-1065a5e5bf84)
-p > Pin de usuario
- -u > Usuario de timenet (Pista Cero = 4c26cc59-ee52-4c47-b7fe-1065a5e5bf84)
- -p > Pin de usuario
Tendremos que escojer también entre --basedtime o --type
-bt > No requiere argumento. Esto ficha y desficha basado en la configuración de horas a seguir
-t <0 = Entrada, 1 = Salida> > Forzamos estado al entrar/salir
- -bt > No requiere argumento. Esto ficha y desficha basado en la configuración de horas a seguir
- -t <0 = Entrada, 1 = Salida> > Forzamos estado al entrar/salir

View File

@@ -54,7 +54,7 @@ class AutoFicher():
self.loadConfig()
def loadConfig(self):
with open('config.json', 'r') as f:
with open('sample.config.json', 'r') as f:
self.config = json.load(f)
def sendReport(self, message):
@@ -72,7 +72,7 @@ class AutoFicher():
return requests.post(self.config['api_url']+url, data=data, headers=headers)
def updateTime(self):
self.headers["tn-d"] = "\""+datetime.now().astimezone(pytz.UTC).strftime(self.config['time_format'])+"\""
self.headers["tn-d"] = "\""+datetime.now().astimezone(pytz.UTC).strftime("%Y-%m-%dT%H:%M:%SZ")+"\""
def getVersion(self):
self.updateTime()

View File

@@ -16,13 +16,12 @@
],
"api_url": "https://timenet.gpisoftware.com/api/",
"telegram": {
"token": "1502426217:AAEBG7XF6dZqJ6cRmPQk_YykGS5mJFeUEto",
"chat_id": 12878473
"token": "",
"chat_id": 0
},
"geo": {
"latitude": 41.3908992,
"longitude": 2.154496,
"accuracy": 98.31
},
"time_format": "%Y-%m-%dT%H:%M:%SZ"
"latitude": 0,
"longitude": 0,
"accuracy": 0
}
}