From c82216b5f9ddc57b01d338d07dd74364fe8a39ab Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 3 Nov 2019 16:39:08 +0100 Subject: [PATCH] homecontrol: return properly formatted json --- Client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Client.py b/Client.py index b8554f0..ca16086 100644 --- a/Client.py +++ b/Client.py @@ -12,7 +12,7 @@ class Client: self.ts = time.time() def get_info(self): - return "id: %s, type: %s, ts: %s" % (self.id_c, self.type_c, self.ts) + return {"id": self.id_c, "type": self.type_c, "ts": self.ts} class Sensor(Client): def __init__(self, id_s, type_s, num_values): @@ -42,8 +42,8 @@ class Actor(Client): def get_info(self): - return "id: %s, type: %s, ts: %s, levels: 0x%x, level: 0x%06x" % ( - self.id_a, self.type_a, self.ts, self.levels, self.level) + return {"id": self.id_a, "type": self.type_a, "ts": self.ts, + "levels": self.levels, "level": self.level} def add_queue(self, command, data): print("add_queue: {\"command\": %s, \"data\": %s}" % (command, data))