mirror of
https://github.com/flobz/psa_car_controller.git
synced 2026-08-22 17:36:15 +00:00
add constants file
This commit is contained in:
+1
-6
@@ -7,15 +7,10 @@ from time import sleep
|
||||
|
||||
import pytz
|
||||
|
||||
from libs.psa_constants import DISCONNECTED, INPROGRESS, FINISHED
|
||||
from my_psacc import MyPSACC
|
||||
from mylogger import logger
|
||||
|
||||
DISCONNECTED = "Disconnected"
|
||||
INPROGRESS = "InProgress"
|
||||
FAILURE = "Failure"
|
||||
STOPPED = "Stopped"
|
||||
FINISHED = "Finished"
|
||||
|
||||
|
||||
class ChargeControl:
|
||||
MQTT_TIMEOUT = 60
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
DELAYED_CHARGE = "delayed"
|
||||
IMMEDIATE_CHARGE = "immediate"
|
||||
PSA_CORRELATION_DATE_FORMAT = "%Y%m%d%H%M%S%f"
|
||||
PSA_DATE_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
|
||||
realm_info = {
|
||||
"clientsB2CPeugeot": {"oauth_url": "https://idpcvs.peugeot.com/am/oauth2/access_token", "app_name": "MyPeugeot"},
|
||||
"clientsB2CCitroen": {"oauth_url": "https://idpcvs.citroen.com/am/oauth2/access_token", "app_name": "MyCitroen"},
|
||||
"clientsB2CDS": {"oauth_url": "https://idpcvs.driveds.com/am/oauth2/access_token", "app_name": "MyDS"},
|
||||
"clientsB2COpel": {"oauth_url": "https://idpcvs.opel.com/am/oauth2/access_token", "app_name": "MyOpel"},
|
||||
"clientsB2CVauxhall": {"oauth_url": "https://idpcvs.vauxhall.co.uk/am/oauth2/access_token",
|
||||
"app_name": "MyVauxhall"}
|
||||
}
|
||||
MQTT_BRANDCODE = {"AP": "AP",
|
||||
"AC": "AC",
|
||||
"DS": "AC",
|
||||
"VX": "OV",
|
||||
"OP": "OV"
|
||||
}
|
||||
DISCONNECTED = "Disconnected"
|
||||
INPROGRESS = "InProgress"
|
||||
FAILURE = "Failure"
|
||||
STOPPED = "Stopped"
|
||||
FINISHED = "Finished"
|
||||
+2
-24
@@ -13,11 +13,12 @@ from requests.exceptions import RequestException
|
||||
from urllib3.exceptions import InvalidHeader
|
||||
|
||||
import psa_connectedcar as psac
|
||||
from charge_control import INPROGRESS
|
||||
from libs.car import Cars, Car
|
||||
from libs.charging import Charging
|
||||
from libs.oauth import OpenIdCredentialManager, Oauth2PSACCApiConfig, OauthAPIClient
|
||||
from ecomix import Ecomix
|
||||
from libs.psa_constants import DELAYED_CHARGE, IMMEDIATE_CHARGE, PSA_CORRELATION_DATE_FORMAT, PSA_DATE_FORMAT, \
|
||||
realm_info, MQTT_BRANDCODE, INPROGRESS
|
||||
from otp.otp import load_otp, new_otp_session, save_otp, ConfigException, Otp
|
||||
from psa_connectedcar.rest import ApiException
|
||||
from mylogger import logger
|
||||
@@ -26,29 +27,6 @@ from libs.utils import rate_limit, parse_hour
|
||||
from web.abrp import Abrp
|
||||
from web.db import Database
|
||||
|
||||
DELAYED_CHARGE = "delayed"
|
||||
|
||||
IMMEDIATE_CHARGE = "immediate"
|
||||
|
||||
PSA_CORRELATION_DATE_FORMAT = "%Y%m%d%H%M%S%f"
|
||||
PSA_DATE_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
|
||||
|
||||
realm_info = {
|
||||
"clientsB2CPeugeot": {"oauth_url": "https://idpcvs.peugeot.com/am/oauth2/access_token", "app_name": "MyPeugeot"},
|
||||
"clientsB2CCitroen": {"oauth_url": "https://idpcvs.citroen.com/am/oauth2/access_token", "app_name": "MyCitroen"},
|
||||
"clientsB2CDS": {"oauth_url": "https://idpcvs.driveds.com/am/oauth2/access_token", "app_name": "MyDS"},
|
||||
"clientsB2COpel": {"oauth_url": "https://idpcvs.opel.com/am/oauth2/access_token", "app_name": "MyOpel"},
|
||||
"clientsB2CVauxhall": {"oauth_url": "https://idpcvs.vauxhall.co.uk/am/oauth2/access_token",
|
||||
"app_name": "MyVauxhall"}
|
||||
}
|
||||
|
||||
MQTT_BRANDCODE = {"AP": "AP",
|
||||
"AC": "AC",
|
||||
"DS": "AC",
|
||||
"VX": "OV",
|
||||
"OP": "OV"
|
||||
}
|
||||
|
||||
AUTHORIZE_SERVICE = "https://api.mpsa.com/api/connectedcar/v2/oauth/authorize"
|
||||
REMOTE_URL = "https://api.groupe-psa.com/connectedcar/v4/virtualkey/remoteaccess/token?client_id="
|
||||
SCOPE = ['openid profile']
|
||||
|
||||
Reference in New Issue
Block a user