* Change config entry state to an enum
* Allow but deprecate EntryState str equality comparison
* Test fixes
* Rename to ConfigEntryState
* Remove str comparability backcompat
* Update new occurrences of strs cropped up during review
* Move Plex->Sonos playback service from integration to platform
* Test against 'native' Plex media_players
* Add Plex to Sonos after_dependencies
* Remove circular dependency
* Raise exceptions in failed service calls
* Add test to forward service call from Sonos
* Additional Sonos->Plex tests
* Fix docstring
* Allow Cast to play Plex media
* Add Plex to after_dependencies, add missing constant
* Extract function from Sonos service to allow media lookups
* Move to non-async method
* Check if media_id exists
* Add test to make codecov happy
* Add Plex service to refresh a library
* Clean up rebase leftovers
* Re-run black
* Fix docstring
Co-authored-by: Charles Garwood <cgarwood@newdealmultimedia.com>
Co-authored-by: Charles Garwood <cgarwood@newdealmultimedia.com>
* Remove unnecessary exception re-wraps
* Preserve exception chains on re-raise
We slap "from cause" to almost all possible cases here. In some cases it
could conceivably be better to do "from None" if we really want to hide
the cause. However those should be in the minority, and "from cause"
should be an improvement over the corresponding raise without a "from"
in all cases anyway.
The only case where we raise from None here is in plex, where the
exception for an original invalid SSL cert is not the root cause for
failure to validate a newly fetched one.
Follow local convention on exception variable names if there is a
consistent one, otherwise `err` to match with majority of codebase.
* Fix mistaken re-wrap in homematicip_cloud/hap.py
Missed the difference between HmipConnectionError and
HmipcConnectionError.
* Do not hide original error on plex new cert validation error
Original is not the cause for the new one, but showing old in the
traceback is useful nevertheless.
* 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>
* 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
* 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
* Add config options support
* Actually copy dict
* Move media_player options to PlexServer class
* Handle updated config options
* Move callback out of server
* 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
* 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