Fix sending polls to Telegram threads (#137553)

Fix sending poll to Telegram thread
This commit is contained in:
Jasper Wiegratz 2025-02-06 19:42:28 +01:00 committed by Franck Nijhof
parent bec569caf9
commit cb937bc115
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
2 changed files with 3 additions and 1 deletions

View File

@ -175,6 +175,7 @@ BASE_SERVICE_SCHEMA = vol.Schema(
vol.Optional(ATTR_KEYBOARD_INLINE): cv.ensure_list,
vol.Optional(ATTR_TIMEOUT): cv.positive_int,
vol.Optional(ATTR_MESSAGE_TAG): cv.string,
vol.Optional(ATTR_MESSAGE_THREAD_ID): vol.Coerce(int),
},
extra=vol.ALLOW_EXTRA,
)
@ -216,6 +217,7 @@ SERVICE_SCHEMA_SEND_POLL = vol.Schema(
vol.Optional(ATTR_ALLOWS_MULTIPLE_ANSWERS, default=False): cv.boolean,
vol.Optional(ATTR_DISABLE_NOTIF): cv.boolean,
vol.Optional(ATTR_TIMEOUT): cv.positive_int,
vol.Optional(ATTR_MESSAGE_THREAD_ID): vol.Coerce(int),
}
)

View File

@ -184,7 +184,7 @@ async def test_send_message_thread(hass: HomeAssistant, webhook_platform) -> Non
assert len(events) == 1
assert events[0].context == context
assert events[0].data[ATTR_MESSAGE_THREAD_ID] == "123"
assert events[0].data[ATTR_MESSAGE_THREAD_ID] == 123
async def test_webhook_endpoint_generates_telegram_text_event(