Mercurial > code > home > repos > homeauto
comparison service/piNode/devices.py @ 625:69a84b3d1dfa
frontdoor configs; move device class timing to greplin stats
Ignore-this: f32495ae0d3b4c6f50fe1ba46c57abcd
author | drewp@bigasterisk.com |
---|---|
date | Thu, 08 Aug 2019 16:50:14 -0700 |
parents | 1249dcc657b8 |
children | 487cb5277ae3 |
comparison
equal
deleted
inserted
replaced
624:1249dcc657b8 | 625:69a84b3d1dfa |
---|---|
57 yield cls(graph, row.dev, pi, int(row.gpioNumber)) | 57 yield cls(graph, row.dev, pi, int(row.gpioNumber)) |
58 | 58 |
59 def __init__(self, graph, uri, pi, pinNumber): | 59 def __init__(self, graph, uri, pi, pinNumber): |
60 self.graph, self.uri, self.pi = graph, uri, pi | 60 self.graph, self.uri, self.pi = graph, uri, pi |
61 self.pinNumber = pinNumber | 61 self.pinNumber = pinNumber |
62 scales.init(self, self.__class__.__name__) | |
63 self.stats = scales.collection(self.__class__.__name__, | |
64 scales.PmfStat('poll'), | |
65 scales.PmfStat('output'), | |
66 ) | |
62 self.hostStateInit() | 67 self.hostStateInit() |
63 | 68 |
64 def hostStateInit(self): | 69 def hostStateInit(self): |
65 """ | 70 """ |
66 If you don't want to use __init__, you can use this to set up | 71 If you don't want to use __init__, you can use this to set up |
540 | 545 |
541 @pixelStats.updateOutput.time() | 546 @pixelStats.updateOutput.time() |
542 def updateOutput(self): | 547 def updateOutput(self): |
543 if 0: | 548 if 0: |
544 for _, _, sg in self.anim.groups.values(): | 549 for _, _, sg in self.anim.groups.values(): |
545 print sg.uri, sg.current | 550 print (sg.uri, sg.current) |
546 print list(self.anim.currentColors()) | 551 print (list(self.anim.currentColors())) |
547 return | 552 return |
548 | 553 |
549 with pixelStats.currentColors.time(): | 554 with pixelStats.currentColors.time(): |
550 colors = self.anim.currentColors() | 555 colors = self.anim.currentColors() |
551 | 556 |