diff bin/collector @ 1543:c8cffe82b537

collector gui updates Ignore-this: d8ab8247884e674a2332684297920c6a
author Drew Perttula <drewp@bigasterisk.com>
date Fri, 19 May 2017 07:33:11 +0000
parents c1bf296b0a74
children f2e6d96d02de
line wrap: on
line diff
--- a/bin/collector	Wed May 17 08:02:58 2017 +0000
+++ b/bin/collector	Fri May 19 07:33:11 2017 +0000
@@ -51,9 +51,11 @@
 
     def addClient(self, client):
         self.clients.append([client, {}])
+        log.info('added client %s', client)
 
     def delClient(self, client):
         self.clients = [[c, t] for c, t in self.clients if c != client]
+        log.info('delClient %s, %s left', client, len(self.clients))
         
     def outputAttrsSet(self, dev, attrs, outputMap):
         now = time.time()
@@ -75,7 +77,7 @@
             output, index = outputMap[(dev, attr)]
             attrRows.append({'attr': attr.rsplit('/')[-1],
                              'val': val,
-                             'chan': (output.shortId(), index)})
+                             'chan': (output.shortId(), index + 1)})
         attrRows.sort(key=lambda r: r['chan'])
         for row in attrRows:
             row['chan'] = '%s %s' % (row['chan'][0], row['chan'][1])
@@ -86,6 +88,7 @@
 class Updates(cyclone.websocket.WebSocketHandler):
 
     def connectionMade(self, *args, **kwargs):
+        log.info('socket connect %s', self)
         self.settings.listeners.addClient(self)
 
     def connectionLost(self, reason):