python-androidtv icon indicating copy to clipboard operation
python-androidtv copied to clipboard

Missing connection state awareness results in endless connection attempt loops (Android TV powered off) and log flooding

Open bcutter opened this issue 3 years ago • 5 comments

I discovered the same as this user here, unfortunately it seems he didn't raise an issue in this repo as recommended at the end of the issue:

Android TV integration very chatty in log when configured Android TV device is not available (turned off) https://github.com/home-assistant/core/issues/69672 (here the problem is already described)

Problem: python-androidtv constantly (every 80 seconds) trys to connect to the tv. If it is powered off, it will go on like forever. On every failed connect attempt an error is written to the log. This floods logs pretty fast pretty heavily.

This is what Home Assistant log contains for ONE single failed connection attempt:

Logger: androidtv.adb_manager.adb_manager_async
Source: /usr/local/lib/python3.9/site-packages/androidtv/adb_manager/adb_manager_async.py:298
First occurred: 30. Mai 2022, 16:21:17 (1445 occurrences)
Last logged: 00:50:11

Couldn't connect to xxx.xxx.xxx.xxx:5555. TcpTimeoutException: Connecting to xxx.xxx.xxx.xxx:5555 timed out (1.0 seconds)

This is what HA's GUI presents: grafik

The experts from HA (see referenced issue) told this is nothing HA can fix but this only can to be done in this library repo.

By the way: Not related to https://github.com/JeffLIrion/python-androidtv/issues/15

bcutter avatar May 31 '22 23:05 bcutter

https://github.com/JeffLIrion/python-androidtv/blob/f63687a96fc222eedb5f2fd852fc729f92d33a47/androidtv/setup_async.py#L23

As long as HA continues to call setup with log_errors=True, this package will continue to log failed setup attempts. This should be fixed in HA.

JeffLIrion avatar Jun 01 '22 04:06 JeffLIrion

Ah come on guys... you ping pong users from one side to the other :-D Why don't you talk with each other to find a solution ;-)

So here we go: https://github.com/home-assistant/core/issues/72851

bcutter avatar Jun 01 '22 18:06 bcutter

Until someone submits a fix, I suggest setting the log level to critical for the Android TV integration.

JeffLIrion avatar Jun 02 '22 02:06 JeffLIrion

That's a workaround. So let's look/wait for a fix.

bcutter avatar Jun 02 '22 07:06 bcutter

Hi any news about this? :)

I have hundred and hundred message like that, just after 1 or 2 days :(. The other thread is locked, I can't open it again

Thanks

kevincaradant avatar Jan 23 '23 23:01 kevincaradant