Final version sample config
This commit is contained in:
@@ -16,10 +16,10 @@ Como se usa?
|
|||||||
Parametros obligatorios
|
Parametros obligatorios
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
-u > Usuario de timenet (Pista Cero = 4c26cc59-ee52-4c47-b7fe-1065a5e5bf84)
|
- -u > Usuario de timenet (Pista Cero = 4c26cc59-ee52-4c47-b7fe-1065a5e5bf84)
|
||||||
-p > Pin de usuario
|
- -p > Pin de usuario
|
||||||
|
|
||||||
Tendremos que escojer también entre --basedtime o --type
|
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
|
- -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
|
- -t <0 = Entrada, 1 = Salida> > Forzamos estado al entrar/salir
|
||||||
@@ -54,7 +54,7 @@ class AutoFicher():
|
|||||||
self.loadConfig()
|
self.loadConfig()
|
||||||
|
|
||||||
def loadConfig(self):
|
def loadConfig(self):
|
||||||
with open('config.json', 'r') as f:
|
with open('sample.config.json', 'r') as f:
|
||||||
self.config = json.load(f)
|
self.config = json.load(f)
|
||||||
|
|
||||||
def sendReport(self, message):
|
def sendReport(self, message):
|
||||||
@@ -72,7 +72,7 @@ class AutoFicher():
|
|||||||
return requests.post(self.config['api_url']+url, data=data, headers=headers)
|
return requests.post(self.config['api_url']+url, data=data, headers=headers)
|
||||||
|
|
||||||
def updateTime(self):
|
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):
|
def getVersion(self):
|
||||||
self.updateTime()
|
self.updateTime()
|
||||||
|
|||||||
@@ -16,13 +16,12 @@
|
|||||||
],
|
],
|
||||||
"api_url": "https://timenet.gpisoftware.com/api/",
|
"api_url": "https://timenet.gpisoftware.com/api/",
|
||||||
"telegram": {
|
"telegram": {
|
||||||
"token": "1502426217:AAEBG7XF6dZqJ6cRmPQk_YykGS5mJFeUEto",
|
"token": "",
|
||||||
"chat_id": 12878473
|
"chat_id": 0
|
||||||
},
|
},
|
||||||
"geo": {
|
"geo": {
|
||||||
"latitude": 41.3908992,
|
"latitude": 0,
|
||||||
"longitude": 2.154496,
|
"longitude": 0,
|
||||||
"accuracy": 98.31
|
"accuracy": 0
|
||||||
},
|
}
|
||||||
"time_format": "%Y-%m-%dT%H:%M:%SZ"
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user