diff options
Diffstat (limited to 'push.py')
-rwxr-xr-x | push.py | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -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) |