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

Send an event when a notification is dismissed #1012

Merged

Conversation

dshokouhi
Copy link
Member

@dshokouhi dshokouhi commented Oct 6, 2020

Fixes: #418

When a notification is dismissed we will send mobile_app_notification_dismissed event along with the message as part of the event data.

Example data:

{
    "event_type": "mobile_app_notification_dismissed",
    "data": {
        "message": "test",
        "device_id": "DEVICE_ID"
    },
    "origin": "REMOTE",
    "time_fired": "2020-10-06T05:36:12.864583+00:00",
    "context": {
        "id": "ID",
        "parent_id": null,
        "user_id": "USER_ID"
    }
}

Docs: home-assistant/companion.home-assistant#352

Comment on lines 45 to 47
val data = mutableMapOf(
"message" to message
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should probably be consistent with what we send into the events. We normally send the whole data object we receive with the notification not just the message.

Copy link
Member Author

Choose a reason for hiding this comment

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

I had to do some conversion in order to pass data properly, but now we get everything :)

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.

Send an event when notification dismissed
3 participants