mirror of
https://github.com/Dielee/volvo2mqtt.git
synced 2026-08-13 19:29:52 +02:00
Fix retained otp messages bug
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
## v1.9.3
|
||||||
|
### 🐛 Bug Fixes:
|
||||||
|
|
||||||
|
- Ignore retained OTP messages #193
|
||||||
|
|
||||||
## v1.9.2
|
## v1.9.2
|
||||||
### 🐛 Bug Fixes:
|
### 🐛 Bug Fixes:
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
name: "Volvo2Mqtt"
|
name: "Volvo2Mqtt"
|
||||||
description: "Volvo AAOS MQTT bridge"
|
description: "Volvo AAOS MQTT bridge"
|
||||||
version: "1.9.2"
|
version: "1.9.3"
|
||||||
slug: "volvo2mqtt"
|
slug: "volvo2mqtt"
|
||||||
init: false
|
init: false
|
||||||
url: "https://github.com/Dielee/volvo2mqtt"
|
url: "https://github.com/Dielee/volvo2mqtt"
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
from config import settings
|
from config import settings
|
||||||
|
|
||||||
VERSION = "v1.9.2"
|
VERSION = "v1.9.3"
|
||||||
|
|
||||||
OAUTH_TOKEN_URL = "https://volvoid.eu.volvocars.com/as/token.oauth2"
|
OAUTH_TOKEN_URL = "https://volvoid.eu.volvocars.com/as/token.oauth2"
|
||||||
OAUTH_AUTH_URL = "https://volvoid.eu.volvocars.com/as/authorization.oauth2"
|
OAUTH_AUTH_URL = "https://volvoid.eu.volvocars.com/as/authorization.oauth2"
|
||||||
|
|||||||
@@ -131,9 +131,12 @@ def on_disconnect(client, userdata, rc):
|
|||||||
def on_message(client, userdata, msg):
|
def on_message(client, userdata, msg):
|
||||||
payload = msg.payload.decode("UTF-8")
|
payload = msg.payload.decode("UTF-8")
|
||||||
if msg.topic == otp_mqtt_topic:
|
if msg.topic == otp_mqtt_topic:
|
||||||
|
if msg.retain == 0:
|
||||||
global otp_code
|
global otp_code
|
||||||
otp_code = payload
|
otp_code = payload
|
||||||
set_otp_state()
|
set_otp_state()
|
||||||
|
else:
|
||||||
|
logging.warning("Found retained OTP, this can't work! Pleas clean retained messages!")
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user