Skip to content

Pass ID when creating notification#7

Open
osiris86 wants to merge 4 commits into
john3300:masterfrom
osiris86:IDOnCreate
Open

Pass ID when creating notification#7
osiris86 wants to merge 4 commits into
john3300:masterfrom
osiris86:IDOnCreate

Conversation

@osiris86

Copy link
Copy Markdown

Hi there,

I wanted to display a notification on my mirror whenever a window in my home is open and I thought I could use your module with very little adjustments. I used your module as a basis and modified it to also suit my needs. Here's what I did:

  1. Data for the notifications can now also be passed in the JSON body. If no JSON body is present, the query params are used as before
  2. If a duration of -1 is set in the config the notifications will be displayed infinitely (actually, it's 100 years ;-) )
  3. When creating a notification by POSTing the endpoint, an ID can now also be passed to the module. The notification will then be created with the provided id.
  4. Some (automatic) changes to the code format

On my home automation front I assigned every window a unique id. When the window is opened, the home automation system POSTs the ID with a text to the module. When the window is closed, the home automation system DELETEs the notification.

Based on my tests all my changes shouldn't affect existing functionality. Feel free to adjust the PR to your needs :)

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