postlund / pyatv

A client library for Apple TV and AirPlay devices
https://pyatv.dev
MIT License
841 stars 91 forks source link

Pairing requirement detected wrong for macOS #2105

Closed postlund closed 11 months ago

postlund commented 11 months ago

Describe the bug

Pairing requirement is detected as NotNeeded when access setting is set to current user in macOS. This is wrong and should be reported as Unsupported as pyatv cannot handle this case right now.

Error log

<place log here>

How to reproduce the bug?

$ atvremote scan
Scan Results
========================================
       Name: Pierre
   Model/SW: MacBookAir10,1, Unknown OS
    Address: 192.168.1.20
        MAC: xx:xx:xx:xx:xx:xx
 Deep Sleep: False
Identifiers:
 - xx:xx:xx:xx:xx:xx
 - xxxxxxxxxxxx
Services:
 - Protocol: Companion, Port: 53312, Credentials: None, Requires Password: False, Password: None, Pairing: Unsupported
 - Protocol: AirPlay, Port: 7000, Credentials: None, Requires Password: False, Password: None, Pairing: NotNeeded
 - Protocol: RAOP, Port: 7000, Credentials: None, Requires Password: False, Password: None, Pairing: NotNeeded

What is expected behavior?

$ atvremote scan
Scan Results
========================================
       Name: Pierre
   Model/SW: MacBookAir10,1, Unknown OS
    Address: 192.168.1.20
        MAC: xx:xx:xx:xx:xx:xx
 Deep Sleep: False
Identifiers:
 - xx:xx:xx:xx:xx:xx
 - xxxxxxxxxxxx
Services:
 - Protocol: Companion, Port: 53312, Credentials: None, Requires Password: False, Password: None, Pairing: Unsupported
 - Protocol: AirPlay, Port: 7000, Credentials: None, Requires Password: False, Password: None, Pairing: Unsupported
 - Protocol: RAOP, Port: 7000, Credentials: None, Requires Password: False, Password: None, Pairing: Unsupported

Operating System

Any

Python

3.10

pyatv

0.13.2

Device

macOS 13.4.1

Additional context

I tried switching between current user and all users on the same network, performing a scan after making each change. What I can see is that act=2 is added as a property when set to current user. I believe this is short for Access Control Type, but I'm not entirely sure what values it can take and what the default value is if omitted. Should still be usable though.

postlund commented 11 months ago

Fixed by #2118