Beispiel #1
0
 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)
Beispiel #2
0
    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)
Beispiel #3
0
 def pulse(self):
   self.send(LedEvent.pulse())
Beispiel #4
0
 def pulse(self):
     self.send(LedEvent.pulse())