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
def _getPinInfo(self, pin): return {"type": "output" if pin.output else "input", "name": pin.name, "value": gpio.getPinValue(pin)}