Closed ollo69 closed 2 years ago
I don't know why this exception is happening. Here's where it is in the code: https://github.com/JeffLIrion/adb_shell/blob/bf4d348e3aa0999b24976de9bac442b0e180a27e/adb_shell/transport/tcp_transport_async.py#L75-L79
I think 1 second should be plenty of time. Have you tested your changes and verified that allowing more time avoids the exception?
Error normally occurs only during initial setup. I think that could be related to the hw of the fire TV stick that probably is not so fast. It fails on first connect, second retry that is normally fired after few seconds by HA ends without error. And yes, I tested changes in HA and just increasing the timeout to 2 seconds seems to solve the issue.
Just to be clear, when you say "initial setup," are you talking about config flow or at every HA restart?
Also, a simpler change would be to increase the hard-coded value from 1.0 to, say, 5.0. Of course, adding a parameter allows for greater flexibility. I think either approach is probably fine.
Talking about every HA restart, so when setup
is called.
I agree with you that increase the hard-coded value is simpler, but I wouldn't change current default value. I also defined a max value (5 sec) to avoid set this timeout to excessive high value.
It would still be good to get to the bottom of this. I would think that 1 second would be plenty of time and that there must be some other issue. But if changing it to 2 seconds fixed the problem for you, that strongly suggests the problem really was as simple as 1 second not being enough time.
Let me know if you want me to make a new release.
It would still be good to get to the bottom of this. I would think that 1 second would be plenty of time and that there must be some other issue. But if changing it to 2 seconds fixed the problem for you, that strongly suggests the problem really was as simple as 1 second not being enough time.
Let me know if you want me to make a new release.
That's the idea, This is not a big or urgent issue, because at the end I just have a couple of Warning message during HA restart, but I think that having a new version to be able to increase the initial timeout to 2 seconds will be better and I don't see any possible side-effect on this.
In most case during initial connection to my FireTV devices I receive back the error:
With this PR it will be possible to increase a little bit the
transport_timeout
used in theconnect
method that is currently hard coded to 1 second.