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

Feature: v3 notification features backport #140

Conversation

amadeo-alex
Copy link
Collaborator

@amadeo-alex amadeo-alex commented Aug 19, 2024

This PR backports features that were developed as part of "v3 rewrite" project.
The added features were based on the Home Assistant's Android notifications documentation - https://companion.home-assistant.io/docs/notifications/notifications-basic/

Example 1: notification with 3 buttons, one input and tag & group so it can be cleared

service: notify.amadeo_pc
data:
  title: Fancy title
  message: Test message
  data:
    image: >-
      https://smea.uw.edu/wp-content/uploads/sites/11/2017/03/CURRENTSBLOG_Cat_2.jpg
    actions:
      - action: "yes"
        title: "Yes"
      - action: "no"
        title: "No"
      - action: "openuri"
        title: "Open URI"
        uri: "https://www.cat-lovers-only.com"
    inputs:
      - id: testId
        text: testText
        title: testTitle
    clickAction: "https://www.home-assistant.io/"
    tag: "dogsAreCoolToo"
    group: "cuddlyOnesTho"

Example 2: clear notification from "Example 1"

service: notify.amadeo_pc
data:
  message: clear_notification
  data:
    tag: "dogsAreCoolToo"
    group: "cuddlyOnesTho"

Example 3a: sticky notification (always requires a button so if there is no defined, a one called "Dismiss" will be automatically added)

service: notify.amadeo_pc
data:
  title: "I'm sticky"
  message: Gonna stay here I think
  data:
    sticky: true

Example 3b: sticky notification

service: notify.amadeo_pc
data:
  title: "I'm sticky"
  message: Gonna stay here I think
  data:
    actions:
      - action: "ok"
        title: "Ok"
    sticky: true

Example 4: "important notification" (overrides "sticky")

service: notify.amadeo_pc
data:
  title: "Don't miss me"
  message: "You're out of tea!"
  data:
    actions:
      - action: "buy"
        title: "Buy more"
      - action: "waterbros"
        title: "Water this time"
    importance: high

@amadeo-alex amadeo-alex added this to the 2.1.0 milestone Aug 19, 2024
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 this pull request may close these issues.

1 participant