postlund / pyatv

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

HA Integration Beta: Errors With Apple TV 3 #1359

Closed MizterB closed 3 years ago

MizterB commented 3 years ago

Describe the bug

I was able to complete pairing an Apple TV Gen 3, running TVOS 7.8 (latest). I believe it paired using Airplay and DMAP. While the entities show up in Home Assistant, they remain off, and I am unable to control anything. There is an error in the HA logs.

Error log

2021-09-30 08:45:05 ERROR (MainThread) [custom_components.apple_tv] Failed to connect
Traceback (most recent call last):
  File "/config/custom_components/apple_tv/__init__.py", line 261, in _connect_loop
    await self._connect(conf)
  File "/config/custom_components/apple_tv/__init__.py", line 337, in _connect
    self.atv = await connect(conf, self.hass.loop, session=session)
  File "/usr/local/lib/python3.9/site-packages/pyatv/__init__.py", line 91, in connect
    for setup_data in proto_methods.setup(
  File "/usr/local/lib/python3.9/site-packages/pyatv/protocols/airplay/__init__.py", line 219, in setup
    if not remote_control.is_supported(service):
  File "/usr/local/lib/python3.9/site-packages/pyatv/protocols/airplay/remote_control.py", line 48, in is_supported
    return float(version) >= 13.0
ValueError: could not convert string to float: '8.4.4'

How to reproduce the bug?

Pair a fully updated Apple TV 3 to the latest Home Assistant with the latest Apple TV Beta custom component.

What is expected behavior?

View or control the playback state on an Apple TV 3

Operating System

HAOS

Python

3.7

pyatv

Latest

Device

Apple TV 3rd Gen, TVOS 7.8

Additional context

None

postlund commented 3 years ago

Ah, right! That ones on me, thanks for letting me know!

postlund commented 3 years ago

I made a fix in #1361, it will be part of the next release I make of pyatv.

postlund commented 3 years ago

I pushed an update to the component now, can you verify if the problem is solved?

postlund commented 3 years ago

I believe this is solved.

MizterB commented 3 years ago

I forgot to follow up earlier. Just updated and checked the logs - the errors are no longer shown.

Airplay playback also confirmed working...the media info and playback controls are fine. Thank you!!

postlund commented 3 years ago

Perfect, thanks for reporting back 👍