]> git.giorgioravera.it Git - mercedes_me_api.git/commitdiff
Reviewed Readme.md and info.md and increment version
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Tue, 5 Jan 2021 10:13:22 +0000 (11:13 +0100)
committerGitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
Tue, 5 Jan 2021 10:16:00 +0000 (10:16 +0000)
README.md
const.py
custom_components/mercedesmeapi/config.py
custom_components/mercedesmeapi/const.py
custom_components/mercedesmeapi/resources.py
info.md
mercedes_me_api.sh

index be823efb90628fa36673ec4180e0ab6eec7be523..dc823768f762fad5bdb4d665457eb361a9be46a1 100644 (file)
--- a/README.md
+++ b/README.md
@@ -48,7 +48,15 @@ mercedesmeapi:
   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:
@@ -120,7 +128,7 @@ 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
index 3ef10616b21aa1bf53ebc1d8b450220858974625..42a5ff7bcc13f4ef67f855ad45da2c54d81fbf62 100644 (file)
--- a/const.py
+++ b/const.py
@@ -9,7 +9,7 @@ https://github.com/xraver/mercedes_me_api/
 # 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"
index 312f7f2626cd329e55d29aa8c9252fe9b910c313..38f15702e80b244f38c4ab128e4e971976954467 100644 (file)
@@ -10,8 +10,6 @@ import logging
 
 from homeassistant.const import (
     CONF_SCAN_INTERVAL,
-#    LENGTH_KILOMETERS,
-#    LENGTH_MILES,
 )
 
 from .const import *
index 54a6bdc26cfa4b031ff3015472ee809ab50b4338..e489f02397951753980d6ce303381ad20f4d1ca3 100644 (file)
@@ -9,7 +9,7 @@ https://github.com/xraver/mercedes_me_api/
 # 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"
index e68467bf503a298a1598035135e725c73dd348f9..cf5f23a99ce9fcc0632d2c7bba8f2c7eb9c62cac 100644 (file)
@@ -111,7 +111,7 @@ class MercedesMeResources:
         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.")
@@ -125,7 +125,9 @@ class MercedesMeResources:
                         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:
@@ -210,7 +212,7 @@ class MercedesMeResources:
     # 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:
diff --git a/info.md b/info.md
index 4632a6a5aaa00d04bdb8ec3c934afd7c8ec25f3f..48ffd46f67cc66e21e60c805334132425396b133 100644 (file)
--- a/info.md
+++ b/info.md
@@ -48,7 +48,15 @@ mercedesmeapi:
   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]
@@ -68,7 +76,7 @@ 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
index 5d236a524503549b6f564927c5762e638ebeed57..18419d5adfc3da9b8564b9aa1d25fc2d37aab1ec 100755 (executable)
@@ -22,7 +22,7 @@ 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"
-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)
@@ -56,7 +56,7 @@ if [ -z $CLIENT_ID ] | [ -z $CLIENT_ID ] | [ -z $CLIENT_ID ]; then
 fi
 
 # Formatting RES_URL
-RES_URL="$URL_RES_PREFIX/vehicles/$VEHICLE_ID/resources"
+RES_URL="$RES_URL_PREFIX/vehicles/$VEHICLE_ID/resources"
 
 function usage ()
 {