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

Centralizes Toon data, reducing API calls #23988

Merged
merged 5 commits into from
Jul 9, 2019
Merged

Centralizes Toon data, reducing API calls #23988

merged 5 commits into from
Jul 9, 2019

Conversation

frenck
Copy link
Member

@frenck frenck commented May 19, 2019

Description:

Centralizes all Toon data, resulting in a heavy reduction of the API call's made.
The TTL cache mechanism used by the toonapilib can't handle our use case correctly.

Related issue (if applicable): fixes #21825

Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#9488

Example entry for configuration.yaml (if applicable):

toon:
  client_id: fxiyXLtFfhimADJlmFjTjXdHoxZ8AFg7
  client_secret: kPUCx88CTCSMAaBA
  scan_interval: 120

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

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

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

  • The manifest file has all fields filled out correctly. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

If the code does not interact with devices:

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

Signed-off-by: Franck Nijhof [email protected]

@frenck
Copy link
Member Author

frenck commented May 19, 2019

Hmz, VScode just ignores the templates when creating a PR on GitHub... sorry about that, will update OP in a second.
Done.

@pvizeli
Copy link
Member

pvizeli commented May 22, 2019

Blocked by #23899

Copy link
Member

@balloob balloob left a comment

Choose a reason for hiding this comment

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

ok to merge when comment addressed.

For your next PR, please keep styling changes separate from functional changes. Makes it hard to see what is going on .

@frenck
Copy link
Member Author

frenck commented May 24, 2019

For your next PR, please keep styling changes separate from functional changes. Makes it hard to see what is going on

You are absolutely right, sorry about that.

I'll hold off further changes until #23899 is merged, as @pvizeli marked it as blocking for this PR.

@frenck frenck changed the title Centralizes Toon data, reducing API calls WIP: Centralizes Toon data, reducing API calls Jul 8, 2019
@frenck
Copy link
Member Author

frenck commented Jul 8, 2019

Since the blocking PR has been merged:
Will resolve merge conflicts and resolve last review comment tonight.

@frenck
Copy link
Member Author

frenck commented Jul 8, 2019

Blocked by #25027

@frenck frenck force-pushed the frenck-2019-0045 branch from fb40b6b to c42205d Compare July 9, 2019 10:28
@frenck
Copy link
Member Author

frenck commented Jul 9, 2019

Rebased onto origin/dev, addressed review comment.
Ready for review.

@frenck frenck changed the title WIP: Centralizes Toon data, reducing API calls Centralizes Toon data, reducing API calls Jul 9, 2019
@frenck
Copy link
Member Author

frenck commented Jul 9, 2019

I have a followup PR ready that enhances this a bit more and improves the use of Climate 1.0. However, I did not want to mix it up into this PR.

@pvizeli pvizeli merged commit 3ce1049 into dev Jul 9, 2019
@delete-merged-branch delete-merged-branch bot deleted the frenck-2019-0045 branch July 9, 2019 12:18
@balloob balloob mentioned this pull request Jul 17, 2019
alandtse pushed a commit to alandtse/home-assistant that referenced this pull request Oct 12, 2019
* Centralizes Toon data, reducing API calls

Fixes home-assistant#21825

Signed-off-by: Franck Nijhof <[email protected]>

* Fixes bad copy past action in services.yaml

Signed-off-by: Franck Nijhof <[email protected]>

* Addresses review comments

Signed-off-by: Franck Nijhof <[email protected]>

* 👕 Fixes too many blank lines

* Unsub dispatcher
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Toon component calling the Toon api too much
4 participants