Add "Albums" sensor to Lidarr
Proposed change
This change adds a new sensor to the Lidarr integration to display the total numbers of albums tracked by Lidarr
Type of change
- [ ] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New integration (thank you!)
- [x] New feature (which adds functionality to an existing integration)
- [ ] Deprecation (breaking change to happen in the future)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests
Additional information
- This PR fixes or closes issue: fixes #
- This PR is related to issue:
- Link to documentation pull request:
Checklist
- [x] The code change is tested and works locally.
- [x] Local tests pass. Your PR cannot be merged unless tests pass
- [x] There is no commented out code in this PR.
- [x] I have followed the development checklist
- [x] I have followed the perfect PR recommendations
- [x] The code has been formatted using Ruff (
ruff format homeassistant tests) - [x] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated for www.home-assistant.io
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 runningpython3 -m script.gen_requirements_all. - [ ] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
To help with the load of incoming pull requests:
- [ ] I have reviewed two other open pull requests in this repository.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks :+1:
Hey there @tkdrob, mind taking a look at this pull request as it has been labeled with an integration (lidarr) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of lidarr can trigger bot actions by commenting:
-
@home-assistant closeCloses the pull request. -
@home-assistant rename Awesome new titleRenames the pull request. -
@home-assistant reopenReopen the pull request. -
@home-assistant unassign lidarrRemoves the current integration label and assignees on the pull request, add the integration domain after the command. -
@home-assistant add-label needs-more-informationAdd a label (needs-more-information, problem in dependency, problem in custom component) to the pull request. -
@home-assistant remove-label needs-more-informationRemove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.
Hey there. Thanks for the contribution. Personally, I do not use this sensor for the other integrations. It did feel like it was just there for legacy reasons long before we had the calendar platform. Is there a reason to have this besides the fact that it just exists for the others?
Hi @tkdrob I have a widget showing me the Movies and Series totals from Radarr and Sonarr, and wanted to add Lidarr to the list to have them all summarised in one place. For me it's a nice-to-have, especially since the other app I use for my *arrs (nzb360) doesn't provide this as a total, only offering the number of artists.
After this I intended to add more of the API endpoints as the Lidarr integration is behind Radarr and Sonarr, but wouldn't do this if you don't think it is useful. As the sensors are disabled by default, I don't believe it causes any harm
What else would you like to add? The movies count just didn't matter to me because I already had too many so I stopped caring 🙃. That is why Radarr runs the movies count in the background because it can halt startup. How many albums do you have? Unfortunately, everything is polled once during startup even if the entities are disabled.
Seeing the higher number is what had me wanting it more ;) Only 65 albums so far, but I've not been using Lidarr very long. I wasn't aware of the start-up polling, does the request time grow that significantly as the amount of content increases? The other things I was looking to add would be number of tracks, and also number of artists for completeness. Since I wouldn't personally be using these, I don't think I would add them anymore due to the start-up impact. Especially on that tracks endpoint, since it would be quite large.