Skip to content

Additional event emitter for Notifications? #4

@CloCkWeRX

Description

@CloCkWeRX

https://secure.splitwise.com/api/v3.0/get_notifications lets you get:

{
  "notifications": [
    {
      "id": 32514315,
      "type": 0,
      "created_at": "2019-08-24T14:15:22Z",
      "created_by": 2,
      "source": {
        "type": "Expense",
        "id": 865077,
        "url": "string"
      },
      "image_url": "https://s3.amazonaws.com/splitwise/uploads/notifications/v2/0-venmo.png",
      "image_shape": "square",
      "content": "<strong>You</strong> paid <strong>Jon H.</strong>.<br><font color=\\\"#5bc5a7\\\">You paid $23.45</font>"
    }
  ]
}

These seem a good fit for events:
https://developers.home-assistant.io/docs/dev_101_events/

Unclear if its a safe assumption that the content returned is trustable/won't lead to weird XSS bugs; and they are shaped around what the user themselves would see on the mobile app.

Not sure if you'd want to call the relevant get method based on the type - get_expense/id for type:0 - added for example.

Useful scenarios:

  • Expense added
  • Expense updated
  • Expense deleted
  • Debt simplified

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions