Closed mueller-ma closed 4 months ago
@digitaldan
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.
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 ?
Additionally , in time, we can remove the duplicate fields like message, icon and severity from the original structure and just rely on the payload,.
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.
Great, i'll deploy this today after i run a few more tests.
Thats deployed
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.