-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
Add device triggers to the Monzo integration #119214
base: dev
Are you sure you want to change the base?
Add device triggers to the Monzo integration #119214
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a merge conflict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code looks familiar :P
Instead of using device triggers, have you considered using event entities?
98007fa
to
53902cf
Compare
I've extracted the dependency bump and the change to config_entries into their own PRs to go in first: |
Yep, thanks for setting great examples :D Yeah, but although I like the everything-is-an-entity model on the backend, I think device triggers are much more intuitive for users on the frontend, at least for now. |
0546d02
to
a0ad89b
Compare
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
ebc20d6
to
0ca22ef
Compare
@JakeMartin-ICL To make this PR move, address the review comments, and don't forget to click the "Ready for review" button when you want the PR to be reviewed again. If you don't agree or understand some comment, reply to it. |
0ca22ef
to
369a87e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The added webhook management is lacking in test coverage, can that be improved?
Also, please add translations in monzo/strings.json
for the device trigger
Please consider the new review comments, and don't forget to click the "Ready for review" button once you've addressed them. |
Proposed change
This adds device triggers to the Monzo integration, allowing triggering automations when a transaction is made on an account.
To achieve this, webhooks are registered during setup with the Monzo API for each account, which fires an event, which triggers the device trigger. The webhooks are tidied up on integration removal and at each start and teardown we clear all webhooks from the Monzo API matching the host associated with this instance.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: