.
.

Codigo Para Configurar — Control Claro

let currentDevice = ''; let currentBrand = ''; let currentCodes = [];

function selectCode(code) { document.getElementById('step2').classList.remove('active'); document.getElementById('step3').classList.add('active'); let deviceName = ''; if (currentDevice === 'tv') deviceName = 'TV'; else if (currentDevice === 'audio') deviceName = 'Audio System'; else deviceName = 'Claro Decoder'; document.getElementById('targetDevice').innerText = deviceName; document.getElementById('finalCode').innerText = code; } codigo para configurar control claro

function selectDevice(device) { currentDevice = device; document.getElementById('step1').classList.remove('active'); document.getElementById('step2').classList.add('active'); let title = ''; let brandOptions = ''; if (device === 'tv') { title = 'Configure TV Control'; brandOptions = Object.keys(codeDB.tv); } else if (device === 'audio') { title = 'Configure Audio/Receiver Control'; brandOptions = Object.keys(codeDB.audio); } else { title = 'Configure Claro Decoder Control'; brandOptions = Object.keys(codeDB.claro); } document.getElementById('deviceTitle').innerText = title; const select = document.getElementById('brandSelect'); select.innerHTML = '<option value="">-- Select brand --</option>' + brandOptions.map(b => `<option value="${b}">${b}</option>`).join(''); } let currentDevice = ''; let currentBrand = '';

<div id="step3" class="step"> <h3>How to program your Claro remote</h3> <ol> <li>Turn on your <span id="targetDevice"></span> manually.</li> <li>Press and hold the corresponding mode button on your Claro remote (TV, AUDIO, etc.) until the LED blinks twice.</li> <li>Enter the <strong>4-digit code</strong> shown below.</li> <li>Test volume/power. If it works, press OK/ENTER to save.</li> </ol> <div id="finalCode" style="font-size: 1.5rem; background: #000; color: #0f0; padding: 0.5rem; text-align: center;"></div> <button onclick="prevStep()">Back</button> <button onclick="restart()">Restart</button> </div> let currentDevice = ''

function showCodes() { const brand = document.getElementById('brandSelect').value; if (!brand) { alert('Please select a brand'); return; } currentBrand = brand; let codes = []; if (currentDevice === 'tv') codes = codeDB.tv[brand]; else if (currentDevice === 'audio') codes = codeDB.audio[brand]; else codes = codeDB.claro[brand]; currentCodes = codes; const resultDiv = document.getElementById('codeResult'); resultDiv.innerHTML = `<div class="brand">${brand} codes:</div>` + codes.map(code => `<button class="code-btn" onclick="selectCode('${code}')">${code}</button>`).join('') + `<p>Try each code until your device responds to the remote.</p>`; }