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

Fix binary string comparison

parent 64adf516
...@@ -54,9 +54,9 @@ def main(): ...@@ -54,9 +54,9 @@ def main():
topic, messagedata = string.split() topic, messagedata = string.split()
print(topic, messagedata) print(topic, messagedata)
if messagedata == "liftoff": if messagedata == b"liftoff":
light_flame() light_flame()
elif messagedata == "stage_1_separation": elif messagedata == b"stage_1_separation":
light_flame() light_flame()
else: else:
print("Unhandled message") print("Unhandled message")
......
...@@ -41,9 +41,9 @@ def main(): ...@@ -41,9 +41,9 @@ def main():
string = socket.recv() string = socket.recv()
topic, messagedata = string.split() topic, messagedata = string.split()
if messagedata == "stage_1_separation": if messagedata == b"stage_1_separation":
separate_stage_one() separate_stage_one()
elif messagedata == "stage_2_separation": elif messagedata == b"stage_2_separation":
separate_stage_two() separate_stage_two()
else: else:
print("Unhandled message") print("Unhandled message")
......
...@@ -45,11 +45,11 @@ def main(): ...@@ -45,11 +45,11 @@ def main():
string = socket.recv() string = socket.recv()
topic, messagedata = string.split() topic, messagedata = string.split()
if messagedata == "pre_launch": if messagedata == b"pre_launch":
pg.mixer.Channel(0).play(lancio) pg.mixer.Channel(0).play(lancio)
elif messagedata == "stage_1_separation": elif messagedata == b"stage_1_separation":
pg.mixer.Channel(1).play(stageOne) pg.mixer.Channel(1).play(stageOne)
elif messagedata == "stage_2_separation": elif messagedata == b"stage_2_separation":
pg.mixer.Channel(2).play(stageTwo) pg.mixer.Channel(2).play(stageTwo)
t.start() t.start()
else: 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