Compare commits

...

2 Commits

Author SHA1 Message Date
Dominic Zimmer
b90858b5cb Merge branch 'master' of leafbla.de:dominic/webpnp 2020-04-17 02:19:30 +02:00
Dominic Zimmer
f05503b871 Add allsessions 2020-04-17 02:19:28 +02:00

View File

@ -72,10 +72,11 @@ class Model(object):
async def send_state(self, clientid): async def send_state(self, clientid):
# TODO: compute state, send to client # TODO: compute state, send to client
session = "deine mudda" session = "No session"
if "session" in self.model["clients"][clientid]: if "session" in self.model["clients"][clientid]:
session = self.model["clients"][clientid]["session"] session = self.model["clients"][clientid]["session"]
data = {"session": session} allsessions = [ name for name in self.model["sessions"] ]
data = {"currentsession": session, "allsessions": allsessions}
for socket in self.sockets[clientid]: for socket in self.sockets[clientid]:
await socket.send_json(data) await socket.send_json(data)