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

Add Post Processing Jobs to NZBGet component #29027

Merged
merged 2 commits into from Nov 26, 2019

Conversation

@alex3305
Copy link
Contributor

alex3305 commented Nov 24, 2019

Description:

In the current implementation of the NZBGet component there is no way of knowing whether NZBGet is still in the Post Processing phase of a download job. This can be very useful information. For instance when you want to suspend the NZBGet service when all queue items have been completed.

This change adds that additional sensor.

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

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 does not interact with devices:

  • Tests have been added to verify that the new code works.
In the current implementation of the NZBGet component there is no way of
knowing whether NZBGet is still in the Post Processing phase of a download
job. This can be very useful information. For instance when you want to
suspend the NZBGet service when all queue items have been completed.

This change adds that additional sensor.
@probot-home-assistant

This comment has been minimized.

Copy link

probot-home-assistant bot commented Nov 24, 2019

Hey there @chriscla, mind taking a look at this pull request as its been labeled with a integration (nzbget) you are listed as a codeowner for? Thanks!

@alex3305 alex3305 mentioned this pull request Nov 24, 2019
2 of 2 tasks complete
@chriscla

This comment has been minimized.

Copy link
Contributor

chriscla commented Nov 24, 2019

Cool! Thanks for contributing. I don't think I can merge but this looks good to me.

@alex3305

This comment has been minimized.

Copy link
Contributor Author

alex3305 commented Nov 25, 2019

I've tested this change for the last couple of days now and it seems to be working great. Example from today:

image
image

@@ -18,6 +18,7 @@
"download_rate": ["DownloadRate", "Speed", "MB/s"],
"download_size": ["DownloadedSizeMB", "Size", "MB"],
"free_disk_space": ["FreeDiskSpaceMB", "Disk Free", "MB"],
"post_job_count": ["PostJobCount", "Post Processing Jobs", "Count"],

This comment has been minimized.

Copy link
@pvizeli

pvizeli Nov 26, 2019

Member

Counts are mostly #. What do you thing?

This comment has been minimized.

Copy link
@alex3305

alex3305 Nov 26, 2019

Author Contributor

This value from NZBGet is a number, as you can see in my screenshot above. I took some inspiration from the Glances component where Count is consistently used for something like the number of running processes.

But I'm open for suggestions if you have any.

This comment has been minimized.

Copy link
@balloob

balloob Nov 26, 2019

Member

Jobs seems appropriate, that's what you're counting.

This comment has been minimized.

Copy link
@alex3305

alex3305 Nov 26, 2019

Author Contributor

@balloob Thanks. I've amended this in my recent commit.

@MartinHjelmare MartinHjelmare changed the title Added Post Processing Jobs to NZBGet component Add Post Processing Jobs to NZBGet component Nov 26, 2019
@MartinHjelmare MartinHjelmare added this to Needs review in Dev Nov 26, 2019
@homeassistant

This comment was marked as resolved.

Copy link
Contributor

homeassistant commented Nov 26, 2019

Hello @alex3305,

When attempting to inspect the commits of your pull request for CLA signature status among all authors we encountered commit(s) which were not linked to a GitHub account, thus not allowing us to determine their status(es).

The commits that are missing a linked GitHub account are the following:

Unfortunately, we are unable to accept this pull request until this situation is corrected.

Here are your options:

  1. If you had an email address set for the commit that simply wasn't linked to your GitHub account you can link that email now and it will retroactively apply to your commits. The simplest way to do this is to click the link to one of the above commits and look for a blue question mark in a blue circle in the top left. Hovering over that bubble will show you what email address you used. Clicking on that button will take you to your email address settings on GitHub. Just add the email address on that page and you're all set. GitHub has more information about this option in their help center.

  2. If you didn't use an email address at all, it was an invalid email, or it's one you can't link to your GitHub, you will need to change the authorship information of the commit and your global Git settings so this doesn't happen again going forward. GitHub provides some great instructions on how to change your authorship information in their help center.

    • If you only made a single commit you should be able to run
      git commit --amend --author="Author Name <email@address.com>"
      
      (substituting Author Name and email@address.com for your actual information) to set the authorship information.
    • If you made more than one commit and the commit with the missing authorship information is not the most recent one you have two options:
      1. You can re-create all commits missing authorship information. This is going to be the easiest solution for developers that aren't extremely confident in their Git and command line skills.
      2. You can use this script that GitHub provides to rewrite history. Please note: this should be used only if you are very confident in your abilities and understand its impacts.
    • Whichever method you choose, I will come by to re-check the pull request once you push the fixes to this branch.

We apologize for this inconvenience, especially since it usually bites new contributors to Home Assistant. We hope you understand the need for us to protect ourselves and the great community we all have built legally. The best thing to come out of this is that you only need to fix this once and it benefits the entire Home Assistant and GitHub community.

Thanks, I look forward to checking this PR again soon! ❤️

@alex3305 alex3305 force-pushed the alex3305:nzbget-pp-job-count branch 2 times, most recently from b041f84 to 8e07e39 Nov 26, 2019
@alex3305 alex3305 force-pushed the alex3305:nzbget-pp-job-count branch from 8e07e39 to 5e88c3f Nov 26, 2019
@alex3305

This comment has been minimized.

Copy link
Contributor Author

alex3305 commented Nov 26, 2019

Sorry about the CIA error. This should be solved in my latest commit.

Dev automation moved this from Needs review to Reviewer approved Nov 26, 2019
@balloob

This comment has been minimized.

Copy link
Member

balloob commented Nov 26, 2019

Awesome, looks great. Great first contribution! Welcome to the Home Assistant community 🐬 ⭐️

@balloob balloob merged commit fe626f5 into home-assistant:dev Nov 26, 2019
9 of 10 checks passed
9 of 10 checks passed
CI in progress
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview CheckFormat) Overview CheckFormat succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
CI (Tests PyTest Python36) Tests PyTest Python36 succeeded
Details
CI (Tests PyTest Python37) Tests PyTest Python37 succeeded
Details
cla-bot Everyone involved has signed the CLA
docs-missing Documentation ok.
Dev automation moved this from Reviewer approved to Done Nov 26, 2019
@lock lock bot locked and limited conversation to collaborators Nov 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
5 participants
You can’t perform that action at this time.