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

Add new notification properties to api/v1/notifications endpoint #466

Closed
mueller-ma opened this issue Jun 29, 2024 · 7 comments · Fixed by #467
Closed

Add new notification properties to api/v1/notifications endpoint #466

mueller-ma opened this issue Jun 29, 2024 · 7 comments · Fixed by #467

Comments

@mueller-ma
Copy link
Member

It seems that the new notification properties haven't been added to the endpoint api/v1/notifications. This endpoint is used for the notification list and in the un-googled version of the Android app.
I'm not sure if the actions should be shown in the notification list, but at least the title should be shown there.

@mueller-ma
Copy link
Member Author

@digitaldan

@digitaldan
Copy link
Contributor

Yeah, title for sure would be a good one. I refactored the cloud code to care as little as possible about the notification payload, basically to act as a pass through medium from openHAB to the device, only touching/modifying the data when necessary. Was hoping to not have to update it overtime we add a new payload value. I think i might store the raw JSON payload in mongod, and return a combined result (so all keys). I'll take a look.

digitaldan added a commit to digitaldan/openhab-cloud that referenced this issue Jun 29, 2024
Fixes openhab#466

Signed-off-by: Dan Cunningham <[email protected]>
@digitaldan
Copy link
Contributor

with #467 notifications would return what they did before, plus the raw payload of what openHAB sent, for example

{
    "_id": "668096d5fc15ce1a1d37f103",
    "message": "Test Message",
    "payload": {
        "media-attachment-url": "item:imageItem",
        "message": "Test Message",
        "title": "Test",
        "on-click": "ui:popup:widget:test",
        "actions": [
            {
                "title": "Button 1",
                "action": "command:myItem:ON"
            },
            {
                "title": "Button 2",
                "action": "ui:popup:widget:myWidget"
            }
        ]
    },
    "created": "2024-06-29T23:20:53.216Z",
    "__v": 0
}

Does this work for you ?

@digitaldan
Copy link
Contributor

Additionally , in time, we can remove the duplicate fields like message, icon and severity from the original structure and just rely on the payload,.

@mueller-ma
Copy link
Member Author

Yes, that works for me 👍
I'll update the Android app to use only payload and come back here when the app has been rolled out, so you can remove the old fields then.

@digitaldan
Copy link
Contributor

Great, i'll deploy this today after i run a few more tests.

@digitaldan
Copy link
Contributor

Thats deployed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants