Skip to content

Commit 20c3040

Browse files
committed
Backport - Add new device: Apple HomePod
(cherry picked from commit 5d603da)
1 parent 9057a1d commit 20c3040

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

src/ua-parser.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@
769769
], [VENDOR, [TYPE, EMBEDDED]], [
770770
/(aeobc)\b/i // Echo Dot
771771
], [MODEL, [VENDOR, AMAZON], [TYPE, EMBEDDED]], [
772+
/(homepod).+mac os/i // Apple HomePod
773+
], [MODEL, [VENDOR, APPLE], [TYPE, EMBEDDED]], [
772774
/windows iot/i
773775
], [[TYPE, EMBEDDED]], [
774776

@@ -827,7 +829,7 @@
827829
], [[VERSION, strMapper, windowsVersionMap], [NAME, 'Windows']], [
828830

829831
// iOS/macOS
830-
/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, // iOS
832+
/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i, // iOS
831833
/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,
832834
/cfnetwork\/.+darwin/i
833835
], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [

test/device-test.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,6 +1844,15 @@
18441844
"type": "undefined"
18451845
}
18461846
},
1847+
{
1848+
"desc": "Apple HomePod",
1849+
"ua": "AppleCoreMedia/1.0.0.15D61 (HomePod; U; CPU OS 11_2_5 like Mac OS X; en_us)",
1850+
"expect": {
1851+
"vendor": "Apple",
1852+
"model": "HomePod",
1853+
"type": "embedded"
1854+
}
1855+
},
18471856
{
18481857
"desc": "Apple Watch",
18491858
"ua": "atc/1.0 watchOS/7.3.3 model/Watch4,2 hwp/t8006 build/18S830 (6; dt:191)",

test/os-test.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,15 @@
818818
"version" : "16.4.1"
819819
}
820820
},
821+
{
822+
"desc": "Apple HomePod",
823+
"ua": "AppleCoreMedia/1.0.0.15D61 (HomePod; U; CPU OS 11_2_5 like Mac OS X; en_us)",
824+
"expect" :
825+
{
826+
"name" : "iOS",
827+
"version" : "11.2.5"
828+
}
829+
},
821830
{
822831
"desc" : "watchOS",
823832
"ua" : "server-bag [Watch OS,8.4,19S546,Watch3,4]",

0 commit comments

Comments
 (0)