Funziona anche repeat
This commit is contained in:
@@ -21,8 +21,9 @@ client = None
|
|||||||
debounce = 0.25
|
debounce = 0.25
|
||||||
|
|
||||||
def on_message(client, userdata, msg):
|
def on_message(client, userdata, msg):
|
||||||
print(f"{msg.topic} -> {str(msg.payload)}")
|
global isRunning
|
||||||
if "STOP" in str(msg.payload):
|
print(f"{msg.topic} -> {str(msg.payload.decode('ascii'))}")
|
||||||
|
if "STOP" in msg.payload.decode('ascii'):
|
||||||
isRunning = False
|
isRunning = False
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -83,7 +84,6 @@ def main():
|
|||||||
btn_dx.when_held = send_DX
|
btn_dx.when_held = send_DX
|
||||||
btn_ok.when_held = send_OK
|
btn_ok.when_held = send_OK
|
||||||
btn_can.when_held = send_CAN
|
btn_can.when_held = send_CAN
|
||||||
|
|
||||||
while isRunning:
|
while isRunning:
|
||||||
client.loop(timeout=1)
|
client.loop(timeout=1)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user