homecontrol: return properly formatted json
This commit is contained in:
parent
bf941ae701
commit
c82216b5f9
1 changed files with 3 additions and 3 deletions
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue