February 2022
Intermediate to advanced
182 pages
4h 25m
English
We’re ready for the moment of truth. Combine the wakeup.py script with the pbreceiver.py script along with a line to clear out all the Pushbullet messages received once the wakeonlan command has been executed. Create a new Python script called voicewol.py and include the following code in it:
| | import os |
| | from pushbullet import Listener |
| | from pushbullet import Pushbullet |
| | |
| | ACCESS_CODE = 'PUSHBULLET_ACCESS_CODE_GOES_HERE' |
| | HTTP_PROXY_HOST = None |
| | HTTP_PROXY_PORT = None |
| | MAC = 'YOUR_COMPUTER_MAC_ADDRESS_GOES_HERE' |
| | |
| | def on_push(data): |
| | pbullet = Pushbullet(API_KEY) |
| | pushes = pbullet.get_pushes() |
| | try: |
| | latest = pushes[0] |
| | if latest['body'] == "WAKE_PC": |
| | print("Turning on your ... |
Read now
Unlock full access