]> git.giorgioravera.it Git - mercedes_me_api.git/commitdiff
Minor fixes and updated file version
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Mon, 19 Dec 2022 22:26:54 +0000 (23:26 +0100)
committerGitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
Mon, 19 Dec 2022 22:29:22 +0000 (22:29 +0000)
README.md
const.py
custom_components/mercedesmeapi/manifest.json
mercedes_me_api.sh

index f74c281cfe83f22234af92eefc85b25d18caa38c..48bd826571e5ea0d7ed37f5622a0a1f4bc7f67c6 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# mercedes_me_api 
+# mercedes_me_api
 [![Releases][releases-img]][releases-url]
 [![Last Commit][last-commit-img]][last-commit-url]
 [![hacs][hacs-img]][hacs-url]
@@ -13,11 +13,11 @@ This repository contains a collection of scripts (including the Home Assistant C
 3) Register to the following APIs (all of them):
    - [Electric Vehicle Status](https://developer.mercedes-benz.com/products/electric_vehicle_status)
    - [Fuel Status](https://developer.mercedes-benz.com/products/fuel_status)
-   - [Pay As You Drive Insurance](https://developer.mercedes-benz.com/products/pay_as_you_drive_insurance) 
+   - [Pay As You Drive Insurance](https://developer.mercedes-benz.com/products/pay_as_you_drive_insurance)
    - [Vehicle Lock Status](https://developer.mercedes-benz.com/products/vehicle_lock_status)
    - [Vehicle Status](https://developer.mercedes-benz.com/products/vehicle_status)
 
-Notes: 
+Notes:
 1) the APIs described above do not require any subscription in case you use them with your own car associated with the Mercedes me Account.
 2) not all sensors may be available in your own car; if a sensor is not available the data request returns no data.
 3) only one car is supported for the moment.
@@ -49,7 +49,7 @@ 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 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 
+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:
index 4134f2000d5b0c3029fb0570e2dbc1e3196bf945..250ccb0e32dad6be2c0abd6ee552a6a74c1c3508 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.11"
+VERSION = "0.12"
 # Software Parameters
 TOKEN_FILE = ".mercedesme_token"
 CONFIG_FILE = ".mercedesme_config"
index 46f97e21c66fdd8ba54f956fe07bed0322e94614..9b5edcf99e00a5aab59dd36817e9a57b8f1ccaa6 100644 (file)
@@ -3,7 +3,10 @@
     "name": "Mercedes Me API",
     "documentation": "https://github.com/xraver/mercedes_me_api/blob/master/README.md",
     "issue_tracker": "https://github.com/xraver/mercedes_me_api/issues",
+    "requirements": [],
+    "dependencies": [],
     "config_flow": false,
-    "version": "0.11",
-    "codeowners": [ "@xraver" ]
+    "version": "0.12",
+    "codeowners": [ "@xraver" ],
+    "iot_class": "cloud_push"
 }
index c41d8a209f98181453a0abf5a3f22b73e381ca79..a98ff7a67013286d63c6c64340d58469d52a8d5f 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 # Author: G. Ravera
-# Version 0.5
+# Version 0.7
 # Creation Date: 28/09/2020
 #
 # Change log:
@@ -11,6 +11,7 @@
 #             18/12/2020 - 0.4 - Added macOS support (robert@klep.name)
 #             19/12/2020 - 0.5 - Added Electric Vehicle Status support
 #             23/12/2020 - 0.6 - Added PayAsYouDrive support (danielrheinbay@gmail.com)
+#             19/12/2022 - 0.7 - Updated URLs (samfaitmalomolet)
 
 # Script Name & Version
 NAME="mercedes_me_api.sh"
@@ -95,7 +96,7 @@ function parse_options ()
                                shift
                                ;;
                        -r | --refresh )
-                               refreshAuthCode 
+                               refreshAuthCode
                                shift
                                ;;
                        -f | --fuel )
@@ -133,15 +134,15 @@ function generateBase64 ()
   BASE64=$(echo $BASE64 | sed $SED_FLAG 's/ //')
 }
 
-function getAuthCode () 
+function getAuthCode ()
 {
   generateBase64
-  
+
   echo "Open the browser and insert this link:"
-  echo 
+  echo
   echo "https://ssoalpha.dvb.corpinter.net/v1/auth?response_type=code&client_id=$CLIENT_ID&redirect_uri=$REDIRECT_URL&scope=$SCOPE"
   #echo "https://ssoalpha.dvb.corpinter.net/v1/auth?response_type=code&client_id=$CLIENT_ID&redirect_uri=$REDIRECT_URL&scope=$SCOPE&state=$STATE"
-  echo 
+  echo
   echo "Copy the code in the url:"
 
   read AUTH_CODE
@@ -161,7 +162,7 @@ function refreshAuthCode ()
   extractRefreshToken
 
   TOKEN=$(curl --request POST \
-               --url https://id.mercedes-benz.com/as/token.oauth2 \
+               --url https://ssoalpha.dvb.corpinter.net/v1/token \
                --header "Authorization: Basic $BASE64" \
                --header "content-type: application/x-www-form-urlencoded" \
                --data "grant_type=refresh_token&refresh_token=$REFRESH_CODE")