Skip to content

Commit

Permalink
Facebook Messenger notify component: add support for sending messages…
Browse files Browse the repository at this point in the history
… to specific page user IDs (#9643)
  • Loading branch information
mweimerskirch authored and fabaff committed Oct 2, 2017
1 parent f7609e9 commit 3337107
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion homeassistant/components/notify/facebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,15 @@ def send_message(self, message="", **kwargs):
return

for target in targets:
# If the target starts with a "+", we suppose it's a phone number,
# otherwise it's a user id.
if target.startswith('+'):
recipient = {"phone_number": target}
else:
recipient = {"id": target}

body = {
"recipient": {"phone_number": target},
"recipient": recipient,
"message": body_message
}
import json
Expand Down

0 comments on commit 3337107

Please sign in to comment.