Commit 031d31ff authored by Aljaž Srebrnič's avatar Aljaž Srebrnič

Fix binary string comparison

parent 64adf516
......@@ -54,9 +54,9 @@ def main():
topic, messagedata = string.split()
print(topic, messagedata)
if messagedata == "liftoff":
if messagedata == b"liftoff":
light_flame()
elif messagedata == "stage_1_separation":
elif messagedata == b"stage_1_separation":
light_flame()
else:
print("Unhandled message")
......
......@@ -41,9 +41,9 @@ def main():
string = socket.recv()
topic, messagedata = string.split()
if messagedata == "stage_1_separation":
if messagedata == b"stage_1_separation":
separate_stage_one()
elif messagedata == "stage_2_separation":
elif messagedata == b"stage_2_separation":
separate_stage_two()
else:
print("Unhandled message")
......
......@@ -45,11 +45,11 @@ def main():
string = socket.recv()
topic, messagedata = string.split()
if messagedata == "pre_launch":
if messagedata == b"pre_launch":
pg.mixer.Channel(0).play(lancio)
elif messagedata == "stage_1_separation":
elif messagedata == b"stage_1_separation":
pg.mixer.Channel(1).play(stageOne)
elif messagedata == "stage_2_separation":
elif messagedata == b"stage_2_separation":
pg.mixer.Channel(2).play(stageTwo)
t.start()
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment