mirror of
https://github.com/flobz/psa_car_controller.git
synced 2026-08-22 01:16:14 +00:00
add listen and port option
This commit is contained in:
@@ -76,6 +76,8 @@ def parse_args():
|
||||
parser.add_argument("-f", "--config", help="config file", type=argparse.FileType('r'))
|
||||
parser.add_argument("-c", "--charge-control", help="enable charge control", const="charge_config.json", nargs='?')
|
||||
parser.add_argument("-d", "--debug", help="enable debug", const=10, default=20, nargs='?')
|
||||
parser.add_argument("-l", "--listen", help="change server listen address", default="127.0.0.1")
|
||||
parser.add_argument("-p", "--port", help="change server listen address", default="5000")
|
||||
parser.add_argument("--remote-disable",help="disable remote control")
|
||||
parser.parse_args()
|
||||
return parser
|
||||
@@ -99,7 +101,7 @@ if __name__ == "__main__":
|
||||
client_paswword = input("mypeugeot password: ")
|
||||
myp.connect(client_email, client_paswword)
|
||||
logger.info(myp.get_vehicles())
|
||||
t1 = Thread(target=app.run)
|
||||
t1 = Thread(target=app.run,kwargs={"host":args.listen,"port":int(args.port)})
|
||||
t1.start()
|
||||
if args.remote_disable:
|
||||
logger.info("mqtt disabled")
|
||||
|
||||
Reference in New Issue
Block a user