Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fire issue events on HA's bus #3837

Merged
merged 3 commits into from Sep 2, 2022
Merged

Fire issue events on HA's bus #3837

merged 3 commits into from Sep 2, 2022

Conversation

mdegat01
Copy link
Contributor

@mdegat01 mdegat01 commented Sep 1, 2022

Proposed change

Follow up to #3818 - the events need to be on HA's bus, not supervisor's. HA isn't listening to supervisor's event bus, supervisor fires events of type supervisor/event when HA needs to know about it.

Type of change

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

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to cli pull request:

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 supervisor tests)
  • Tests have been added to verify that the new code works.

If API endpoints of add-on configuration are added/changed:

@mdegat01 mdegat01 added the bugfix A bug fix label Sep 1, 2022
except HomeAssistantWSNotSupported:
pass
except HomeAssistantWSError as err:
_LOGGER.error(err)
Copy link
Member

Choose a reason for hiding this comment

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

Let's add a message for humans and not only an err

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pvizeli Changed both places (async_supervisor_event and async_supervisor_update_event) to this:

_LOGGER.error("Could not send message to Home Assistant due to %s", err)

Sound good?

Copy link
Member

Choose a reason for hiding this comment

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

There is no need for exception handling in both those, one of them should call the other

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right that's true. I'll adjust it in a follow-up

@pvizeli pvizeli merged commit 1f28e6a into main Sep 2, 2022
@pvizeli pvizeli deleted the issues-events-ha-bus branch September 2, 2022 15:40
@github-actions github-actions bot locked and limited conversation to collaborators Sep 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants