Update notify to expect a list of string targets instead of a single … (#3548)

* Update notify to expect a list of string targets instead of a single string

* Actually do the thing I set out to do

* Fix notify.group test to expect an array of targets

* REST platform will only use the first target in the list

* Update notify platforms to expect a list of targets

* Update notify services.yaml
This commit is contained in:
Robbie Trencheny authored and Paulus Schoutsen committed 2016-10-01 22:19:17 -07:00
1 parent c189c05676
commit 646eaccd4d
13 files changed
+33 -47

No files matched your search

+4 -2
View File
@@ -75,8 +75,10 @@ class RestNotificationService(BaseNotificationService):
data[self._title_param_name] = kwargs.get(ATTR_TITLE,
ATTR_TITLE_DEFAULT)
if self._target_param_name is not None:
data[self._target_param_name] = kwargs.get(ATTR_TARGET)
if self._target_param_name is not None and ATTR_TARGET in kwargs:
# Target is a list as of 0.29 and we don't want to break existing
# integrations, so just return the first target in the list.
data[self._target_param_name] = kwargs[ATTR_TARGET][0]
if self._method == 'POST':
response = requests.post(self._resource, data=data, timeout=10)