Skip to content

Accept new Plex websocket callback payloads#40773

Merged
balloob merged 3 commits intohome-assistant:devfrom
jjlawren:plex_websocket_callbacks_and_reload
Oct 1, 2020
Merged

Accept new Plex websocket callback payloads#40773
balloob merged 3 commits intohome-assistant:devfrom
jjlawren:plex_websocket_callbacks_and_reload

Conversation

@jjlawren
Copy link
Copy Markdown
Contributor

Proposed change

Relies on changes in library: jjlawren/python-plexwebsocket@v0.0.11...v0.0.12

Accepts new payloads in callbacks provided by websocket library. Allows to differentiate between connection status changes, receive the actual payload data, and know which errors may have occurred.

If an error occurs in the websocket connection the integration will reload itself and rely on the standard config flow setup fallback mechanism. Transient errors are still handled in the library, so this should be a rare event.

To go along with this reload, the logging is reduced on initial connection failures as the core logging is sufficient.

Hopefully addresses setups with not-always-up Plex servers: #39979.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

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

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

Reload integration on errors
Reduce logging on errors during setup
Comment thread homeassistant/components/plex/__init__.py Outdated
Comment thread homeassistant/components/plex/__init__.py
Copy link
Copy Markdown
Member

@Kane610 Kane610 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@balloob balloob merged commit be9ff3b into home-assistant:dev Oct 1, 2020
Comment thread homeassistant/components/plex/__init__.py
Comment thread homeassistant/components/plex/__init__.py
@jjlawren jjlawren deleted the plex_websocket_callbacks_and_reload branch October 1, 2020 16:48
@balloob balloob added this to the 0.116.0 milestone Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plex doest respond well to server being offline...

5 participants