Esempio n. 1
0
 def listDevices(self):
     r = ""
     devices = pywink.get_all_devices()
     for d in devices:
         r += '{color}{name} ({type}) - {state}\n```'.format(
             color=("```css\n" if d.state() else "```brainfuck\n"),
             name=d.name(),
             type=d.object_type(),
             state=("ON" if d.state() else "OFF"))
     return r
Esempio n. 2
0
 def getDeviceNames(self):
     devices = pywink.get_all_devices()
     names = []
     for d in devices:
         names.append(d.name())
     return names
Esempio n. 3
0
 def getDevice(self, name):
     devices = pywink.get_all_devices()
     for d in devices:
         if d.name().lower() == name.lower():
             return d, d.object_type()
     return None, None