Do you sometimes forget to turn on the sleep timer on your (webOS-based) TV before you fall asleep? This script is for you. It runs in the background (e.g. on a Raspberry Pi) and if it sees the TV running it will turn it off (you can set a delay).
This script uses PyWebOSTV to do what it does.