.
This commit is contained in:
19
app/devices/wol.py
Normal file
19
app/devices/wol.py
Normal file
@ -0,0 +1,19 @@
|
||||
from wakeonlan import wol
|
||||
|
||||
##---------------------------------------------------------------------------------------##
|
||||
class WOL(object):
|
||||
##---------------------------------------------------------------------------------------##
|
||||
##-----------------------------------------------------------------------------------##
|
||||
def __init__(self, devices):
|
||||
##-----------------------------------------------------------------------------------##
|
||||
count = 0
|
||||
for device in devices:
|
||||
self.devices[device] = devices[device]['mac']
|
||||
|
||||
##-----------------------------------------------------------------------------------##
|
||||
def wakeDevice(self, device):
|
||||
##-----------------------------------------------------------------------------------##
|
||||
if(device in self.devices):
|
||||
wol.send_magic_packet(self.devices[device])
|
||||
|
||||
|
Reference in New Issue
Block a user