-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
[actions] Add notification builder & Mark some actions deprecated as replaced by better APIs #351
Conversation
…some actions Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
To Dos:
|
Awesome ! |
README.md
Outdated
- `.logNotificationBuilder(message)`: Creates a builder to send a log notification with the given message. | ||
- `.withIcon(icon)`: Sets the icon of the notification. | ||
- `.withSeverity(link)`: Sets the severity of the notification. | ||
- .`send()`: Sends the notification. |
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.
I'd replace this builder with a function logOnly()
on notificationBuilder()
. This way the media attachment can be shown in the notification list.
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.
Good idea!
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.
But please note that media attachment cannot be set for log notifications with the current NotificationActions in openhab/openhab-addons#16934.
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.
@digitaldan Maybe drop the three user-facing types (log, broadcast, normal) completely and make everything a "normal" notification? Then log notifications are just like normal ones with the same properties, but don't push.
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@mueller-ma I have implemented your proposals, updated the unit tests, updates the README and added the missing JSDoc. |
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@digitaldan Do you want to review or should I self-merge? |
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
LGTM, thanks !!!!!! |
I will test this soon in production and then publish a new release and update the add-on. |
Works fine for me, however I can only test the message due to client limitations (iOS App). |
Will try it today! I'm hoping to get a test flight build soon of the new IOS app. |
…ications (#353) Follow-up for #351. Refs openhab/openhab-addons#16934. - Renames severity to tag. - Adds support for specifying `referenceId`. - Adds support for hiding notifications. --------- Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
This adds builders to create broadcast, log and standard notifications and allow easy usage of the new functionality provided by openhab/openhab-addons#16934 without having to deal with method param orders.
It also marks several actions as deprecated, because their functionality was replaced by better and often pure JS APIs.