def short_press(self): print('Short press!') self._pulsing = not self._pulsing print(self._pulsing) if self._pulsing: return LedEvent.pulse() else: return LedEvent(brightness=self._brightness)
def short_press(self): print('Short press!') self._pulsing = not self._pulsing print(self._pulsing) client = connectMPD() if client.status()["state"] == "play": client.pause() print('Audio pause!') else: client.play() print('Audio play!') client.close() if self._pulsing: return LedEvent.pulse() else: return LedEvent(brightness=self._brightness)
def pulse(self): self.send(LedEvent.pulse())