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

Plex sensor #2210

Merged
merged 1 commit into from
Jun 15, 2016
Merged

Plex sensor #2210

merged 1 commit into from
Jun 15, 2016

Conversation

nkgilley
Copy link
Contributor

@nkgilley nkgilley commented Jun 2, 2016

Description:
Initial support for plex sensor to see who is watching what.

This pull request acts like a basic version of PlexPy. It will create a sensor that shows the # of currently watching users as the state. If you click the sensor for more detail it will show you who is watching what.

image

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

Example entry for configuration.yaml (if applicable):

sensor:
  platform: plex
  host: 192.168.1.100

Checklist:

If user exposed functionality or configuration variables are added/changed:

If code communicates with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

@nkgilley
Copy link
Contributor Author

nkgilley commented Jun 2, 2016

I figured out how to rebase! woo me 😄

@rmkraus
Copy link
Contributor

rmkraus commented Jun 2, 2016

Could you please use the plexapi library instead of adding a new dependency for this feature?

from datetime import timedelta
import voluptuous as vol

from homeassistant.const import CONF_NAME, CONF_PLATFORM, CONF_USERNAME
Copy link
Contributor

Choose a reason for hiding this comment

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

from homeassistant.const import (CONF_NAME, CONF_PLATFORM, CONF_USERNAME, 
    CONF_PASSWORD, CONF_HOST, CONF_PORT)

@nkgilley
Copy link
Contributor Author

nkgilley commented Jun 2, 2016

I tried to get the plexapi working but I could not ever get it to find my Plex server on my LAN, even if I give it the IP and the auth token. I could use it to login to MyPlex and go that route, but then you have to provide your server name which is pretty lame. If somebody can show me how to get an auth token and get this information with plexapi I'm all ears.

@bengan
Copy link

bengan commented Jun 3, 2016

Is it something like this you need? Finding-your-account-token-X-Plex-Token

@nkgilley nkgilley force-pushed the plex-sensor branch 3 times, most recently from 85cc689 to fbc8cfd Compare June 3, 2016 12:02
@nkgilley
Copy link
Contributor Author

nkgilley commented Jun 3, 2016

I finally got plexapi working and was able to figure out how to do this using it. 😀

@nkgilley nkgilley force-pushed the plex-sensor branch 2 times, most recently from bca5412 to 5e055c8 Compare June 3, 2016 16:02
add option to name in config

fix const import

use plexapi

add myplex support for remote access

use first server if server not specified

use list comprehension

use dictionary comprehension
@rmkraus
Copy link
Contributor

rmkraus commented Jun 4, 2016

Looks really good to me, I just had one last comment about validating the configuration. retracted, I missed that you had defined a schema.

@balloob
Copy link
Member

balloob commented Jun 15, 2016

Somehow this PR fell off the radar. Looks nice! 🐬

@Bart274 will be happy as he always wanted this feature ;-)

@balloob balloob merged commit b6fb21e into home-assistant:dev Jun 15, 2016
@Bart274
Copy link
Contributor

Bart274 commented Jun 15, 2016

@balloob indeed, I'm going to use this asap :)

Op 15 jun. 2016 om 08:06 heeft Paulus Schoutsen <[email protected]mailto:[email protected]> het volgende geschreven:

Somehow this PR fell off the radar. Looks nice! ?

@Bart274https://github.com/Bart274 will be happy as he always wanted this feature ;-)

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com//pull/2210#issuecomment-226096428, or mute the threadhttps://github.com/notifications/unsubscribe/ABERpuLc-9iVT0aVC7Mq2DNJamP47wadks5qL5Z2gaJpZM4Is24C.

@nkgilley nkgilley deleted the plex-sensor branch August 11, 2016 18:57
@home-assistant home-assistant locked and limited conversation to collaborators Mar 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants