postlund / pyatv

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

Detected Apple TV has no name "()" #1369

Open domtik opened 2 years ago

domtik commented 2 years ago

Describe the bug

Hello,

After entering the code 2 times i got the error "A problem occurred while pairing protocol MRP. It will be ignored" then if i bypass this message i'm requested to enter the code again. I finally have a success message but the detected device does not have a name "()". So at the end i end up with a "ghost" apple TV device that is not reacting to any command. I made sure to use your latest beta version and also deleted the existing integration and excluded the device before trying anything.

image

Error log

<place log here>

How to reproduce the bug?

Add appleTV integration

What is expected behavior?

Detected Apple TV has no name "()" and not reacting to commands

Operating System

Home assistant on docker / Ubuntu 21.04

Python

3.9

pyatv

0.9.2

Device

Apple TV 4K tvOS 15.0

Additional context

I use firefox as a client browser for Home assistant

domtik commented 2 years ago

I left the integration screen for few minutes after taking the screenshot and i noticed that the AppleTV name came up magically. I dont know what was wrong but now the device is integrated successfully...

postlund commented 2 years ago

There's a problem with MRP in the final version of tvOS 15 as it it announced, but not usable in any way. So it is ok that if fails (AirPlay will succeed and fill its place). I have merged a change to pyatv to ignore the MRP service for tvOS 15 device, so it will not be a problem in the future.

I think the device info appears late because of a race condition. The dialog is shown prior to a connection exists to a device, thus no information is available. I'm not entirely sure how to fix that yet, I'm aware of the problem and hoping to make it better somehow.

ranrinc commented 2 years ago

Got the same error but the ATV is now detected. Thank you @postlund for this