forked from peter/volvo2mqtt
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e95e71661 | ||
|
|
126cc37269 | ||
|
|
cb10fe07c3 | ||
|
|
f3244ccdc0 |
@@ -1,3 +1,17 @@
|
|||||||
|
## v1.8.18
|
||||||
|
### 🐛 Bug Fixes:
|
||||||
|
|
||||||
|
- Fix Backend State Sensor returning `null`
|
||||||
|
|
||||||
|
## v1.8.17
|
||||||
|
### 🚀 Features:
|
||||||
|
|
||||||
|
- Move vehicle and vehicle details to v2 endpoint
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes:
|
||||||
|
|
||||||
|
- Fix Battery Charge Level icon update
|
||||||
|
|
||||||
## v1.8.16
|
## v1.8.16
|
||||||
### 🚀 Features:
|
### 🚀 Features:
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
name: "Volvo2Mqtt"
|
name: "Volvo2Mqtt"
|
||||||
description: "Volvo AAOS MQTT bridge"
|
description: "Volvo AAOS MQTT bridge"
|
||||||
version: "1.8.16"
|
version: "1.8.18"
|
||||||
slug: "volvo2mqtt"
|
slug: "volvo2mqtt"
|
||||||
init: false
|
init: false
|
||||||
url: "https://github.com/Dielee/volvo2mqtt"
|
url: "https://github.com/Dielee/volvo2mqtt"
|
||||||
|
|||||||
+3
-3
@@ -1,10 +1,10 @@
|
|||||||
from config import settings
|
from config import settings
|
||||||
|
|
||||||
VERSION = "v1.8.16"
|
VERSION = "v1.8.18"
|
||||||
|
|
||||||
OAUTH_URL = "https://volvoid.eu.volvocars.com/as/token.oauth2"
|
OAUTH_URL = "https://volvoid.eu.volvocars.com/as/token.oauth2"
|
||||||
VEHICLES_URL = "https://api.volvocars.com/connected-vehicle/v1/vehicles"
|
VEHICLES_URL = "https://api.volvocars.com/connected-vehicle/v2/vehicles"
|
||||||
VEHICLE_DETAILS_URL = "https://api.volvocars.com/connected-vehicle/v1/vehicles/{0}"
|
VEHICLE_DETAILS_URL = "https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}"
|
||||||
WINDOWS_STATE_URL = "https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}/windows"
|
WINDOWS_STATE_URL = "https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}/windows"
|
||||||
CLIMATE_START_URL = "https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}/commands/climatization-start"
|
CLIMATE_START_URL = "https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}/commands/climatization-start"
|
||||||
CLIMATE_STOP_URL = "https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}/commands/climatization-stop"
|
CLIMATE_STOP_URL = "https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}/commands/climatization-stop"
|
||||||
|
|||||||
+6
-2
@@ -70,14 +70,14 @@ def send_car_images(vin, data, device):
|
|||||||
if entity["id"] == "exterior_image":
|
if entity["id"] == "exterior_image":
|
||||||
mqtt_client.publish(
|
mqtt_client.publish(
|
||||||
url_topic,
|
url_topic,
|
||||||
data["images"]["exteriorDefaultUrl"],
|
data["images"]["exteriorImageUrl"],
|
||||||
retain=True
|
retain=True
|
||||||
)
|
)
|
||||||
|
|
||||||
if entity["id"] == "interior_image":
|
if entity["id"] == "interior_image":
|
||||||
mqtt_client.publish(
|
mqtt_client.publish(
|
||||||
url_topic,
|
url_topic,
|
||||||
data["images"]["interiorDefaultUrl"],
|
data["images"]["internalImageUrl"],
|
||||||
retain=True
|
retain=True
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -270,8 +270,12 @@ def update_car_data(force_update=False, overwrite={}):
|
|||||||
def update_ha_device(entity, vin, state):
|
def update_ha_device(entity, vin, state):
|
||||||
icon_config = icon_states.get(entity["id"])
|
icon_config = icon_states.get(entity["id"])
|
||||||
if icon_config and state:
|
if icon_config and state:
|
||||||
|
logging.debug("Entity " + entity["id"] + " state " + str(state))
|
||||||
if isinstance(state, float):
|
if isinstance(state, float):
|
||||||
icon = util.get_icon_between(icon_config, state)
|
icon = util.get_icon_between(icon_config, state)
|
||||||
|
elif state.replace(".", "").isnumeric():
|
||||||
|
state = float(state)
|
||||||
|
icon = util.get_icon_between(icon_config, state)
|
||||||
else:
|
else:
|
||||||
icon = icon_config[state]
|
icon = icon_config[state]
|
||||||
else:
|
else:
|
||||||
|
|||||||
+9
-2
@@ -328,9 +328,16 @@ def get_backend_status():
|
|||||||
response = session.get(API_BACKEND_STATUS, timeout=15)
|
response = session.get(API_BACKEND_STATUS, timeout=15)
|
||||||
try:
|
try:
|
||||||
data = response.json()
|
data = response.json()
|
||||||
backend_status = data["message"] if util.keys_exists(data, "message") else "No warnings"
|
if util.keys_exists(data, "message"):
|
||||||
|
if data["message"]:
|
||||||
|
backend_status = data["message"]
|
||||||
|
else:
|
||||||
|
backend_status = "NO_WARNING"
|
||||||
|
else:
|
||||||
|
backend_status = "NO_WARNING"
|
||||||
|
|
||||||
except JSONDecodeError as e:
|
except JSONDecodeError as e:
|
||||||
backend_status = "No warnings"
|
backend_status = "NO_WARNING"
|
||||||
return backend_status
|
return backend_status
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user