from wakeonlan import wol ##---------------------------------------------------------------------------------------## class WOL(object): ##---------------------------------------------------------------------------------------## ##-----------------------------------------------------------------------------------## def __init__(self, devices): ##-----------------------------------------------------------------------------------## count = 0 self.devices= {} for device in devices: self.devices[device] = devices[device]['mac'] ##-----------------------------------------------------------------------------------## def config(self): ##-----------------------------------------------------------------------------------## config = { "device" : { "name" : "", "mac" : "" }, "wake" : { "device" : "name", "state" : "button" } } return config ##-----------------------------------------------------------------------------------## def wakeDevice(self, device): ##-----------------------------------------------------------------------------------## if(device in self.devices): wol.send_magic_packet(self.devices[device])