Skip to content

Improve IQVIA data/API management based on enabled entities#32291

Merged
bachya merged 7 commits intohome-assistant:devfrom
bachya:iqvia-data-management
Mar 17, 2020
Merged

Improve IQVIA data/API management based on enabled entities#32291
bachya merged 7 commits intohome-assistant:devfrom
bachya:iqvia-data-management

Conversation

@bachya
Copy link
Copy Markdown
Contributor

@bachya bachya commented Feb 28, 2020

Proposed change

#32223 deprecated monitored conditions within IQVIA. Since the integration derives its data from several API calls, this PR goes a step further and improves its data management so that as entities are enabled/disabled, the appropriate API calls are also enabled/disabled.

Additionally, this PR removes some useless warning messages.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

# Example configuration.yaml
iqvia:
  zip_code: !secret zip_code

Additional information

  • This PR fixes or closes issue: N/A
  • This PR is related to issue: N/A
  • Link to documentation pull request: N/A

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

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.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 28, 2020

Codecov Report

❗ No coverage uploaded for pull request base (dev@d36259f). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##             dev   #32291   +/-   ##
======================================
  Coverage       ?   94.74%           
======================================
  Files          ?      772           
  Lines          ?    55935           
  Branches       ?        0           
======================================
  Hits           ?    52995           
  Misses         ?     2940           
  Partials       ?        0

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 d36259f...9927577. Read the comment docs.

Comment thread homeassistant/components/iqvia/__init__.py Outdated
Comment thread homeassistant/components/iqvia/__init__.py Outdated
Comment thread homeassistant/components/iqvia/__init__.py Outdated
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.

async_added_to_hass should not trigger an update.

Copy link
Copy Markdown
Contributor Author

@bachya bachya Mar 11, 2020

Choose a reason for hiding this comment

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

Without this, the entities show unavailable until their next update cycle. With this "API registration" mechanism in play, I'm unclear on how to instruct an entity to update immediately after its data is pulled (which occurs when "interest" is registered first) without this.

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.

@balloob How do you feel about c41edf1?

Comment thread homeassistant/components/iqvia/__init__.py Outdated
Comment thread homeassistant/components/iqvia/__init__.py Outdated
@bachya bachya force-pushed the iqvia-data-management branch from adcafd3 to 0025ce4 Compare March 16, 2020 03:12
@bachya bachya mentioned this pull request Mar 16, 2020
20 tasks
@bachya bachya force-pushed the iqvia-data-management branch from ac1b948 to c41edf1 Compare March 16, 2020 17:51
Comment thread homeassistant/components/iqvia/__init__.py Outdated
Comment thread homeassistant/components/iqvia/__init__.py Outdated
Comment thread homeassistant/components/iqvia/__init__.py
Copy link
Copy Markdown
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 last comment addressed 👍

@bachya bachya merged commit a278cf3 into home-assistant:dev Mar 17, 2020
@bachya bachya deleted the iqvia-data-management branch March 18, 2020 03:11
@lock lock Bot locked and limited conversation to collaborators Mar 21, 2020
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