Skip to content

Conversation

@Lord-Grey
Copy link
Collaborator

@Lord-Grey Lord-Grey commented Apr 28, 2024

Summary

Breaking

  • Align JSON subscription update elements. ledcolors-imagestream-update, ledcolors-ledstream-update, logmsg-update now return data via data and not result

Added

  • New subscription support for event updates, i.e. Suspend, Resume, Idle, idleResume, Restart, Quit.
  • Support direct or multiple instance addressing via single requests (API: Better intance control handling #809)
  • Support of serverinfo subcommands: getInfo, subscribe, unsubscribe, getSubscriptions, getSubscriptionCommands
  • Overview of API commands and subscription updates

Changed

  • Refactored JSON-API to ensure consistent authorization behaviour across sessions and single requests with token authorization.
  • Provide additional error details with API responses, esp. on JSON parsing, validation or token errors.
  • Generate random TANs for every API request from the Hyperion UI
  • Fixed: Handling of IP4 addresses wrapped in IPv6 for external network connections-

Removed

  • Removed ability to enable/disable local admin authorization. All admin commands require authorization, i.e. authorize-adminRequired will always be true.
  • Removed session-updates subscription
  • serverinfo/subscribe element will be deprecated and replaced by corresponding subcommand

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Other, please describe:

If changing the UI of web configuration, please provide the before/after screenshot:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing setups:

Clients using the JSON API need to process the data and not resultelement on ledcolors-imagestream-update, ledcolors-ledstream-update.

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's body (e.g. Fixes: #xxx[,#xxx], where "xxx" is the issue number)

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature
  • Related documents have been updated (docs/docs/en)
  • Related tests have been updated

PLEASE DON'T FORGET TO ADD YOUR CHANGES TO CHANGELOG.MD

  • Yes, CHANGELOG.md is also updated

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

Other information:
fixes #809

@Lord-Grey
Copy link
Collaborator Author

Hi @dermotduffy this PR should address some shortcomings you identified before.
It would be great, if you could have a look, if it still works or additional areas for improvement are there.
Note: Event updates, e.g. Suspend, Resume, Quit can now be subscribed to. That might be beneficial for the Kodi add-on to get aware when Hyperion stops.

For easy PR testing see here

@dermotduffy
Copy link
Contributor

@Lord-Grey I assume you are referring to issues like this, where Hyperion goes unavailable but Home Assistant doesn't notice. A PR as described here might help, at least in cases of a "clean shutdown". I think we'll still have the broken state when the plug is pulled on Hyperion (i.e. when Hyperion cannot call the callback):

home-assistant/core#98674 (comment)

On that issue, @ToniCipriani was interested in working on it and might like to test with this. A simple way to improve the situation, after this PR is submitting, would be to subscribe to the new events and have the HA integration mark the entities as unavailable when the callback happens.

@Lord-Grey Lord-Grey merged commit cf287f5 into hyperion-project:master May 8, 2024
@Lord-Grey Lord-Grey deleted the API_Auth branch May 20, 2024 13:35
discordianfish added a commit to discordianfish/hyperion.ng that referenced this pull request Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

API: Better intance control handling

3 participants