__pycache__
-.mercedesme_credentials
+.mercedesme_config
.mercedesme_token
.mercedesme_resources
*.pyc
\ No newline at end of file
- Config Flow for automatic configuration
- Log Management
- Bugfix & Software optimizations
+
For further details please refer to [issues list][issues-url].
### Installation
## Installation
To use this script it's necessary to perform the following instructions:
1) clone the repository
-2) create a credentials files (.mercedesme_credentials) with:
+2) create a config file (.mercedesme_config) with:
```bash
CLIENT_ID=<**INSERT_YOUR_CLIENT_ID**>
CLIENT_SECRET=<**INSERT_YOUR_CLIENT_SECRET**>
# Init
########################
def __init__(self):
- self.credentials_file = CREDENTIALS_FILE
+ self.config_file = CONFIG_FILE
self.client_id = ""
self.client_secret = ""
self.vin = ""
def ReadConfig(self):
needToRefresh = False
- # Read Credentials from file
- if not os.path.isfile(self.credentials_file):
- _LOGGER.error(f"Credential File {self.credentials_file} not found")
+ # Read Config from file
+ if not os.path.isfile(self.config_file):
+ _LOGGER.error(f"Credential File {self.config_file} not found")
return False
try:
- f = ConfigObj(self.credentials_file)
+ f = ConfigObj(self.config_file)
except Exception:
- _LOGGER.error(f"Wrong {self.credentials_file} file found")
+ _LOGGER.error(f"Wrong {self.config_file} file found")
return False
# Client ID
self.client_id = f.get(CONF_CLIENT_ID)
VERSION = "0.9"
# Software Parameters
TOKEN_FILE = ".mercedesme_token"
-CREDENTIALS_FILE = ".mercedesme_credentials"
+CONFIG_FILE = ".mercedesme_config"
RESOURCES_FILE = ".mercedesme_resources"
# Mercedes me Application Parameters
REDIRECT_URL = "https://localhost"
VERSION = "0.9"
# Software Parameters
TOKEN_FILE = ".mercedesme_token"
-CREDENTIALS_FILE = ".mercedesme_credentials"
RESOURCES_FILE = ".mercedesme_resources"
# Mercedes me Application Parameters
REDIRECT_URL = "https://localhost"
- Config Flow for automatic configuration
- Log Management
- Bugfix & Software optimizations
+
For further details please refer to [issues list][issues-url].
{% if not installed %}
# Script Name & Version
NAME="mercedes_me_api.sh"
-VERSION="0.5"
+VERSION="0.6"
# Script Parameters
TOKEN_FILE=".mercedesme_token"
-CREDENTIALS_FILE=".mercedesme_credentials"
+CONFIG_FILE=".mercedesme_config"
# Mercedes me Application Parameters
REDIRECT_URL="https://localhost"
SCOPE="mb:vehicle:mbdata:fuelstatus%20mb:vehicle:mbdata:vehiclestatus%20mb:vehicle:mbdata:vehiclelock%20mb:vehicle:mbdata:evstatus%20mb:vehicle:mbdata:payasyoudrive%20offline_access"
CLIENT_SECRET=""
VEHICLE_ID=""
# Loading Credentials
-if [[ -f "$CREDENTIALS_FILE" ]]; then
- . $CREDENTIALS_FILE
+if [[ -f "$CONFIG_FILE" ]]; then
+ . $CONFIG_FILE
fi
if [ -z $CLIENT_ID ] | [ -z $CLIENT_ID ] | [ -z $CLIENT_ID ]; then
- echo "Please create $CREDENTIALS_FILE with CLIENT_ID=\"\", CLIENT_SECRET=\"\", VEHICLE_ID=\"\""
+ echo "Please create $CONFIG_FILE with CLIENT_ID=\"\", CLIENT_SECRET=\"\", VEHICLE_ID=\"\""
exit
fi