Esempio n. 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)
Esempio n. 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)
Esempio n. 3
0
 def pulse(self):
   self.send(LedEvent.pulse())
Esempio n. 4
0
 def pulse(self):
     self.send(LedEvent.pulse())