Commit Graph

95 Commits (b07e9df308a2fec26d76ee0ae046c5699d0546d1)

Author SHA1 Message Date
Kevin Cathcart d700415045
Support notification_id in notify.persistent_notification (#74822)
* Support notification_id in notify.persistent_notification

* Apply suggestions from code review

Co-authored-by: Scott Giminiani <ScottG489@Gmail.com>

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Scott Giminiani <ScottG489@Gmail.com>
2023-06-25 22:25:58 -04:00
J. Nick Koston 48485fc2bf
Complete persistent notifications migration (#92828)
* Complete migration of persistent notifications

Persistent notifications are no longer stored in
the state machine and no longer fire events

* Complete migration of persistent notifications

Persistent notifications are no longer stored in
the state machine and no longer fire events

* fixes

* fixes

* fixes

* ws test

* update tests

* update tests

* fix more tests

* fix more tests

* more fixes

* fix

* fix person

* fix person

* keep whitelist

* use singleton
2023-05-25 23:09:13 -04:00
epenet 50cbabb2d8
Add type hints to integration tests (part 15) (#88006) 2023-02-15 10:00:49 +01:00
epenet 3abf7ea18a
Add type hints to integration tests (m-p) (#87705) 2023-02-08 07:48:54 -08:00
J. Nick Koston 03fac0c529
Fix race in notify setup (#76954) 2022-08-17 22:37:47 -04:00
Jan Bouwhuis cfc8b5fee7
Fix notify discovery setup (#68451)
* Fix notify discovery setup

* add test

* unsubscribe at reset

* Add guard

* move dispatcher to reload module

* only unsubscribe if platform was setup

* initialize dispatcher once and tests

* test get_service too

* add tests

* fix test

* use get_service for test invalid platform

* Test built-in reload method

* set to None after clearing dispatcher - tests

* Pathing services file

* Update tests/components/notify/test_init.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* dispatcher is not set twice if integration loaded

* empty discovery payload

* Removed not needed services.yaml mock

* Update tests/components/notify/test_init.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* flake8

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-03-28 08:53:30 +02:00
Paulus Schoutsen a4d9019ffc
Refactor persistent notification to no longer route all data via a service (#57157)
* Convert persistent notification tests to async

* Create/dismiss persistent notifications in exposed functions, not service calls

* Fix notify persistent_notification

* Remove setting up persistent_notification

* Drop more setups

* Empty methods

* Undeprecate sync methods because too big task

* Fix setup clearing notifications

* Fix a bunch of tests

* Fix more tests

* Uno mas

* Test persistent notification events

* Clean up stale comment

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-10-07 12:58:00 +02:00
Paulus Schoutsen d4864f5750
Deprecate passing template to notify (#56069) 2021-09-20 21:49:02 -07:00
Alan Tse 4928476abe
Allow notify services to update existing targets (#45283) 2021-01-18 21:42:20 +01:00
Kevin Cathcart 754ba18af0
Add persistent_notification service to the notify platform (#40638)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-10-21 17:12:36 +02:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Robbie Trencheny 7741ec4d5a Great migration notify (#22406)
* Move notify platforms into components

* Move notify tests

* Fix notify tests

* More fixes

* Update requirements

* Update .coveragerc

* Run gen reqs
2019-03-27 20:36:13 -07:00
Tommy Jonsson 1b79872dd6 Add notify.html5_dismiss service (#19912)
* Add notify.html5_dismiss service

* fix test

* add can_dismiss

* fix service data payload

* fix hasattr -> getattr

* fixes

* move dismiss service to html5

* fix services.yaml

* fix line to long
2019-01-15 15:31:57 -08:00
Tommy Jonsson 3bdee57066 Support for html5 notifications to suggest their names (#19965)
* support for devices to suggest their names

* houndci fixes

* Lint
2019-01-11 20:44:29 -08:00
Paulus Schoutsen d1a621601d No more opt-out auth (#18854)
* No more opt-out auth

* Fix var
2018-12-02 16:32:53 +01:00
Paulus Schoutsen df21dd21f2 RFC: Call services directly (#18720)
* Call services directly

* Simplify

* Type

* Lint

* Update name

* Fix tests

* Catch exceptions in HTTP view

* Lint

* Handle ServiceNotFound in API endpoints that call services

* Type

* Don't crash recorder on non-JSON serializable objects
2018-11-30 21:28:35 +01:00
Paulus Schoutsen 6ae345b01c
Pass hass_config to load_platform (#17952)
* Pass hass_config to load_platform

* Fix tests

* Lint
2018-10-29 19:21:21 +01:00
Paulus Schoutsen 08fe7c3ece
Pytest tests (#17750)
* Convert core tests

* Convert component tests to use pytest assert

* Lint 🤷‍♂️

* Fix test

* Fix 3 typos in docs
2018-10-24 12:10:05 +02:00
Martin Mois cb3d62eeef notify.homematic (#16973)
* Add notify.homematic_signalgen

* Update homematic_signalgen.py, test_homematic_signalgen.py

* Added new files to .coveragerc

* Fixed review comments from houndci-bot

* Fixed pylint errors

* Regenerate requirements_test_all.txt by script/gen_requirements_all.py

* Fix flake8 warnings

* Renamed notify.homematic_signalgen to notify.homematic and made it generic

* Update .coveragerc and requirements_test_all.txt

* Removed the terms signal generator from the sources.
2018-10-12 09:36:52 +02:00
Florian Klien ce1e8f8ace YesssSMS handling more errors, upgrade to version 0.2.3 (#17052)
* YesssSMS handling more errors, upgrade to version 0.2.1

 - handling missing internet connection nicely
 - disabling login with non-working credentials (website locked account for 1 hour)
 - upgrade to new upstream version of YesssSMS

* notify.yessssms tests

* test requirements

* flake8 fix

* fixing tests, new upstream version 0.2.3

fixing tests based on requested changes, coverage

* removing unmotivated print

* passing exception to ConnectionError and SMSSendingError logger
2018-10-04 17:34:04 -04:00
cdce8p dd45e99302 Remove service helper (4) (#16892)
* Update media_player

* Update lock

* Update notify

* Update remote

* Update scene

* Update vacuum

* Remove timer helpers

* Removed unused legacy helpers
2018-09-26 18:02:05 +02:00
Ville Skyttä dd9d53c83e Update pydocstyle to 2.1.1 and flake8-docstrings to 1.3.0 (#14557)
* Update pydocstyle to 2.1.1 and flake8-docstrings to 1.3.0

* Pydocstyle D401 fixes
2018-08-24 10:28:43 +02:00
Ville Skyttä dbd0763f83 Grammar and spelling fixes (#16065) 2018-08-19 22:29:08 +02:00
Ville Skyttä b7c336a687 Pylint cleanups (#15626)
* Pylint 2 no-else-return fixes

* Remove unneeded abstract-class-not-used pylint disable
2018-07-23 10:16:05 +02:00
Ville Skyttä 2f7b79764a More pylint 2 fixes (#15565)
## Description:

More fixes flagged by pylint 2 that don't hurt to have before the actual pylint 2 upgrade (which I'll submit soon).

## Checklist:
  - [ ] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
2018-07-20 11:45:20 +03:00
Ville Skyttä 843789528e Remove extra quotes from docstrings (#14431) 2018-05-13 11:06:15 +02:00
Paulus Schoutsen 5c95c53c6c Revert custom component loading logic (#14327)
* Revert custom component loading logic

* Lint

* Fix tests

* Guard for infinite inserts into sys.path
2018-05-07 11:25:48 +02:00
Paulus Schoutsen 89a19c89a7 Fix aiohttp deprecation warnings (#13240)
* Fix aiohttp deprecation warnings

* Fix Ring deprecation warning

* Lint
2018-03-15 21:49:49 +01:00
Matthias Urlichs f5cc40024d Rename homeassistant.util.async to .async_ (#13088)
"async" is (going to be) a reserved word.
2018-03-11 10:01:12 -07:00
corneyl 2ee73ca911 Fixes notify.html5 for notifications on FireFox (#12993)
* Only pass the gcm_key when using Google Cloud Messaging as endpoint.

* Test if the gcm_key is only included for GCM endpoints.
2018-03-08 17:50:17 -08:00
Paulus Schoutsen 60d7e32f81
Flaky tests (#12931)
* Skip flaky DDWRT tests

* Import APNS before running tests
2018-03-05 14:13:18 -08:00
Per Osbäck f00d5cb8ca update html5 to async/await tests (#12896)
* update html5 to async/await tests

* removed paranthesis
2018-03-04 18:35:07 -08:00
Paulus Schoutsen f32911d036 Cleanup http (#12424)
* Clean up HTTP component

* Clean up HTTP mock

* Remove unused import

* Fix test

* Lint
2018-02-15 22:06:14 +01:00
Otto Winter 8dcfd35b8b Spelling fixes (#12041)
* Spelling fixes

*Lots* of them.

* Spelling breaking changes

* Fix lint errors
2018-01-29 23:37:19 +01:00
tschmidty69 ffe832763d Pushbullet (fix) invalid keyword, added unittests (#11804)
* Fixed unittests

* revert requirements

* added pushbullet.py to requirements

* updated requirements
2018-01-24 21:06:35 +01:00
tschmidty69 c036141b37 Pushbullet email support (fix) (#11590)
* Simplified push calls

* Cleaned up and added unittests

* Fixed email parameter

* Fixed email parameter
2018-01-12 11:06:42 -08:00
Paulus Schoutsen 0d06e8c1c9 Test tweaks (#11560)
* Fix is_allowed_path on OS X

* Move APNS2 inside func in test
2018-01-10 10:48:17 +01:00
Christopher Viel 455c629f47 Don't duplicate html5 registrations (#11451)
* Don't duplicate html5 registrations

If a registration is posted and another registration with the same
endpoint URL exists, update that one instead. That way, we preserve
the device name that has been configured. The previous behavior used to
append 'unnamed device' registrations over and over, leading to
multiple copies of the same registration. The endpoint URL is unique per
service worker so it is safe to update matching registrations.

* Refactor html5 registration view to not write json in the event loop
2018-01-05 14:29:27 -08:00
Derek Brooks e1d1cf76ca Add Facebook Notification tests (#10642)
* test the facebook notification component

* respond to hound feedback

* remove unnecessary line breaks

* parse_qs not needed with requests_mock

* remove facebook notifier from .coveragerc
2017-11-17 21:12:36 -08:00
Per Osbäck 59e943b3c1 notify.html5: use new json save and load functions (#10416)
* update to use new save_json and load_json

* it is no longer possible to determine if the json file contains valid or empty data.

* fix lint
2017-11-11 15:57:11 -08:00
Fabian Affolter de9d19d6f4 Use constants for HTTP headers (#10313)
* Use constants for HTTP headers

* Fix ordering

* Move 'no-cache' to platform
2017-11-04 12:04:05 -07:00
Per Osbäck 0646d01152 Add support for the expirationTime parameter. (#7895)
Enabled by default in Chrome 60.
Only accepts the param, doesn't act on the actual expiration date. Chrome will always pass NULL for now.

https://github.com/w3c/push-api/pull/248
https://www.chromestatus.com/feature/4929396687241216
https://bugs.chromium.org/p/chromium/issues/detail?id=718837
2017-06-04 22:46:18 -07:00
Paulus Schoutsen 7d4adbbef5 Fix html5 unsub (#7874)
* Fix #7758 subscription expiration/removal

Removes a subscription after receiving an HTTP 410 response when trying to send a new message.

* Fix tests failing due to additional call

* Fix code style

* Lint
2017-06-02 20:56:16 -07:00
Paulus Schoutsen e68bd0457c Fix more deprecation warnings (#7778)
* Remove setting up an hbmqtt broker

* Don't pass loop to web.Application in tests

* Use .query instead of deprecated .GET for aiohttp requests

* Fix closing file resource

* Do not use asyncio mark

* Notify.html5 - PyJWT: Use options to disable verify

* Yamaha: Test was still using deprecated ip

* Remove pytest-asyncio
2017-05-26 13:12:17 -07:00
Eugenio Panadero d0304198de SMTP notify enhancements: full HTML emails and custom `product_name` in email headers (#7533)
* SMTP notify enhancements: HTML emails and customization options

- Send full HTML emails, with or without inline attached images.
- Custom `timeout`.
- Custom `product_name` identifier for the `FROM` and `X-MAILER` email headers.
- New HTML email test

* `sender_name` instead of product_name

 - Change `sender_name` instead of `product_name`.
 - No changes in `X-Mailer` header.
 - `From` header as always unless you define the new `sender_name` parameter.
2017-05-15 00:23:57 -07:00
Anders Melchiorsen 89164d0244 Allow multiple recipients for SMTP notify (#7319)
The existing (singular) configuration keyword is kept for compatibility.
2017-04-28 11:29:30 +02:00
hawk259 f4d8095e54 Add configurable timeout option to notify/smtp (#6609)
* Add configurable timeout option to notify/smtp

* Updated smtp test to include timeout param

* fixed 80 column style issue
2017-03-14 19:00:16 +01:00
Paulus Schoutsen 2650c73a89 Split bootstrap into bs + setup (#6416)
* Split bootstrap into bs + setup

* Lint
2017-03-05 10:41:54 +01:00
Paulus Schoutsen 307514e3a7 Prevent more I/O in apns (#6413) 2017-03-04 19:57:04 -08:00
Paulus Schoutsen b939626497 Fix tests no internet (#6411)
* Fix honeywell tests without internet

* Fix device tracker without internet

* Fix MFI using internet during tests

* Remove I/O from apns tests
2017-03-04 17:15:20 -08:00