mirror of
https://github.com/Dielee/volvo2mqtt.git
synced 2026-07-22 02:13:01 +02:00
Set otp state right after HA input
This commit is contained in:
@@ -133,6 +133,7 @@ def on_message(client, userdata, msg):
|
||||
if msg.topic == otp_mqtt_topic:
|
||||
global otp_code
|
||||
otp_code = payload
|
||||
set_otp_state()
|
||||
return None
|
||||
else:
|
||||
try:
|
||||
|
||||
@@ -156,7 +156,6 @@ def send_otp(auth_session, data):
|
||||
if not mqtt.otp_code:
|
||||
raise Exception ("No OTP found, exting...")
|
||||
|
||||
mqtt.set_otp_state()
|
||||
auth = auth_session.post(next_url, data=json.dumps(body))
|
||||
if auth.status_code == 200:
|
||||
return auth.json()
|
||||
|
||||
Reference in New Issue
Block a user