From 87defed2822b85f6ab34c513469ffcc1ba4f4910 Mon Sep 17 00:00:00 2001 From: Yannik25 Date: Thu, 15 Apr 2021 21:05:34 +0200 Subject: [PATCH 1/6] Add new sensor values Add Fuel infos from user / measure, total fuel, car status, parking location and license Plate --- pyryd/pyryd.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pyryd/pyryd.py b/pyryd/pyryd.py index d106e63..83d9cf9 100644 --- a/pyryd/pyryd.py +++ b/pyryd/pyryd.py @@ -21,7 +21,14 @@ def ryd_time(s: str): "overall_distance": (lambda x: int(x["carOdometer"]["distanceM"])/1000, "km"), "fuel_level": (lambda x: float(x["fuel"]["level"]["OBD_FUELLEVEL"]["l"]), "l"), "fuel_percent": (lambda x: float(x["fuel"]["level"]["OBD_FUELLEVEL"]["percent"]), "%"), - + "fuel_level_user": (lambda x: float(x["fuel"]["level"]["USER"]["l"]), "l"), + "fuel_percent_user": (lambda x: float(x["fuel"]["level"]["USER"]["percent"]), "%"), + "fuel_level_measure": (lambda x: float(x["fuel"]["level"]["MEAS"]["l"]), "l"), + "fuel_percent_measure": (lambda x: float(x["fuel"]["level"]["MEAS"]["percent"]), "%"), + "fuel_total": (lambda x: float(x["fuel"]["reportedFuelTotal"]["fuelL"]), "l"), + "car_status": (lambda x: str(x["state"]), None), + "parking_Location": (lambda x: str(x["parkingLocation"]["addressString"]), None), + "license_Plate": (lambda x: str(x["licensePlate"]), None), } class Ryd(object): From eb66bc7a557403c3bcd1132a733547bf16441d52 Mon Sep 17 00:00:00 2001 From: Yannik25 Date: Thu, 15 Apr 2021 21:10:26 +0200 Subject: [PATCH 2/6] add current location Tried to read the values from: ``` "curLocation":{ "timestamp":"2021-01-07T09:39:25.000Z", "loc":[ 10.000000, 20.000000 ] }, ``` But all three entries aren't returning anything --- pyryd/pyryd.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyryd/pyryd.py b/pyryd/pyryd.py index 83d9cf9..2764050 100644 --- a/pyryd/pyryd.py +++ b/pyryd/pyryd.py @@ -28,6 +28,9 @@ def ryd_time(s: str): "fuel_total": (lambda x: float(x["fuel"]["reportedFuelTotal"]["fuelL"]), "l"), "car_status": (lambda x: str(x["state"]), None), "parking_Location": (lambda x: str(x["parkingLocation"]["addressString"]), None), + "current_Location": (lambda x: float(x["curLocation"]["loc"]), None), + "current_Latitude": (lambda x: float(x["curLocation"]["loc":[0]]), None), + "current_Longitude": (lambda x: float(x["curLocation"]["loc":[1]]), None), "license_Plate": (lambda x: str(x["licensePlate"]), None), } From 9cbd8d09b0403102b7ca071f19dfe360767370bd Mon Sep 17 00:00:00 2001 From: Yannik25 Date: Fri, 16 Apr 2021 10:47:22 +0200 Subject: [PATCH 3/6] update location Ok now with list, current Location is returned: 'current_Location': {'value': [10.00000, 10.00000], 'unit': None}, this however is not working with separate values for current_Latitude and current_Longitude --- pyryd/pyryd.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyryd/pyryd.py b/pyryd/pyryd.py index 2764050..4409ce1 100644 --- a/pyryd/pyryd.py +++ b/pyryd/pyryd.py @@ -28,9 +28,9 @@ def ryd_time(s: str): "fuel_total": (lambda x: float(x["fuel"]["reportedFuelTotal"]["fuelL"]), "l"), "car_status": (lambda x: str(x["state"]), None), "parking_Location": (lambda x: str(x["parkingLocation"]["addressString"]), None), - "current_Location": (lambda x: float(x["curLocation"]["loc"]), None), - "current_Latitude": (lambda x: float(x["curLocation"]["loc":[0]]), None), - "current_Longitude": (lambda x: float(x["curLocation"]["loc":[1]]), None), + "current_Location": (lambda x: list(x["curLocation"]["loc"]), None), + "current_Latitude": (lambda x: list(x["curLocation"]["loc":[0]]), None), + "current_Longitude": (lambda x: list(x["curLocation"]["loc":[1]]), None), "license_Plate": (lambda x: str(x["licensePlate"]), None), } From bb957d86875253893aece7fede0bcce96af3bd8c Mon Sep 17 00:00:00 2001 From: Yannik25 Date: Fri, 16 Apr 2021 10:56:03 +0200 Subject: [PATCH 4/6] update location changes separate values again to float and the element select value after the square bracket. Should now work. --- pyryd/pyryd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyryd/pyryd.py b/pyryd/pyryd.py index 4409ce1..58f3c5d 100644 --- a/pyryd/pyryd.py +++ b/pyryd/pyryd.py @@ -29,8 +29,8 @@ def ryd_time(s: str): "car_status": (lambda x: str(x["state"]), None), "parking_Location": (lambda x: str(x["parkingLocation"]["addressString"]), None), "current_Location": (lambda x: list(x["curLocation"]["loc"]), None), - "current_Latitude": (lambda x: list(x["curLocation"]["loc":[0]]), None), - "current_Longitude": (lambda x: list(x["curLocation"]["loc":[1]]), None), + "current_Latitude": (lambda x: float(x["curLocation"]["loc"][0]), None), + "current_Longitude": (lambda x: float(x["curLocation"]["loc"][1]), None), "license_Plate": (lambda x: str(x["licensePlate"]), None), } From 53a5972fa50c92d405a07b921c73be1fd6599925 Mon Sep 17 00:00:00 2001 From: Yannik25 Date: Fri, 16 Apr 2021 10:59:38 +0200 Subject: [PATCH 5/6] update location swap Latitude and Longitude --- pyryd/pyryd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyryd/pyryd.py b/pyryd/pyryd.py index 58f3c5d..3046157 100644 --- a/pyryd/pyryd.py +++ b/pyryd/pyryd.py @@ -29,8 +29,8 @@ def ryd_time(s: str): "car_status": (lambda x: str(x["state"]), None), "parking_Location": (lambda x: str(x["parkingLocation"]["addressString"]), None), "current_Location": (lambda x: list(x["curLocation"]["loc"]), None), - "current_Latitude": (lambda x: float(x["curLocation"]["loc"][0]), None), - "current_Longitude": (lambda x: float(x["curLocation"]["loc"][1]), None), + "current_Latitude": (lambda x: float(x["curLocation"]["loc"][1]), None), + "current_Longitude": (lambda x: float(x["curLocation"]["loc"][0]), None), "license_Plate": (lambda x: str(x["licensePlate"]), None), } From 7e25e9f3b3aa32ed537d3fd02069b2a98b42bad7 Mon Sep 17 00:00:00 2001 From: Yannik25 Date: Fri, 16 Apr 2021 11:00:58 +0200 Subject: [PATCH 6/6] Update __init__.py update version number --- pyryd/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyryd/__init__.py b/pyryd/__init__.py index de4f628..6616f5f 100644 --- a/pyryd/__init__.py +++ b/pyryd/__init__.py @@ -8,7 +8,7 @@ except ImportError as e: warnings.warn(ImportWarning(e)) -VERSION = (0, 1, 3) +VERSION = (0, 1, 4) __version__ = '.'.join([str(i) for i in VERSION]) __author__ = 'Yannik25'