Mercurial > code > home > repos > homeauto
comparison lib/patchablegraph.py @ 429:fcd2c026f51e
exportStats for sending scales data to influxdb
Ignore-this: 715ff40fed97559efa37edf0efa58220
author | drewp@bigasterisk.com |
---|---|
date | Sun, 07 Apr 2019 03:56:17 -0700 |
parents | a380561fd8a8 |
children | 388769b5f8ff |
comparison
equal
deleted
inserted
replaced
428:d6a6076fce6e | 429:fcd2c026f51e |
---|---|
136 self.masterGraph = masterGraph | 136 self.masterGraph = masterGraph |
137 | 137 |
138 def bind(self): | 138 def bind(self): |
139 graphJson = self.masterGraph.asJsonLd() | 139 graphJson = self.masterGraph.asJsonLd() |
140 log.debug("send fullGraph event: %s", graphJson) | 140 log.debug("send fullGraph event: %s", graphJson) |
141 self.sendEvent(message=graphJson, event='fullGraph') | 141 self.sendEvent(message=graphJson, event=b'fullGraph') |
142 self.masterGraph.addObserver(self.onPatch) | 142 self.masterGraph.addObserver(self.onPatch) |
143 | 143 |
144 def onPatch(self, patchJson): | 144 def onPatch(self, patchJson): |
145 # throttle and combine patches here- ideally we could see how | 145 # throttle and combine patches here- ideally we could see how |
146 # long the latency to the client is to make a better rate choice | 146 # long the latency to the client is to make a better rate choice |
147 self.sendEvent(message=patchJson, event='patch') | 147 self.sendEvent(message=patchJson, event=b'patch') |
148 | 148 |
149 def unbind(self): | 149 def unbind(self): |
150 self.masterGraph.removeObserver(self.onPatch) | 150 self.masterGraph.removeObserver(self.onPatch) |
151 | 151 |