Skip to content

Update waterfurnace library to 0.7, add reconnect logic#15657

Merged
sdague merged 1 commit intohome-assistant:devfrom
sdague:0.74_local
Aug 14, 2018
Merged

Update waterfurnace library to 0.7, add reconnect logic#15657
sdague merged 1 commit intohome-assistant:devfrom
sdague:0.74_local

Conversation

@sdague
Copy link
Copy Markdown
Contributor

@sdague sdague commented Jul 24, 2018

One of the features of the waterfurnace 0.7 is timingout out stuck
connections on the websocket (which tends to happen after 48 - 96
hours of operation). This requires the homeassistant component to
catch and reconnect under these circumstances. This has turned out to
be pretty robust in preventing stuck sockets over the last month.

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable ([example][ex-requir]).
  • New dependencies are only imported inside functions that use them ([example][ex-import]).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

One of the features of the waterfurnace 0.7 is timingout out stuck
connections on the websocket (which tends to happen after 48 - 96
hours of operation). This requires the homeassistant component to
catch and reconnect under these circumstances. This has turned out to
be pretty robust in preventing stuck sockets over the last month.
self._shutdown = False
self._fails = 0

def _reconnect(self):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think that this kind of logic should be moved into the waterfurnace lib as it might be useful for other users of the lib too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible. I get a little concerned when libraries put all their own retry logic under the cover as they may not understand a larger symptom of what is going on that they should stop.

If you want I can move it down to the lower layer.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well if the lib would expose both, a raw connection and a managed connection, it could work.

I'm fine either way. You pick.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, apparently I never hit submit on my comments. For now I'd like to merge this and get back into the mix.

@sdague sdague merged commit 051903d into home-assistant:dev Aug 14, 2018
@ghost ghost removed the in progress label Aug 14, 2018
@balloob balloob mentioned this pull request Aug 29, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Dec 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants