Add detection Sonos player and Sonos app#567
Add detection Sonos player and Sonos app#567ddurham2 wants to merge 5 commits intoua-parser:masterfrom
Conversation
| - user_agent_string: 'Linux UPnP/1.0 Sonos/29.3-87071 (ICRU\_iPhone7,1); iOS/Version 8.2 (Build 12D508)' | ||
| family: 'iPhone' | ||
| brand: 'Apple' | ||
| model: 'iPhone7,1' |
There was a problem hiding this comment.
Shouldn't this be only iPhone7?
There was a problem hiding this comment.
I pulled it from here: https://docs.sonos.com/docs/soap-requests-and-responses#user-agent-header
There was a problem hiding this comment.
Sure thing, my question was whether we want the model to be iPhone7 or iPhone7,1
There was a problem hiding this comment.
Well, I'm not really sure what iPhone7,1 even means.. but I'll change it
There was a problem hiding this comment.
Tests are failing, mind having a look?
There was a problem hiding this comment.
Okay, sorry for the delay.
So, I reverted the model back to expect it as "iPhone7,1" since:
A) that's the literal example on the Sonos docs site
B) the general parser is correctly parsing the model as "iPhone7,1" and it the tests fail when I muck with it in the way suggested (they now pass).
and
C) I see precedent for both versioned and unversioned model values, depending on whether the UA contained it.
For example, from test_device.yaml
user_agent_string: 'Mozilla/5.0 (iPhone; U; fr; CPU iPhone OS 4_2_1 like Mac OS X; fr) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148a Safari/6533.18.5'
parses as model: 'iPhone'
and
user_agent_string: 'Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20100101 Firefox/10.0 [FBAN/FBIOS;FBAV/7.0.0.17.1;FBBV/1325030;FBDV/iPhone6,2;FBMD/iPhone;FBSN/iPhone OS;FBSV/7.0.6;FBSS/2; FBCR/Telekom.de;FBID/phone;FBLC/de_DE;FBOP/5]'
parses as model: 'iPhone6,2'
and many more examples.
Is that acceptable?
This reverts commit cef32e4.
Support for devices from: https://www.sonos.com