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 Plex library count sensors #48339

Merged
merged 7 commits into from
Mar 31, 2021

Conversation

jjlawren
Copy link
Contributor

@jjlawren jjlawren commented Mar 25, 2021

Proposed change

Adds a new sensor for each Plex library showing the total number of items it contains. Also shows count attributes for special cases, such as shows & seasons for TV and artist & albums for music.

Associates all sensors with the existing Plex server device and gives that device a more appropriate name.

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

Additional information

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:

The integration reached or maintains the following Integration Quality Scale:

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

To help with the load of incoming pull requests:

Copy link
Member

@bdraco bdraco left a comment

Choose a reason for hiding this comment

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

LGTM. Two small comments above

@frenck frenck merged commit d62297a into home-assistant:dev Mar 31, 2021
try:
await self.hass.async_add_executor_job(self._update_state_and_attrs)
except NotFound:
self._state = STATE_UNAVAILABLE
Copy link
Member

@MartinHjelmare MartinHjelmare Mar 31, 2021

Choose a reason for hiding this comment

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

We don't set unavailable state directly. We modify the return value of the available property.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, I'll fix. 👍

@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2021
@jjlawren jjlawren deleted the plex_add_library_sensors branch May 31, 2022 17:49
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.

6 participants