Add printer to mqtt

This commit is contained in:
jimmy 2022-07-23 01:58:57 +12:00
parent 1dd5117e1f
commit 3d14ba3dd6
1 changed files with 1 additions and 0 deletions

View File

@ -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)