mirror of
https://github.com/home-assistant/core.git
synced 2025-08-03 12:45:28 +02:00
Facebook Messenger notify component: add support for sending messages to specific page user IDs (#9643)
This commit is contained in:
committed by
Fabian Affolter
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
|
||||
|
Reference in New Issue
Block a user