Skip to content

Instantly share code, notes, and snippets.

@leocb
Created January 4, 2025 20:20
Show Gist options
  • Select an option

  • Save leocb/f8180729590f75e465fb32754f02f40a to your computer and use it in GitHub Desktop.

Select an option

Save leocb/f8180729590f75e465fb32754f02f40a to your computer and use it in GitHub Desktop.

Get the LG devmode token

  1. Follow LG instructions to install the webos cli tools: instructions
  2. Configure your TV for dev mode: instructions
  3. Run this command: ares-novacom --device TVName --run "cat /var/luna/preferences/devmode_enabled"
  4. Copy the output, which is a token

Setup cloudflare worker

  1. Create a new cloudflare worker
  2. 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));
  }
};
  1. In the worker settings, variables and secrets section, Add a new one with:
    • Name LG_API_KEY
    • type secret
    • content the_token_you_copied_from_above
  2. In the worker settins, Trigger events section, Add a new one Cron Trigger - I configured one to run every day at midnight
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment