Commit 60f42554 by ajil.k

added

parent 966f3a84
...@@ -12,11 +12,11 @@ mqtt_client.connect("192.168.0.220", 1883, 60) ...@@ -12,11 +12,11 @@ mqtt_client.connect("192.168.0.220", 1883, 60)
def on_message(client, userdata, message): def on_message(client, userdata, message):
patient_details = json.loads(message.payload.decode()) patient_details = json.loads(message.payload.decode())
patient_id = message.topic topic = message.topic
print("Connected to " + patient_id) print("Connected to " + topic)
print(f"{patient_id} - {patient_details}") print(f"{topic} - {patient_details}")
# Store the patient information in the Redis cache # Store the patient information in the Redis cache
redis_cache.set(patient_id, message.payload.decode()) redis_cache.set(topic, message.payload.decode())
print("Waiting for messages") print("Waiting for messages")
......
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