fix charge_control arg

This commit is contained in:
Florian Bezannier
2020-11-15 11:25:43 +01:00
parent 0c106b9a35
commit 16df424208
3 changed files with 7 additions and 4 deletions
+1
View File
@@ -144,6 +144,7 @@ class MyPSACC:
"id"] + "/status?client_id=" + self.client_id, headers=MyPSACC.headers, data=body)
data = res.json()
return data
def get_vehicles(self):
res =self.api().get_vehicles_by_device()
+5 -3
View File
@@ -46,10 +46,12 @@ With this app you will be able to :
3. If it works you will have VIN of your vehicles and there ids in the last line. The script generate a test.json file with all credentials needed.
## II. Use the app
1. start the app:
``python3 server.py -f test.json``
1. Install requirements
```pip3 install -r requirements.txt```
2. start the app:
``python3 server.py -f test.json -c charge_control1.json``
2. Test it
3. Test it
2.1 Get the car state :
http://localhost:5000/get_vehiculeinfo/YOURVIN
+1 -1
View File
@@ -63,7 +63,7 @@ def charge_control():
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("-f","--config", help="config file",type = argparse.FileType('r'))
parser.add_argument("-c","--charge-control", help="enable charge control",action="store_true")
parser.add_argument("-c","--charge-control", help="enable charge control",const="charge_control.json", nargs='?')
parser.parse_args()
return parser