mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +00:00
Facebook Messenger notify component: add support for sending messages to specific page user IDs (#9643)
This commit is contained in:
parent
f7609e9cb1
commit
3337107e79
@ -56,8 +56,15 @@ class FacebookNotificationService(BaseNotificationService):
|
|||||||
return
|
return
|
||||||
|
|
||||||
for target in targets:
|
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 = {
|
body = {
|
||||||
"recipient": {"phone_number": target},
|
"recipient": recipient,
|
||||||
"message": body_message
|
"message": body_message
|
||||||
}
|
}
|
||||||
import json
|
import json
|
||||||
|
Loading…
x
Reference in New Issue
Block a user