enable_resources_file: <**ENABLE (true) OR DISABLE (false) RESOURCES - OPTIONAL (DEFAULT DISABLED)**>
scan_interval: <** TIME PERIOD (NUMBER OF SECONDS) TO REFRESH RESOURCES - OPTIONAL**>
```
-2) Actually it's not possible to retrieve the token from scratch. Please use the other script to retrieve the first token and copy it into hacs folder (.mercedesme_token)
+2) Actually it's not possible to retrieve the token from scratch. Please use the other scripts to retrieve the first token and copy it (.mercedesme_token) into the homeassistant configuration folder, in the same path where configuration.yaml is located
+
+### Debug
+To enable advanced log please expand the logger module configuration with the following lines:
+```yaml
+logger:
+ logs:
+ custom_components.mercedesmeapi: debug
+```
## Shell Scripts
There are two shell script:
[releases-url]: https://github.com/xraver/mercedes_me_api/releases
[last-commit-img]: https://img.shields.io/github/last-commit/xraver/mercedes_me_api
[last-commit-url]: https://github.com/xraver/mercedes_me_api/commits/master
-[hacs-img]: https://img.shields.io/badge/HACS-Custom-orange.svg
+[hacs-img]: https://img.shields.io/badge/HACS-Default-orange.svg
[hacs-url]: https://github.com/custom-components/hacs
[buymecoffee-img]: https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg
[buymecoffee-button]: https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg
# Software Name & Version
NAME = "Mercedes Me API"
DOMAIN = "mercedesmeapi"
-VERSION = "0.9"
+VERSION = "0.10"
# Software Parameters
TOKEN_FILE = ".mercedesme_token"
CONFIG_FILE = ".mercedesme_config"
from homeassistant.const import (
CONF_SCAN_INTERVAL,
-# LENGTH_KILOMETERS,
-# LENGTH_MILES,
)
from .const import *
# Software Name & Version
NAME = "Mercedes Me API"
DOMAIN = "mercedesmeapi"
-VERSION = "0.9"
+VERSION = "0.10"
# Software Parameters
TOKEN_FILE = ".mercedesme_token"
RESOURCES_FILE = ".mercedesme_resources"
found = False
resources = None
- if (self.mercedesConfig.enable_resources_file == True):
+ if self.mercedesConfig.enable_resources_file == True:
if not os.path.isfile(self.resources_file):
# Resources File not present - Retrieving new one from server
_LOGGER.error("Resource File missing - Creating a new one.")
else:
found = True
except ValueError:
- _LOGGER.error("Error reading resource file - Creating a new one.")
+ _LOGGER.error(
+ "Error reading resource file - Creating a new one."
+ )
found = False
if not found:
# Write Resources File
########################
def WriteResourcesFile(self):
- if (self.mercedesConfig.enable_resources_file == True):
+ if self.mercedesConfig.enable_resources_file == True:
output = []
# Extract List
for res in self.database:
enable_resources_file: <**ENABLE (true) OR DISABLE (false) RESOURCES - OPTIONAL (DEFAULT DISABLED)**>
scan_interval: <** TIME PERIOD (NUMBER OF SECONDS) TO REFRESH RESOURCES - OPTIONAL**>
```
-2) Actually it's not possible to retrieve the token from scratch. Please use the other script to retrieve the first token and copy it into hacs folder (.mercedesme_token)
+2) Actually it's not possible to retrieve the token from scratch. Please use the other scripts to retrieve the first token and copy it (.mercedesme_token) into the homeassistant configuration folder, in the same path where configuration.yaml is located
+
+## Debug
+To enable advanced log please expand the logger module configuration with the following lines:
+```yaml
+logger:
+ logs:
+ custom_components.mercedesmeapi: debug
+```
## Change Log
You can find change log under [releases][releases-url]
[releases-url]: https://github.com/xraver/mercedes_me_api/releases
[last-commit-img]: https://img.shields.io/github/last-commit/xraver/mercedes_me_api
[last-commit-url]: https://github.com/xraver/mercedes_me_api/commits/master
-[hacs-img]: https://img.shields.io/badge/HACS-Custom-orange.svg
+[hacs-img]: https://img.shields.io/badge/HACS-Default-orange.svg
[hacs-url]: https://github.com/custom-components/hacs
[buymecoffee-img]: https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg
[buymecoffee-button]: https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg
# 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"
-URL_RES_PREFIX="https://api.mercedes-benz.com/vehicledata/v2"
+RES_URL_PREFIX="https://api.mercedes-benz.com/vehicledata/v2"
# Resources
RES_FUEL=(rangeliquid tanklevelpercent)
RES_LOCK=(doorlockstatusvehicle doorlockstatusdecklid doorlockstatusgas positionHeading)
fi
# Formatting RES_URL
-RES_URL="$URL_RES_PREFIX/vehicles/$VEHICLE_ID/resources"
+RES_URL="$RES_URL_PREFIX/vehicles/$VEHICLE_ID/resources"
function usage ()
{