Html5 notifications improvements (#2840)

* Retry sending the push for 1 day instead of failing instantly if the target is unavailable

* Add timestamp to push payload

* Correctly use the title and body fields for their intended purposes

* Add callback support

* Revert changes to frontend files.

* Add default URL which will open Home Assistant. Also put all the data into the data object of the payload so it is accessible in the browser. Without doing this, things like URL wouldnt be accessible.

* Flake8 and pylint fixes

* event->type

* Dont send the default url if actions exist

* flake8/pylint fixes again

* Update html5 tests

* Remove callbacks from this branch, will re-stage on a different branch

* Remove remnant of callbacks

* Add url to data dictionary if it exists instead of copying the entire data dictionary in

* flake8 fix
This commit is contained in:
Robbie Trencheny 2016-08-16 14:26:01 -07:00 committed by GitHub
parent 822b7f8770
commit 72fc526ee8
2 changed files with 16 additions and 4 deletions

View file

@ -65,7 +65,7 @@ class TestHtml5Notify(object):
# Call to send
payload = json.loads(mock_wp.mock_calls[1][1][0])
assert payload['title'] == 'Hello'
assert payload['body'] == 'Hello'
assert payload['icon'] == 'beer.png'
def test_registering_new_device_view(self):