Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Neato Library And Reduce Cloud Calls #15072

Merged
merged 3 commits into from
Jun 21, 2018

Conversation

dshokouhi
Copy link
Member

@dshokouhi dshokouhi commented Jun 20, 2018

Description:

This PR updates the pybotvac library to the latest version and also reduces the amount of calls being sent to Neato's servers. Previously the robot would update every second, the robot map every 10 and the vacuum/switch entities were set to the default. Now everything is set to update once a minute.

I have tested these changes locally and can confirm a significant drop in the amount of calls being made. Previously there would be more than 50,000 calls a day being made. With these changes that number drops drastically, well below 10,000 a day. This cuts down on most if not all time out and gateway errors that user are experiencing. The only side effect to the change is that the vacuum toggle may be a bit slower to update than before but it will update.

Pi-Hole long term stats to show that the calls were reduced immediately:

neato-pihole

Related issue (if applicable): fixes #

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>

Example entry for configuration.yaml (if applicable):

neato:
  username: user
  password: pass

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).
  • New dependencies are only imported inside functions that use them (example).
  • 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.

@homeassistant
Copy link
Contributor

Hi @dshokouhi,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@ghost ghost added the in progress label Jun 20, 2018
@dshokouhi dshokouhi changed the title Neato throttling Update Neato Library And Reduce Cloud Calls Jun 20, 2018
@Kane610
Copy link
Member

Kane610 commented Jun 20, 2018

Looks good!

@balloob
Copy link
Member

balloob commented Jun 21, 2018

That's a crazy amount of calls . Even 10k is a lot. Can we reduce it even more ?

@balloob balloob merged commit 6cabbd2 into home-assistant:dev Jun 21, 2018
@ghost ghost removed the in progress label Jun 21, 2018
@balloob balloob added this to the 0.72 milestone Jun 21, 2018
@dshokouhi dshokouhi deleted the neato-throttling branch June 21, 2018 01:51
@dshokouhi
Copy link
Member Author

@balloob I will look into that, the camera and switch could probably cut down more on the scanning since the vacuum is probably the most important part :) . I'll do some testing locally and cut down the calls to be more reasonable.

@balloob
Copy link
Member

balloob commented Jun 21, 2018

We haven't done it before in Home Assistant, but I wonder if we should explore increasing polling frequency when the vacuum is in use versus when not.

balloob pushed a commit that referenced this pull request Jun 21, 2018
* Update Neato library to 0.0.6 and reduce the amount of calls to the cloud

* Remove file commited in error

* Lint
@dshokouhi
Copy link
Member Author

That would be ideal because then we can also update the map only when it needs to be, just after it was in use. There is no need to update the map if there has been no activity on the vacuum. The image is not going to change.

@balloob balloob mentioned this pull request Jun 22, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Dec 10, 2018
@ghost ghost removed the platform: vacuum.neato label Mar 21, 2019
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.

4 participants