let currentDevice = ''; let currentBrand = ''; let currentCodes = [];
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(''); } codigo para configurar control claro
If you meant something else (like Claro Wi-Fi, Claro modem, or Claro home automation), let me know and I'll adapt it. Goal Allow users to configure a Claro remote control to work with their TV, decoder, and audio devices (volume, input, power). Code Example (JavaScript/HTML for a configuration wizard) <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Claro Remote Configurator</title> <style> body { font-family: Arial, sans-serif; max-width: 600px; margin: 2rem auto; padding: 1rem; } .step { display: none; } .step.active { display: block; } button, .code-btn { margin: 0.5rem 0; padding: 0.5rem 1rem; cursor: pointer; } .code-list { background: #f4f4f4; padding: 1rem; border-radius: 8px; } .brand { font-weight: bold; margin-top: 1rem; } </style> </head> <body> <h1>🔧 Claro Remote Control Setup</h1> <div id="step1" class="step active"> <h3>Step 1: What do you want to configure?</h3> <button onclick="selectDevice('tv')">TV Control</button> <button onclick="selectDevice('audio')">Audio/Receiver</button> <button onclick="selectDevice('claro')">Claro Decoder Only</button> </div> <div id="step2" class="step"> <h3 id="deviceTitle"></h3> <p>Select your brand:</p> <select id="brandSelect"></select> <button onclick="showCodes()">Get Configuration Code</button> <div id="codeResult" class="code-list"></div> <button onclick="prevStep()">Back</button> </div>
<script> // Database of codes (example for Claro/Latin American brands) const codeDB = { tv: { "Samsung": ["0101", "0120", "0178"], "LG": ["0019", "0035", "0056"], "Sony": ["0000", "0033", "0081"], "Panasonic": ["0051", "0060", "0108"], "TCL": ["1009", "1078"], "Philips": ["0065", "0089"] }, audio: { "Samsung": ["2101", "2120"], "Sony": ["3010", "3033"], "LG": ["2056", "2090"], "Yamaha": ["3124", "3180"], "Bose": ["3200", "3211"] }, claro: { "Claro Decoder (SD)": ["0001", "0010"], "Claro HD/HC": ["1020", "1045"], "Claro 4K": ["2050", "2077"] } }; let currentDevice = ''; let currentBrand = '';
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; }
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>`; } let currentDevice = ''
