Skip to content

Refactor nzbget to support future platform changes#26462

Merged
MartinHjelmare merged 15 commits into
home-assistant:devfrom
chriscla:nzbget-platform
Sep 15, 2019
Merged

Refactor nzbget to support future platform changes#26462
MartinHjelmare merged 15 commits into
home-assistant:devfrom
chriscla:nzbget-platform

Conversation

@chriscla
Copy link
Copy Markdown
Contributor

@chriscla chriscla commented Sep 6, 2019

Breaking Change:

The NZBGet integration has been changed to support multiple platforms and future events, and common code has been centralized to the component. The configuration has moved from the sensor platform to the nzbget key in configuration.yaml, and the monitored_variables option has been removed. Users need to update their configuration.

Description:

Re-factor NZBGet component to move core logic out of the sensor platform and into a common component. Update config to have a nzbget: root-level entry.

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

Example entry for configuration.yaml:

nzbget:
  host: 192.168.1.1
  ssl: false  

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.

@chriscla chriscla changed the title Changing nzbget component to support multiple platforms Re-factoring nzbget component to support future platform changes. Sep 6, 2019
Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

We shouldn't make any changes to this integration until a pypi library is used for the api interface.

Comment thread homeassistant/components/nzbget/__init__.py Outdated
Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Nice!

Comment thread homeassistant/components/nzbget/sensor.py Outdated
Comment thread homeassistant/components/nzbget/sensor.py Outdated
Comment thread homeassistant/components/nzbget/__init__.py Outdated
Comment thread homeassistant/components/nzbget/sensor.py Outdated
Comment thread homeassistant/components/nzbget/__init__.py Outdated
Comment thread homeassistant/components/nzbget/__init__.py
Comment thread homeassistant/components/nzbget/__init__.py Outdated
Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Great! Just a small comment.

Comment thread homeassistant/components/nzbget/__init__.py Outdated
@MartinHjelmare MartinHjelmare changed the title Re-factoring nzbget component to support future platform changes. Refactor nzbget to support future platform changes Sep 12, 2019
@MartinHjelmare
Copy link
Copy Markdown
Member

Please solve the merge conflict.

Comment thread homeassistant/components/nzbget/manifest.json Outdated
@chriscla
Copy link
Copy Markdown
Contributor Author

chriscla commented Sep 14, 2019

@MartinHjelmare -- thank you for all the review comments and support :) It's really appreciated as someone new here.

I'm making the config change so that I can add more to the component (e.g. stop nzbget service, event when a download completes, etc...). Right now though, this change just has the sensor platform. So it's a breaking change without additional functionality. Should I go forward with this change or should I re-factor it so it's non-breaking and then do the break when I add more features? I would prefer to go forward with this and just add the new functionality asap.

Also, the CI (Overview Validate) keeps failing asking me to run the requirements script. I've done that on an updated rep, so I'm not sure what's going on.

@MartinHjelmare
Copy link
Copy Markdown
Member

MartinHjelmare commented Sep 14, 2019

I think we can move forward with this PR as a breaking change.

Please run python3 -m script.hassfest to update codeowners file.

Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Great!

@MartinHjelmare MartinHjelmare merged commit 57833f5 into home-assistant:dev Sep 15, 2019
@lock lock Bot locked and limited conversation to collaborators Sep 16, 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.

3 participants