1
mirror of https://github.com/home-assistant/core synced 2024-10-07 10:13:38 +02:00

Don't allow sending to invalid iOS targets (#6115)

* Don't allow sending to invalid targets

* Fix valid target check
This commit is contained in:
Robbie Trencheny 2017-03-10 03:32:43 -08:00 committed by Pascal Vizeli
parent b705b3ddb9
commit 846a0513c7

View File

@ -84,6 +84,11 @@ class iOSNotificationService(BaseNotificationService):
data[ATTR_DATA] = kwargs.get(ATTR_DATA)
for target in targets:
if target not in ios.enabled_push_ids():
_LOGGER.error("The target (%s) does not exist in ios.conf.",
targets)
return
data[ATTR_TARGET] = target
req = requests.post(PUSH_URL, json=data, timeout=10)