mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +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
|
||||
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user