Commit Graph

29 Commits (49478298ccfdc2dbaed74a19775cb790e49cf4b0)

Author SHA1 Message Date
jjlawren 67312e2d42
Fix lookup by Plex media key when playing on Sonos (#38119) 2020-08-03 12:40:48 +02:00
jjlawren a7dfa60208
Fix Sonos speaker lookup for Plex (#37942) 2020-07-17 18:18:53 -07:00
jjlawren fe5bf96e5d
Catch additional exception for Plex account login failures (#37143) 2020-06-26 10:30:44 -07:00
jjlawren fd1a8dd96c
Fix Plex when using local tokenless authentication (#37096) 2020-06-25 17:10:40 -07:00
jjlawren d4d233536f
Fix missing options in Plex config entry (#36683) 2020-06-11 15:45:00 -07:00
jjlawren 9aac8482d5
Remove deprecated Plex YAML config (#36388) 2020-06-03 09:20:21 -07:00
jjlawren 4e74fae615
Playback on Sonos speakers from Plex integration (#36177)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-05-27 15:36:08 -07:00
jjlawren 116012680a
Add All wrapper to deprecated Plex schema (#34552) 2020-04-22 14:20:14 -07:00
jjlawren fc8d41d024
Deprecate Plex YAML config (#34546) 2020-04-22 10:41:26 -07:00
springstan 8198970af9
Clean up ssl usage (#33960)
* Clean up ssl usage

* Revert config[CONF_SSL] from sonarr, radarr and mfi
2020-04-10 22:01:57 +02:00
jjlawren 6dfffb23c4
Fix Plex debounce wrapper (#33730)
* Fix debounce wrapper by converting to async

* Review suggestions
2020-04-06 09:57:51 -07:00
jjlawren 312af53935
Handle Plex certificate updates (#33230)
* Handle Plex certificate updates

* Use exception in place

* Add test
2020-03-28 21:02:29 -07:00
Paulus Schoutsen 1615a5ee81
Use unique_id in Plex config entries (#32489) 2020-03-04 21:42:48 -08:00
Paulus Schoutsen dd7d8d4792
Remove 'show all controls' option for Plex (#32391) 2020-03-04 14:42:50 -08:00
jjlawren 9cc47ca737
Add ConfigEntryNotReady exception to Plex (#32071) 2020-02-21 22:07:26 +01: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
Bas Nijholt e6eed4755f Sort imports according to PEP8 for plex (#29708) 2019-12-08 23:31:55 +01: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
jjlawren a62bd97fa5 Delay Plex websocket connection to avoid race (#28934) 2019-11-21 12:39:24 -08:00
jjlawren 2bdfa9928b Allow to skip SSL validation on Plex websocket (#28615) 2019-11-07 21:54:48 +01: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
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
jjlawren 30245f6874 Fix error on failed Plex setup (#27132) 2019-10-02 15:51:18 -07: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
jjlawren f82f30dc62 Unload Plex config entries (#26771)
* Unload config entries

* Await coroutines

* Unnecessary ensure
2019-09-22 23:47:41 +02: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
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