示例#1
0
    def _getModifiedPinInfo(self):
        result = []
        for pin in self.pins:
            if pin.output:
                continue
            value = gpio.getPinValue(pin)
            if pin.value != value:
                pin.value = value
                result.append(self._getPinInfo(pin))

        return result
示例#2
0
 def _getPinInfo(self, pin):
     return {"type": "output" if pin.output else "input",
             "name": pin.name,
             "value": gpio.getPinValue(pin)}