Commit Graph

323 Commits (2502e7669c9fce7b4f1074a79713db968e85151c)

Author SHA1 Message Date
Paulus Schoutsen dd7d8d4792
Remove 'show all controls' option for Plex (#32391) 2020-03-04 14:42:50 -08:00
HomeAssistant Azure fefbe02d44 [ci skip] Translation update 2020-02-28 00:31:47 +00:00
HomeAssistant Azure ed461a0ad8 [ci skip] Translation update 2020-02-26 00:31:47 +00:00
HomeAssistant Azure a9e061270b [ci skip] Translation update 2020-02-25 00:32:13 +00:00
HomeAssistant Azure 8257165562 [ci skip] Translation update 2020-02-23 00:31:50 +00:00
HomeAssistant Azure dc15b9c28e [ci skip] Translation update 2020-02-22 00:31:49 +00:00
jjlawren 9cc47ca737
Add ConfigEntryNotReady exception to Plex (#32071) 2020-02-21 22:07:26 +01:00
HomeAssistant Azure a12c4da0ca [ci skip] Translation update 2020-02-21 00:33:51 +00:00
jjlawren 047111b00f
Fix Plex sensor title handling (#31973)
* Fix Plex sensor title parsing

* Revert episode year for now
2020-02-19 22:33:38 -08:00
HomeAssistant Azure 5839df39b5 [ci skip] Translation update 2020-02-20 00:31:46 +00:00
jjlawren 56c834b8a4
Fix Plex naming and devices for misbehaving clients (#31970) 2020-02-18 19:37:21 -08:00
jjlawren 0213f43f10
Add options to ignore shared/managed Plex clients (#31738)
* Add option to ignore shared/managed Plex clients

* Start to allow user selection

* hass object not ready during init

* Don't bother sorting

* Plex account multi-select, handle new users not matching config

* Fix/add tests

* Lint simplifications

* Review cleanup

* Oops

* Rename options attributes, fix/add tests
2020-02-18 16:46:45 -08:00
HomeAssistant Azure 4b3f9ecc2d [ci skip] Translation update 2020-02-19 00:31:49 +00:00
HomeAssistant Azure 2e5161997f [ci skip] Translation update 2020-02-18 00:31:41 +00:00
HomeAssistant Azure 84e4ef510e [ci skip] Translation update 2020-02-17 00:31:56 +00:00
jjlawren 408b41ea02
Add device registry support for Plex (#31797)
* Add device registry support for Plex

* Fix model

* Use Plex server as sensor device identifier
2020-02-13 16:37:52 -08:00
jjlawren eb3097506f
Add summary attribtue for currently playing media (#31803) 2020-02-13 16:34:12 -08:00
HomeAssistant Azure 32bc94bdd6 [ci skip] Translation update 2020-02-14 00:31:49 +00:00
jjlawren 59932545ab
Update Plex connection class to push (#31806) 2020-02-13 16:45:48 -07:00
Franck Nijhof 0173c61fee
Spelling: Config(uration) (#31782) 2020-02-13 08:27:00 -08:00
jjlawren 1b2f4fa19f
Improve Plex media_player entity naming (#31755) 2020-02-12 09:55:18 -08:00
HomeAssistant Azure a2bea2cab8 [ci skip] Translation update 2020-02-09 00:31:39 +00:00
HomeAssistant Azure 5483de7e25 [ci skip] Translation update 2020-02-08 00:31:45 +00:00
HomeAssistant Azure 274cf23269 [ci skip] Translation update 2020-02-07 00:31:50 +00:00
jjlawren 3a3328dc13
Skip updates when Plex client viewing photos (#31556) 2020-02-06 14:26:34 -08:00
Paulus Schoutsen e9e44dbd97
Fix callback and async (#31281)
* Fix callback and async

* Fix a return

* Fix test

* Fix mqtt tests

* Fix some more callbacks
2020-01-29 13:59:45 -08:00
HomeAssistant Azure 0534153ae7 [ci skip] Translation update 2020-01-13 00:31:54 +00:00
Franck Nijhof dc02c28891 Correct names in manifests (M-P) (#30541) 2020-01-07 13:28:35 +01:00
Franck Nijhof a84741392b
Format all manifests with prettier (#30521) 2020-01-06 21:28:23 +01:00
HomeAssistant Azure d1ed67f44a [ci skip] Translation update 2020-01-06 00:32:11 +00:00
Ville Skyttä fa4fa30461 Various string cleanups (#30435)
* Remove some unnecessary string concatenations

* Replace some simple str.formats with f-strings

* Replace some string concatenations with f-strings
2020-01-03 14:47:06 +01:00
HomeAssistant Azure 13116d8d3f [ci skip] Translation update 2019-12-30 00:32:19 +00:00
HomeAssistant Azure 5d8dda4f68 [ci skip] Translation update 2019-12-29 00:32:14 +00:00
HomeAssistant Azure bb35d93fde [ci skip] Translation update 2019-12-25 00:32:06 +00:00
Quentame e3a3964911 Add icon to Plex sensor (#30172) 2019-12-23 09:25:57 -07:00
HomeAssistant Azure 12f273eb11 [ci skip] Translation update 2019-12-10 00:32:16 +00:00
Bas Nijholt e6eed4755f Sort imports according to PEP8 for plex (#29708) 2019-12-08 23:31:55 +01:00
HomeAssistant Azure b4c95421d3 [ci skip] Translation update 2019-12-07 00:32:13 +00:00
HomeAssistant Azure a1a131334a [ci skip] Translation update 2019-12-04 00:32:11 +00:00
HomeAssistant Azure d5ee34e504 [ci skip] Translation update 2019-12-03 00:32:23 +00:00
HomeAssistant Azure 19241f421b [ci skip] Translation update 2019-12-02 00:32:37 +00:00
jjlawren 6a02c6540e Stop Plex config flow imports where more user input needed (#29241)
* Abort imports that require user interaction, update logs and tests

* Disable lint
2019-11-30 22:07:12 -08:00
jjlawren 9c9e9bc92a Bump plexwebsocket to 0.0.6 (#29175) 2019-11-27 22:40:08 -08:00
jjlawren 88441d5f68 Reduce connection timeout to avoid config flow timeouts (#29172) 2019-11-27 14:14:01 -08:00
Ville Skyttä 99c7608fb4 Lint config cleanups (#28864)
* Remove bunch of unneeded lint exclusions

* Use symbolic names instead of identifiers in pylint disables

* Tighten scope of some pylint disables
2019-11-25 22:40:08 -08:00
jjlawren 2c00a9ec68
Fix Plex setup race condition v2 (#28943)
* Connect websocket when platforms ready, not when HA is ready

* Use callbacks from platform setup tasks instead

* Convert setup to async

* Apply suggestions from code review

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
2019-11-23 09:16:21 -06:00
HomeAssistant Azure 1968a88336 [ci skip] Translation update 2019-11-22 00:32:10 +00:00
jjlawren a62bd97fa5 Delay Plex websocket connection to avoid race (#28934) 2019-11-21 12:39:24 -08:00
jjlawren 5f177fa42e
Use library method for season number (#28708) 2019-11-12 10:05:30 -06:00
jjlawren 87606bc12b Bump plexapi to 3.3.0 (#28709)
* Bump plexapi to 3.2.0

* Bump to 3.3.0
2019-11-11 19:30:07 -08:00
jjlawren cfcacc2827 Bump plexwebsocket to 0.0.5 (#28703) 2019-11-11 19:26:56 +01:00
jjlawren 206547a5d8 Skip updating idle Plex clients (#28664)
* Skip updating idle clients

* Different operators
2019-11-10 11:35:12 +01:00
jjlawren ef687a36ff
Add Plex debug logging (#28665) 2019-11-09 17:02:56 -06:00
jjlawren 2bdfa9928b Allow to skip SSL validation on Plex websocket (#28615) 2019-11-07 21:54:48 +01:00
HomeAssistant Azure 4863face69 [ci skip] Translation update 2019-11-02 00:31:48 +00:00
jjlawren 21d48218aa Use server-specific unique_ids for Plex media_players (#28447) 2019-11-01 22:41:26 +01:00
HomeAssistant Azure e700384cce [ci skip] Translation update 2019-10-30 00:32:11 +00:00
HomeAssistant Azure 0e4331e922 [ci skip] Translation update 2019-10-29 00:32:16 +00:00
jjlawren 31dd69196c Bump library to 0.0.3 (#28294) 2019-10-28 10:39:37 -07:00
jjlawren 43c7b57d1e Update Plex via websockets (#28158)
* Save client identifier from auth for future use

* Use websocket events to update Plex

* Handle websocket disconnections

* Use aiohttp, shut down socket cleanly

* Bad rebase fix

* Don't connect websocket during config_flow validation, fix tests

* Move websocket handling to external library

* Close websocket session on HA stop

* Use external library, revert unnecessary test change

* Async & lint fixes

* Clean up websocket stopper on entry unload

* Setup websocket in component, pass actual needed object to library
2019-10-25 18:37:50 +02:00
HomeAssistant Azure 95295791bd [ci skip] Translation update 2019-10-25 00:32:15 +00:00
jjlawren a644182b5e Save client identifier from Plex auth for future use (#27951)
* Save client identifier from auth for future use

* Bump requirements

* Stick with version 1
2019-10-22 23:32:57 -07:00
HomeAssistant Azure 2cc039dbc4 [ci skip] Translation update 2019-10-22 00:32:10 +00:00
jjlawren d1fcc5762b Make dispatch signals unique per server (#28029) 2019-10-21 10:44:07 +02:00
jjlawren eeb1bfc6f5 Central update for Plex platforms (#27764)
* Update Plex platforms together

* Remove unnecessary methods

* Overhaul of Plex update logic

* Apply suggestions from code review

Use set instead of list

Co-Authored-By: Martin Hjelmare <marhje52@kth.se>

* Review suggestions and cleanup

* Fixes, remove sensor throttle

* Guarantee entity name, use common scheme

* Keep name stable once set
2019-10-19 23:31:15 +02:00
HomeAssistant Azure 9e8c391c81 [ci skip] Translation update 2019-10-19 00:32:15 +00:00
jjlawren 0888098718 Use URI provided by Plex for local connections (#27515)
* Use provided URI for local connections

* Use provided plexapi connection method

* Remove unused mock from tests

* Handle potential edge case(s)
2019-10-17 17:31:53 -07:00
HomeAssistant Azure b8e00925e7 [ci skip] Translation update 2019-10-16 00:32:17 +00:00
HomeAssistant Azure d8e3255603 [ci skip] Translation update 2019-10-15 00:31:44 +00:00
HomeAssistant Azure b37f0ad812 [ci skip] Translation update 2019-10-14 00:32:27 +00:00
HomeAssistant Azure 78a08d0425 [ci skip] Translation update 2019-10-12 00:31:47 +00:00
HomeAssistant Azure 4c71c6df6f [ci skip] Translation update 2019-10-11 00:31:40 +00:00
HomeAssistant Azure 762a714d87 [ci skip] Translation update 2019-10-10 00:31:40 +00:00
HomeAssistant Azure 768bb00177 [ci skip] Translation update 2019-10-09 00:32:17 +00:00
jjlawren df8bf51598 Fix single Plex server case (#27326) 2019-10-08 08:54:01 -07:00
HomeAssistant Azure 1087abd3b5 [ci skip] Translation update 2019-10-08 00:32:12 +00:00
jjlawren a3c98440e0 Remove manual config flow step (#27291) 2019-10-07 11:29:12 -07:00
jjlawren 0915d927df Fix Plex media_player.play_media service (#27278)
* First attempt to fix play_media

* More changes to media playback

* Use playqueues, clean up play_media

* Use similar function name, add docstring
2019-10-06 21:02:58 -07:00
HomeAssistant Azure 073bdd672a [ci skip] Translation update 2019-10-07 00:32:19 +00:00
HomeAssistant Azure 2c6a869bc6 [ci skip] Translation update 2019-10-06 00:32:15 +00:00
HomeAssistant Azure 7e7868f0a6 [ci skip] Translation update 2019-10-05 00:32:19 +00:00
HomeAssistant Azure 85947591c5 [ci skip] Translation update 2019-10-04 00:32:16 +00:00
HomeAssistant Azure e005f6f23a [ci skip] Translation update 2019-10-03 00:34:28 +00:00
jjlawren 30245f6874 Fix error on failed Plex setup (#27132) 2019-10-02 15:51:18 -07:00
Franck Nijhof c7da781efc Update documentation link URL for integrations in all manifests (#27114) 2019-10-02 09:25:44 -07:00
HomeAssistant Azure 2090d650c6 [ci skip] Translation update 2019-10-02 00:32:11 +00:00
jjlawren e033c46c91 Add missing http dependency (#27097) 2019-10-01 14:26:33 -07:00
jjlawren 571ab5a978 Plex external config flow (#26936)
* Plex external auth config flow

* Update requirements_all

* Test dependency

* Bad await, delay variable

* Use hass aiohttp session, bump plexauth

* Bump requirements

* Bump library version again

* Use callback view instead of polling

* Update tests for callback view

* Reduce timeout with callback

* Review feedback

* F-string

* Wrap sync call

* Unused

* Revert unnecessary async wrap
2019-10-01 17:20:30 +02:00
HomeAssistant Azure 513d2652e4 [ci skip] Translation update 2019-10-01 00:32:19 +00:00
HomeAssistant Azure cdb469f711 [ci skip] Translation update 2019-09-30 00:32:17 +00:00
HomeAssistant Azure 560ac3df3a [ci skip] Translation update 2019-09-29 00:32:13 +00:00
HomeAssistant Azure 2af34b461a [ci skip] Translation update 2019-09-28 00:32:10 +00:00
HomeAssistant Azure b04a70995e [ci skip] Translation update 2019-09-27 00:32:12 +00:00
jjlawren 9b204ad162 Add Plex config options support (#26870)
* Add config options support

* Actually copy dict

* Move media_player options to PlexServer class

* Handle updated config options

* Move callback out of server
2019-09-26 11:10:20 +02:00
HomeAssistant Azure ba92d781b4 [ci skip] Translation update 2019-09-26 00:32:13 +00:00
HomeAssistant Azure 24c8db0121 [ci skip] Translation update 2019-09-25 00:32:16 +00:00
HomeAssistant Azure 5d49d9c951 [ci skip] Translation update 2019-09-24 00:32:13 +00:00
HomeAssistant Azure d162e39ec9 [ci skip] Translation update 2019-09-23 00:32:13 +00:00
jjlawren 5914475fe5 Add manual step to Plex config flow (#26773)
* Add manual config step

* Pass token to manual step

* Fix for no token

* Show error

* Specify key location

* Cast discovery port to int
2019-09-23 00:23:14 +02:00
jjlawren f82f30dc62 Unload Plex config entries (#26771)
* Unload config entries

* Await coroutines

* Unnecessary ensure
2019-09-22 23:47:41 +02:00
HomeAssistant Azure 24cbae6ec3 [ci skip] Translation update 2019-09-21 00:32:16 +00:00
HomeAssistant Azure 20e61fb41b [ci skip] Translation update 2019-09-20 00:32:11 +00:00
jjlawren 2d12bac0e2 Add Plex config flow support (#26548)
* Add config flow support

* Log error on failed connection

* Review comments

* Unused errors

* Move form to step

* Use instance var instead of passing argument

* Only share servers created by component

* Return errors early to avoid try:else

* Separate debug for validation vs setup

* Unnecessary

* Unnecessary checks

* Combine import flows, move logic to component

* Use config entry discovery handler

* Temporary lint fix

* Filter out servers already configured

* Remove manual config flow

* Skip discovery if a config exists

* Swap conditional to reduce indenting

* Only discover when no configs created or creating

* Un-nest function

* Proper async use

* Move legacy file import to discovery

* Fix, bad else

* Separate validate step

* Unused without manual setup step

* Async oops

* First attempt at tests

* Test cleanup

* Full test coverage for config_flow, enable tests

* Lint

* Fix lint vs black

* Add test init

* Add test package requirement

* Actually run script

* Use 'not None' convention

* Group exceptions by result

* Improve logic, add new error and test

* Test cleanup

* Add more asserts
2019-09-19 23:29:26 +02:00
jjlawren 6eeb01edc4 Remove default host for Plex config (#26583)
* Remove default host, allow config with token(+server)

* Require one of host or token

* Oops

* Adjust schema

* Fix schema

* Add self as codeowner

* Update CODEOWNERS
2019-09-11 20:21:08 +02:00
jjlawren 30fb4ddc98 Move config and connections to Plex component (#26488)
* Move config and connections to component

* Separate imports

* Set a unique_id on sensor

* Set a platforms const

* Add SERVERS dict, hardcode to single server

* Move to debug

* Return false

* More debug

* Import at top to fix lint

* Guard against legacy setup attempts

* Refactor to add setup callback

* Review comments

* Log levels

* Return result of callback

* Store CONFIGURING in hass.data

* Set up discovery if no config data

* Use schema to set defaults

* Remove media_player options to remove entities

* Improve error handling
2019-09-09 23:28:20 +02:00
jjlawren 23fdc04554 Add plex server config options to media_player platform (#26458)
* Add server config options to media_player platform

* Unnecessary else

* Default host

* No need to try for default values

* Use const
2019-09-05 22:20:58 +02:00
jjlawren 2cd845fb25 Standardize Plex server connections (#26444)
* Common connection class

* Omit tests for new Plex files

* Oops

* Add missing properties

* Remove redundant log message

* Stopgap to avoid duplicate setups

* Cleaner check for server setup

Co-Authored-By: Martin Hjelmare <marhje52@kth.se>

* Cleaner check for server setup

Co-Authored-By: Martin Hjelmare <marhje52@kth.se>

* Not needed with previous setup check

* Remove username/password support

* Reduce log level

Co-Authored-By: Martin Hjelmare <marhje52@kth.se>

* Don't do setup in __init__

* Oops

* Committing too fast...

* Connect after init

* Catch update exceptions like media_player

* Pass in validated PlexServer instance

* Remove unnecessary check

* Counter should be unknown on init

* Remove servername config option
2019-09-05 19:50:26 +02:00
Franck Nijhof 1c5e0123c9 Use literal string interpolation in integrations N-Q (f-strings) (#26391) 2019-09-03 11:35:00 -07:00
Antonio Pérez ce0edf8360 Fix configuration field name (#25840) 2019-08-10 15:01:19 -07:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
jjlawren 0ba54ee9b7 Use central polling to update entities (#24059)
* Use central polling to update entities

* Fix for line length

* Remove unnecessary import

* Use interval

* Trigger entity refreshes after commands

* Lint
2019-05-26 21:39:50 -07:00
jjlawren 25505dc1d4 Remove custom entity_id naming (#24072)
* Remove custom entity_id naming

* Set entity_ids with 'plex'

* Set name instead of entity_id

* Lint

* Use a name template
2019-05-26 12:28:29 +02:00
jjlawren 8d22479d24 Always update all Plex client types (#24038) 2019-05-23 14:00:41 +02:00
Richard Mitchell c216ac7260 Fix race condition. (#21244)
If the updater is running at the same time, this can result in this dict changing size during iteration, which Python does not like.
2019-04-24 22:38:10 -07:00
Andrew Sayre e2ed2ecdc0 Return 0 instead of None (#23261) 2019-04-19 16:56:34 -07:00
cgtobi 2c07bfb9e0 Remove dependencies and requirements (#23024)
* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit fe7171b4cd.

* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit 391355ee2c.

* Remove dependencies and requirements

* Fix flake8 complaints

* Fix more flake8 complaints

* Revert non-component removals
2019-04-12 10:13:30 -07:00
Paulus Schoutsen 57f17707c6
Specify configurator as dependency (#23030) 2019-04-11 20:11:56 -07:00
Paulus Schoutsen cfe4cf30ad
Add manifests (#22699)
* Add manifests

* Update auto name

* Update codeowners

* Add requirements from platforms

* Minor cleanup

* Incorporate changes from awarecan PR
2019-04-03 21:14:45 -07:00
Tobias Sauerwein 048b100eea Clean up docstrings (#22679)
* Clean up docstrings

* Fix long lines

* Fix more docstrings

* Fix more docstrings

* Fix more docstrings
2019-04-03 17:40:03 +02:00
Niccolò Maggioni 5ad3e75a4d Support for Plex sensor with enforced SSL (#21432) 2019-03-25 20:45:13 +01:00
jjlawren ce550206a4 Fix progress for Plex media_players (#22224)
* Return current position and last updated timestamp needed by UI

* Add throttling to position updating

* Simplify logic, don't clear position when refreshing

* Use seconds

* Update homeassistant/components/plex/media_player.py

Co-Authored-By: jjlawren <jjlawren@users.noreply.github.com>

* Add throttling to position updating

* Simplify logic, don't clear position when refreshing
2019-03-22 14:00:12 -06:00
jjlawren 30d4a9f12c Plex: Avoid refreshing by both device and session methods (#22266)
* Avoid refreshing by both device and session methods

* Fix indentation
2019-03-21 19:41:41 -07:00
Paulus Schoutsen f5076188ef
Consolidate all platforms that have no tests (#22096)
* Consolidate

* Fix tests

* Update imports

* Fix import

* Use importlib because integration and package share name

* Fix more tests

* Update .coveragerc and CODEOWNERS
2019-03-16 20:44:05 -07:00