diff --git a/data/upstream/iodeos.yml b/data/upstream/iodeos.yml index 2b97d34..73dbb36 100644 --- a/data/upstream/iodeos.yml +++ b/data/upstream/iodeos.yml @@ -1,6 +1,6 @@ # yaml-language-server: $schema=../../schema/upstream.json # Generated by npm run import. Edits get overwritten, fix it at the source link instead. -imported: 2026-10-17 +imported: 2026-10-19 devices: braxtech/brax3: status: active @@ -320,6 +320,7 @@ devices: features: volte: { status: broken, note: iodéOS lists VoLTE and VoWiFi as not working here } vowifi: { status: broken, note: iodéOS lists VoLTE and VoWiFi as not working here } + 5g: { status: broken, note: iodéOS lists 5G as not working here } samsung/crownlte: status: active android: 13 diff --git a/scripts/import/sources/iodeos.js b/scripts/import/sources/iodeos.js index b7f6f12..5c3529d 100644 --- a/scripts/import/sources/iodeos.js +++ b/scripts/import/sources/iodeos.js @@ -50,6 +50,13 @@ function callFeatures(answer, name) { return { volte: broken(), vowifi: broken() }; } +/** A no on a phone without 5G is missing hardware, so only one with 5G in its name gets broken */ +function fiveGFeatures(answer, name) { + if (answer === 'yes') return { '5g': 'working' }; + if (answer !== 'no' || !/\b5G\b/i.test(name)) return {}; + return { '5g': { status: 'broken', note: 'iodéOS lists 5G as not working here' } }; +} + /** One entry per device row in iodéOS's TablePress table, GSIs left out */ export function parseTable(html) { const table = html.match(//)[0]; @@ -69,7 +76,7 @@ export function parseTable(html) { const major = cell('version').match(/^\d+/)?.[0]; const features = { ...callFeatures(cell('calls').toLowerCase(), fullName), - ...(cell('fiveG').toLowerCase() === 'yes' && { '5g': 'working' }), + ...fiveGFeatures(cell('fiveG').toLowerCase(), fullName), }; return [ diff --git a/tests/import/iodeos.test.js b/tests/import/iodeos.test.js index 84b1064..a38a6e7 100644 --- a/tests/import/iodeos.test.js +++ b/tests/import/iodeos.test.js @@ -33,12 +33,17 @@ test('variants on separate lines become aliases and codenames are lowercased', ( assert.deepEqual(device.aliases, ['XT2233-1', 'XT2233-2']); }); -test('calls marked no are broken with a note, and 5G marked no is left out', () => { +test('calls marked no are broken with a note', () => { const { row } = entry('beyondx'); assert.equal(row.relock, 'no'); assert.equal(row.features.volte.status, 'broken'); assert.ok(row.features.vowifi.note); - assert.equal(row.features['5g'], undefined); +}); + +test('5G marked no is broken on a phone named 5G, and left out on the rest', () => { + assert.equal(entry('beyondx').row.features['5g'].status, 'broken'); + assert.ok(entry('beyondx').row.features['5g'].note); + assert.equal(entry('a5y17lte').row.features['5g'], undefined); }); test('wifi-only tablets get no call features at all', () => {