aboutsummaryrefslogtreecommitdiffstats
path: root/push.py
diff options
context:
space:
mode:
Diffstat (limited to 'push.py')
-rwxr-xr-xpush.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/push.py b/push.py
index b5ad459..f1aa1d7 100755
--- a/push.py
+++ b/push.py
@@ -113,13 +113,14 @@ except (NameError, TypeError):
msg = payload.strip()
-# Check for multiple user keys
-if type(user_tokens) is list:
- # Send notification to each user key
- for user_token in user_tokens:
- p = pushover.Client(user_token, api_token=api_token)
- p.send_message(msg, title=title)
-else:
- # Send notification to the only user key
- p = pushover.Client(user_tokens, api_token=api_token)
+# Send notification to each user key
+for user_token in user_tokens:
+ if type(user_token) is dict:
+ k = user_token.keys()[0]
+ device = user_token.get(k, None)
+ user_token = k
+ else:
+ device = None
+
+ p = pushover.Client(user_token, api_token=api_token, device=device)
p.send_message(msg, title=title)