kellerza / pysma

Async library for SMA Solar's WebConnect interface
MIT License
59 stars 51 forks source link

Handle TimeoutError #98

Closed kellerza closed 2 years ago

kellerza commented 2 years ago

Suggestion to fix https://github.com/home-assistant/core/issues/68999

Raising a SmaConnectionException instead of TimeoutError should allow HA to retry the setup later

  1. This results in a ConfigEntryNotReady here
  2. And a retry here
codecov[bot] commented 2 years ago

Codecov Report

Merging #98 (c5a8e46) into master (5518fc3) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master       #98   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          419       420    +1     
=========================================
+ Hits           419       420    +1     
Impacted Files Coverage Δ
pysma/__init__.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5518fc3...c5a8e46. Read the comment docs.

rklomp commented 2 years ago

I have let it run a while but does not seems to get a natural timeout, which makes me wonder if there is anything changed in the HA core which is now causing the timeouts...

I found these two changes which are related to async timeout. Not sure if they can be related. https://github.com/home-assistant/core/pull/58974 https://github.com/home-assistant/core/pull/65732

ghost commented 2 years ago

I found these two changes which are related to async timeout. Not sure if they can be related. home-assistant/core#58974 home-assistant/core#65732

Maybe. I have been running the examply.py for the entire night without ANY timeout. It just works. But, can we wrap this PR up so it can be integrated in HA as soon as possible @kellerza?

skyluker commented 1 year ago

I have made new instalation of HA in docker to check this out. And it has connected to SMA without issues. Perhaps it has something to do with my configuration: I have redirected ports on my router and I always connect to HA with domain name, with ssl, on the router I has hairpin.