Skip to content

Commit

Permalink
Add new device: Apple HomePod
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed Dec 12, 2024
1 parent 84b41f5 commit 5d603da
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/ua-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,8 @@
], [VENDOR, [TYPE, EMBEDDED]], [
/(aeobc)\b/i // Echo Dot
], [MODEL, [VENDOR, AMAZON], [TYPE, EMBEDDED]], [
/(homepod).+mac os/i // Apple HomePod
], [MODEL, [VENDOR, APPLE], [TYPE, EMBEDDED]], [
/windows iot/i
], [[TYPE, EMBEDDED]], [

Expand Down Expand Up @@ -898,7 +900,7 @@
], [[VERSION, strMapper, windowsVersionMap], [NAME, WINDOWS]], [

// iOS/macOS
/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, // iOS
/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i, // iOS
/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,
/cfnetwork\/.+darwin/i
], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [
Expand Down
9 changes: 9 additions & 0 deletions test/data/ua/device/apple.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@
"type": "mobile"
}
},
{
"desc": "Apple HomePod",
"ua": "AppleCoreMedia/1.0.0.15D61 (HomePod; U; CPU OS 11_2_5 like Mac OS X; en_us)",
"expect": {
"vendor": "Apple",
"model": "HomePod",
"type": "embedded"
}
},
{
"desc": "Issue #519",
"ua": "ios/iPhone/14.2/SOME_CUSTOM_APP_VERSION",
Expand Down
9 changes: 9 additions & 0 deletions test/data/ua/os/ios.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,14 @@
"name" : "iOS",
"version" : "7.0.2"
}
},
{
"desc": "Apple HomePod",
"ua": "AppleCoreMedia/1.0.0.15D61 (HomePod; U; CPU OS 11_2_5 like Mac OS X; en_us)",
"expect" :
{
"name" : "iOS",
"version" : "11.2.5"
}
}
]

0 comments on commit 5d603da

Please sign in to comment.