changeset 2184:7a6739063595

shorten universe names
author drewp@bigasterisk.com
date Fri, 19 May 2023 18:18:58 -0700
parents 081f36506ad3
children bf07831a5339
files light9/collector/weblisteners.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/light9/collector/weblisteners.py	Fri May 19 17:28:03 2023 -0700
+++ b/light9/collector/weblisteners.py	Fri May 19 18:18:58 2023 -0700
@@ -10,6 +10,10 @@
 log = logging.getLogger('weblisteners')
 
 
+def shortenOutput(out: OutputUri) -> str:
+    return str(out).rstrip('/').rsplit('/', 1)[-1]
+
+
 class UiListener(Protocol):
 
     async def sendMessage(self, msg):
@@ -78,7 +82,7 @@
         for attr, val in attrs.items():
             outputUri, bufIndex = outputMap[(dev, attr)]
             dmxIndex = DmxIndex(bufIndex + 1)
-            attrRows.append({'attr': attr.rsplit('/')[-1], 'val': val, 'chan': (outputUri, dmxIndex)})
+            attrRows.append({'attr': attr.rsplit('/')[-1], 'val': val, 'chan': (shortenOutput(outputUri), dmxIndex)})
         attrRows.sort(key=lambda r: r['chan'])
         for row in attrRows:
             row['chan'] = '%s %s' % (row['chan'][0], row['chan'][1])