mirror of
https://github.com/Dielee/volvo2mqtt.git
synced 2026-08-13 11:19:52 +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:
|
if msg.topic == otp_mqtt_topic:
|
||||||
global otp_code
|
global otp_code
|
||||||
otp_code = payload
|
otp_code = payload
|
||||||
|
set_otp_state()
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -156,7 +156,6 @@ def send_otp(auth_session, data):
|
|||||||
if not mqtt.otp_code:
|
if not mqtt.otp_code:
|
||||||
raise Exception ("No OTP found, exting...")
|
raise Exception ("No OTP found, exting...")
|
||||||
|
|
||||||
mqtt.set_otp_state()
|
|
||||||
auth = auth_session.post(next_url, data=json.dumps(body))
|
auth = auth_session.post(next_url, data=json.dumps(body))
|
||||||
if auth.status_code == 200:
|
if auth.status_code == 200:
|
||||||
return auth.json()
|
return auth.json()
|
||||||
|
|||||||
Reference in New Issue
Block a user