From 3a78cf598deb4cdad0ffb7b96a5a157338b534c3 Mon Sep 17 00:00:00 2001 From: JBYoshi <12983479+JBYoshi@users.noreply.github.com> Date: Wed, 4 Sep 2019 10:21:13 -0500 Subject: [PATCH] Classify Apple TV and Chromecast as smart TVs. --- src/ua-parser.js | 4 ++-- test/device-test.json | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ua-parser.js b/src/ua-parser.js index de0579c..1355bb5 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -418,7 +418,7 @@ ], [MODEL, [VENDOR, 'Apple'], [TYPE, TABLET]], [ /(apple\s{0,1}tv)/i // Apple TV - ], [[MODEL, 'Apple TV'], [VENDOR, 'Apple']], [ + ], [[MODEL, 'Apple TV'], [VENDOR, 'Apple'], [TYPE, SMARTTV]], [ /(archos)\s(gamepad2?)/i, // Archos /(hp).+(touchpad)/i, // HP TouchPad @@ -558,7 +558,7 @@ ], [VENDOR, MODEL, [TYPE, MOBILE]], [ /crkey/i // Google Chromecast - ], [[MODEL, 'Chromecast'], [VENDOR, 'Google']], [ + ], [[MODEL, 'Chromecast'], [VENDOR, 'Google'], [TYPE, SMARTTV]], [ /android.+;\s(glass)\s\d/i // Google Glass ], [MODEL, [VENDOR, 'Google'], [TYPE, WEARABLE]], [ diff --git a/test/device-test.json b/test/device-test.json index 6074665..7fbc69c 100644 --- a/test/device-test.json +++ b/test/device-test.json @@ -635,7 +635,8 @@ "ua": "Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.84 Safari/537.36 CrKey/1.22.79313", "expect": { "vendor": "Google", - "model": "Chromecast" + "model": "Chromecast", + "type": "smarttv" } }, {