- Follow LG instructions to install the webos cli tools: instructions
- Configure your TV for dev mode: instructions
- Run this command:
ares-novacom --device TVName --run "cat /var/luna/preferences/devmode_enabled" - Copy the output, which is a
token
- Create a new cloudflare worker
- Paste this code in the worker:
async function fetchLGapi(api_key){
let res = await fetch(`https://developer.lge.com/secure/ResetDevModeSession.dev?sessionToken=${api_key}`);
return res;
}
export default {
async scheduled(event, env, ctx) {
return ctx.waitUntil(fetchLGapi(env.LG_API_KEY));
}
};- In the worker settings,
variables and secretssection, Add a new one with:- Name
LG_API_KEY - type
secret - content
the_token_you_copied_from_above
- Name
- In the worker settins,
Trigger eventssection, Add a new oneCron Trigger- I configured one to run every day at midnight