Add printer to mqtt
This commit is contained in:
@@ -17,6 +17,7 @@ def on_connect(client, userdata, flags, rc):
|
||||
|
||||
# The callback for when a PUBLISH message is received from the server.
|
||||
def on_message(client, userdata, msg):
|
||||
print("Print")
|
||||
with open("printer/locations.txt") as locations:
|
||||
lines = locations.read().splitlines()
|
||||
location = random.choice(lines)
|
||||
|
Reference in New Issue
Block a user