diff --git a/README.md b/README.md index 78fae8d..ee4c617 100644 --- a/README.md +++ b/README.md @@ -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 \ No newline at end of file + - -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 \ No newline at end of file diff --git a/autoficher.py b/autoficher.py index f941f19..518ef25 100755 --- a/autoficher.py +++ b/autoficher.py @@ -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() diff --git a/config.json b/sample.config.json similarity index 53% rename from config.json rename to sample.config.json index 68bac22..813acaa 100644 --- a/config.json +++ b/sample.config.json @@ -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 + } } \ No newline at end of file