Fix retained otp messages bug

This commit is contained in:
Linus Dietz
2024-05-29 20:08:19 +02:00
parent a7a2e1182c
commit f650ea9247
4 changed files with 13 additions and 5 deletions
+5
View File
@@ -1,3 +1,8 @@
## v1.9.3
### 🐛 Bug Fixes:
- Ignore retained OTP messages #193
## v1.9.2
### 🐛 Bug Fixes:
+1 -1
View File
@@ -1,6 +1,6 @@
name: "Volvo2Mqtt"
description: "Volvo AAOS MQTT bridge"
version: "1.9.2"
version: "1.9.3"
slug: "volvo2mqtt"
init: false
url: "https://github.com/Dielee/volvo2mqtt"
+1 -1
View File
@@ -1,6 +1,6 @@
from config import settings
VERSION = "v1.9.2"
VERSION = "v1.9.3"
OAUTH_TOKEN_URL = "https://volvoid.eu.volvocars.com/as/token.oauth2"
OAUTH_AUTH_URL = "https://volvoid.eu.volvocars.com/as/authorization.oauth2"
+6 -3
View File
@@ -131,9 +131,12 @@ def on_disconnect(client, userdata, rc):
def on_message(client, userdata, msg):
payload = msg.payload.decode("UTF-8")
if msg.topic == otp_mqtt_topic:
global otp_code
otp_code = payload
set_otp_state()
if msg.retain == 0:
global otp_code
otp_code = payload
set_otp_state()
else:
logging.warning("Found retained OTP, this can't work! Pleas clean retained messages!")
return None
else:
try: