Commit Graph

62 Commits (406cbcfe2dc6adc31ef47408111f37009fecef2f)

Author SHA1 Message Date
Marc Mueller 4c68662612
Use assignment expressions 34 (#58823) 2021-10-31 19:01:16 +01:00
jjlawren 0600a21e02
Allow advanced Plex `play_media` search options (#56226) 2021-10-24 11:22:16 -10:00
epenet 176ed4f7ba
Use DeviceInfo on components with via_device (I-T) (#58212)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-10-22 12:31:12 +02:00
Marc Mueller 0815eede4b
Replace lists with tuples (2) (#53685) 2021-07-30 01:20:03 +02:00
Marc Mueller f6b162bc39
Add pylint CodeStyle extension (#53147) 2021-07-19 06:57:06 -07:00
jjlawren 2970931d8d
Use entity class attributes for Plex (#52617) 2021-07-12 23:01:58 +02:00
jjlawren e929774481
Add warning during playback if Plex token missing (#51853) 2021-06-14 20:09:27 +02:00
jjlawren be71d626c8
Improve Plex device handling (#48369) 2021-03-31 09:37:16 -07:00
Erik Montnemery 14ff6d4d1f
Update integrations p-s to override extra_state_attributes() (#47759) 2021-03-11 21:23:20 +01:00
jjlawren d7e0391e03
Allow Plex playback using provided playqueue ID (#45580) 2021-01-28 17:21:31 +01:00
jjlawren d3d66c2e27
Fix Plex media summary attribute (#44863) 2021-01-06 14:12:19 +01:00
jjlawren f2f935506e
Use Plex websocket payloads to reduce overhead (#42332)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-12-02 19:00:13 +01:00
jjlawren 7c0e148b59
Proxy Plex media browser images (#43111)
Co-authored-by: rajlaud <50647620+rajlaud@users.noreply.github.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-11-27 22:14:19 +01:00
Lasath Fernando 86cf184903
Add seek support to plex media players (#43420)
Turns out plexapi lib already supports this, so we just need to
pass through the command.
2020-11-22 14:05:15 +01:00
springstan 038c05d0ee
Return attribute dict directly without temporary variable (#41206) 2020-10-05 12:51:48 +02:00
jjlawren 6d95ee7a00
Websocket media browsing for Plex (#35590)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-08-24 12:41:01 +02:00
jjlawren e940811a8b
Clean up Plex clip handling (#38500) 2020-08-03 12:41:24 +02:00
jjlawren 9d40ae96b5
Set Plex media_player discovery source as an attribute (#36884) 2020-06-22 14:48:40 +02:00
jjlawren d445c16697
Handle Plex Live TV sessions (#36919) 2020-06-19 17:12:47 +02:00
jjlawren 59c112a3f2
Decouple media lookup from Plex play_media service (#35663)
* Decouple media lookup from play_media service

* More explicit input/search validation, cleanup, more tests

* Minor cleanup

* Normalize media_type string in lookup call

* Move key lookup, add tests via service calls

* Always allow play_media service calls

* No need to pass arguments to nested functions
2020-05-26 14:39:56 -05:00
Erik Montnemery 62bc02fdda
Rename MediaPlayerDevice to MediaPlayerEntity (#34592) 2020-04-25 18:00:57 +02:00
jjlawren f922128a14
Add Plex play_media logging and troubleshooting tools (#34412) 2020-04-23 12:42:17 -07:00
jjlawren 21e85ba9c5
Bump plexapi to 3.4.0, remove workarounds (#34395) 2020-04-18 21:06:05 -05: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
Franck Nijhof 7653dc947a
Enable pylint unnecessary-pass (#33650)
* Enable pylint unnecessary-pass

* Process review suggestions

* Fix smhi tests
2020-04-05 10:33:07 +02:00
jjlawren d98171ed05
Plex followup to #33542 (#33558) 2020-04-02 21:02:27 -07:00
jjlawren 55870aec31
Temporary Plex play_media workaround (#33542)
* Temporary playMedia() workaround on plexapi 3.3.0

* Use constants for strings

* Style cleanup
2020-04-02 16:47:58 -07:00
jjlawren 44c7743351
Rewrite and add Plex tests (#32633)
* Rewrite and add Plex tests

* Remove unnecessary mocks

* Explicitly import constants for readability
2020-03-11 09:37:02 -07:00
Paulus Schoutsen dd7d8d4792
Remove 'show all controls' option for Plex (#32391) 2020-03-04 14:42:50 -08: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
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
jjlawren 1b2f4fa19f
Improve Plex media_player entity naming (#31755) 2020-02-12 09:55:18 -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
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
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 ef687a36ff
Add Plex debug logging (#28665) 2019-11-09 17:02:56 -06:00
jjlawren 21d48218aa Use server-specific unique_ids for Plex media_players (#28447) 2019-11-01 22:41:26 +01: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
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
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 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