USB wake from sleep udev

udev rules that allow wake from sleep from a USB device

If you have a USB device and you want it to wake your device from sleep, then:

sudo lsusb

You should then get a list like this:
Bus 007 Device 002: ID 4037:2804 2.4G Composite

4037 is the vendor
2804 is the product

Now create or edit this file:
sudo vim /etc/udev/rules.d/10-wakeup.rules

Insert this line and replace the 4037 and 2804 with your values:
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="4037", ATTRS{idProduct}=="2804", ATTR{power/wakeup}="enabled"

All credit to:
https://gist.github.com/bendavis78/57e925e4f451502271427e75acdba394