Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions homeassistant/components/telegram_bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
ATTR_LONGITUDE,
CONF_API_KEY,
CONF_PLATFORM,
CONF_TIMEOUT,
CONF_URL,
HTTP_DIGEST_AUTHENTICATION,
)
Expand Down Expand Up @@ -67,6 +66,7 @@
ATTR_USER_ID = "user_id"
ATTR_USERNAME = "username"
ATTR_VERIFY_SSL = "verify_ssl"
ATTR_TIMEOUT = "timeout"

CONF_ALLOWED_CHAT_IDS = "allowed_chat_ids"
CONF_PROXY_URL = "proxy_url"
Expand Down Expand Up @@ -135,7 +135,7 @@
vol.Optional(ATTR_DISABLE_WEB_PREV): cv.boolean,
vol.Optional(ATTR_KEYBOARD): vol.All(cv.ensure_list, [cv.string]),
vol.Optional(ATTR_KEYBOARD_INLINE): cv.ensure_list,
vol.Optional(CONF_TIMEOUT): vol.Coerce(float),
vol.Optional(ATTR_TIMEOUT): cv.positive_int,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MartinHjelmare does changing the expected data type of a service count as a breaking change?

Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare Feb 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could, but here I think we're backwards compatible. We're limiting it to positive numbers though. But a negative timeout sounds weird so I think that's ok.

},
extra=vol.ALLOW_EXTRA,
)
Expand Down Expand Up @@ -499,15 +499,15 @@ def _make_row_inline_keyboard(row_keyboard):
ATTR_DISABLE_WEB_PREV: None,
ATTR_REPLY_TO_MSGID: None,
ATTR_REPLYMARKUP: None,
CONF_TIMEOUT: None,
ATTR_TIMEOUT: None,
}
if data is not None:
if ATTR_PARSER in data:
params[ATTR_PARSER] = self._parsers.get(
data[ATTR_PARSER], self._parse_mode
)
if CONF_TIMEOUT in data:
params[CONF_TIMEOUT] = data[CONF_TIMEOUT]
if ATTR_TIMEOUT in data:
params[ATTR_TIMEOUT] = data[ATTR_TIMEOUT]
if ATTR_DISABLE_NOTIF in data:
params[ATTR_DISABLE_NOTIF] = data[ATTR_DISABLE_NOTIF]
if ATTR_DISABLE_WEB_PREV in data:
Expand Down
18 changes: 18 additions & 0 deletions homeassistant/components/telegram_bot/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ send_message:
disable_web_page_preview:
description: Disables link previews for links in the message.
example: true
timeout:
description: Timeout for send message. Will help with timeout errors (poor internet connection, etc)
example: '1000'
keyboard:
description: List of rows of commands, comma-separated, to make a custom keyboard. Empty list clears a previously set keyboard.
example: '["/command1, /command2", "/command3"]'
Expand Down Expand Up @@ -55,6 +58,9 @@ send_photo:
verify_ssl:
description: Enable or disable SSL certificate verification. Set to false if you're downloading the file from a URL and you don't want to validate the SSL certificate of the server.
example: false
timeout:
description: Timeout for send photo. Will help with timeout errors (poor internet connection, etc)
example: '1000'
keyboard:
description: List of rows of commands, comma-separated, to make a custom keyboard.
example: '["/command1, /command2", "/command3"]'
Expand Down Expand Up @@ -86,6 +92,9 @@ send_sticker:
verify_ssl:
description: Enable or disable SSL certificate verification. Set to false if you're downloading the file from a URL and you don't want to validate the SSL certificate of the server.
example: false
timeout:
description: Timeout for send sticker. Will help with timeout errors (poor internet connection, etc)
example: '1000'
keyboard:
description: List of rows of commands, comma-separated, to make a custom keyboard.
example: '["/command1, /command2", "/command3"]'
Expand Down Expand Up @@ -120,6 +129,9 @@ send_video:
verify_ssl:
description: Enable or disable SSL certificate verification. Set to false if you're downloading the file from a URL and you don't want to validate the SSL certificate of the server.
example: false
timeout:
description: Timeout for send video. Will help with timeout errors (poor internet connection, etc)
example: '1000'
keyboard:
description: List of rows of commands, comma-separated, to make a custom keyboard.
example: '["/command1, /command2", "/command3"]'
Expand Down Expand Up @@ -154,6 +166,9 @@ send_document:
verify_ssl:
description: Enable or disable SSL certificate verification. Set to false if you're downloading the file from a URL and you don't want to validate the SSL certificate of the server.
example: false
timeout:
description: Timeout for send document. Will help with timeout errors (poor internet connection, etc)
example: '1000'
keyboard:
description: List of rows of commands, comma-separated, to make a custom keyboard.
example: '["/command1, /command2", "/command3"]'
Expand All @@ -176,6 +191,9 @@ send_location:
disable_notification:
description: Sends the message silently. iOS users and Web users will not receive a notification, Android users will receive a notification with no sound.
example: true
timeout:
description: Timeout for send photo. Will help with timeout errors (poor internet connection, etc)
example: '1000'
keyboard:
description: List of rows of commands, comma-separated, to make a custom keyboard.
example: '["/command1, /command2", "/command3"]'
Expand Down