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 Tautulli sensor platform #17835

Merged
merged 10 commits into from Nov 3, 2018

Conversation

@ludeeus
Member

ludeeus commented Oct 26, 2018

Description:

This PR adds a Tautulli sensor platform to display statistics from a Tautulli server.

Related issue (if applicable): fixes #

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

Example entry for configuration.yaml (if applicable):

sensor:
  - platform: tautulli
    api_key: 24b6eac0a858748664878d146bf63623b4
    host: 192.168.1.14

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

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

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@ludeeus ludeeus referenced this pull request Oct 27, 2018

Merged

Adds documentation for the new Tautulli sensor. #7151

2 of 2 tasks complete

@ludeeus ludeeus changed the title from WIP: Adds Tautulli as a sensor platform. to Adds Tautulli as a sensor platform. Oct 27, 2018

Show resolved Hide resolved homeassistant/components/sensor/tautulli.py Outdated
Show resolved Hide resolved homeassistant/components/sensor/tautulli.py Outdated
Show resolved Hide resolved homeassistant/components/sensor/tautulli.py Outdated
Show resolved Hide resolved homeassistant/components/sensor/tautulli.py Outdated
Show resolved Hide resolved homeassistant/components/sensor/tautulli.py Outdated
Show resolved Hide resolved homeassistant/components/sensor/tautulli.py Outdated
Show resolved Hide resolved homeassistant/components/sensor/tautulli.py Outdated
Show resolved Hide resolved homeassistant/components/sensor/tautulli.py Outdated
Show resolved Hide resolved homeassistant/components/sensor/tautulli.py Outdated
Show resolved Hide resolved homeassistant/components/sensor/tautulli.py Outdated

@ludeeus ludeeus changed the title from Adds Tautulli as a sensor platform. to WIP: Adds Tautulli as a sensor platform. Oct 28, 2018

@ludeeus

This comment has been minimized.

Member

ludeeus commented Oct 28, 2018

Thanks for the input @fabaff

@digiblur

This comment has been minimized.

Contributor

digiblur commented Oct 29, 2018

Cool to see this being folded in! Great job! Curious if we would be able to added two Tautulli different IP monitoring sessions with this?

@ludeeus

This comment has been minimized.

Member

ludeeus commented Oct 29, 2018

@digiblur when if this gets accepted you can add multiple sensors like most other entities in Home Assistant:

sensor:
  - platform: tautulli
    host: 192.168.1.11
    ...
  - platform: tautulli
    host: 192.168.1.12
    ...

@ludeeus ludeeus changed the title from WIP: Adds Tautulli as a sensor platform. to Adds Tautulli as a sensor platform. Oct 31, 2018

@ludeeus

This comment has been minimized.

Member

ludeeus commented Oct 31, 2018

@fabaff I think I have now changed all requested parts.
Like you said I had to rewrite the library it uses 👍

ludeeus added some commits Oct 31, 2018

Show resolved Hide resolved homeassistant/components/sensor/tautulli.py Outdated
Show resolved Hide resolved homeassistant/components/sensor/tautulli.py Outdated
Show resolved Hide resolved homeassistant/components/sensor/tautulli.py Outdated
Show resolved Hide resolved homeassistant/components/sensor/tautulli.py Outdated
Show resolved Hide resolved homeassistant/components/sensor/tautulli.py Outdated
Show resolved Hide resolved homeassistant/components/sensor/tautulli.py

@MartinHjelmare MartinHjelmare changed the title from Adds Tautulli as a sensor platform. to Add Tautulli sensor platform Oct 31, 2018

ludeeus added some commits Nov 1, 2018

Correcte check_connection, removed wierd defaults, added line in impo…
…rts, removed unused var, use the correct user list.
@MartinHjelmare

Looks good!

@MartinHjelmare

This comment has been minimized.

Member

MartinHjelmare commented Nov 1, 2018

Can be merged when build passes.

@fabaff

fabaff approved these changes Nov 2, 2018

@fabaff fabaff merged commit 610b0b6 into home-assistant:dev Nov 3, 2018

4 of 5 checks passed

coverage/coveralls Coverage decreased (-0.2%) to 93.061%
Details
Hound No violations found. Woof!
WIP ready for review
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@wafflebot wafflebot bot removed the in progress label Nov 3, 2018

@ludeeus ludeeus deleted the ludeeus:tautulli branch Nov 3, 2018

@balloob balloob referenced this pull request Nov 29, 2018

Merged

0.83 #18776

@riker09

This comment has been minimized.

riker09 commented Nov 29, 2018

Sorry, but:

tautulli: Error on device update!
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 248, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 347, in async_device_update
    await self.async_update()
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/tautulli.py", line 93, in async_update
    self._attributes['Top Movie'] = self.home[0]['rows'][0]['title']
IndexError: list index out of range
@MartinHjelmare

This comment has been minimized.

Member

MartinHjelmare commented Nov 29, 2018

Please open an issue if you suspect a bug. If you need help please use our help channels:
https://home-assistant.io/help/#communication-channels

Merged PRs should not be used for support or bug reports. Thanks!

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Nov 29, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.