Add telegram message_tag, disable_notification, parse_mode (#63604)

Co-authored-by: root <zvldz@users.noreply.github.com>
This commit is contained in:
zvldz 2022-02-23 20:19:01 +02:00 committed by GitHub
parent 79d267f8d7
commit 8c69194695
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,6 +11,11 @@ from homeassistant.components.notify import (
PLATFORM_SCHEMA,
BaseNotificationService,
)
from homeassistant.components.telegram_bot import (
ATTR_DISABLE_NOTIF,
ATTR_MESSAGE_TAG,
ATTR_PARSER,
)
from homeassistant.const import ATTR_LOCATION
from homeassistant.helpers.reload import setup_reload_service
@ -56,6 +61,21 @@ class TelegramNotificationService(BaseNotificationService):
service_data.update({ATTR_MESSAGE: message})
data = kwargs.get(ATTR_DATA)
# Set message tag
if data is not None and ATTR_MESSAGE_TAG in data:
message_tag = data.get(ATTR_MESSAGE_TAG)
service_data.update({ATTR_MESSAGE_TAG: message_tag})
# Set disable_notification
if data is not None and ATTR_DISABLE_NOTIF in data:
disable_notification = data.get(ATTR_DISABLE_NOTIF)
service_data.update({ATTR_DISABLE_NOTIF: disable_notification})
# Set parse_mode
if data is not None and ATTR_PARSER in data:
parse_mode = data.get(ATTR_PARSER)
service_data.update({ATTR_PARSER: parse_mode})
# Get keyboard info
if data is not None and ATTR_KEYBOARD in data:
keys = data.get(ATTR_KEYBOARD)