|
37 | 37 | ) |
38 | 38 | from homeassistant.core import Context, HomeAssistant |
39 | 39 | from homeassistant.exceptions import HomeAssistantError, ServiceValidationError |
40 | | -from homeassistant.helpers import issue_registry as ir |
41 | 40 | from homeassistant.util.ssl import get_default_context, get_default_no_verify_context |
42 | 41 |
|
43 | 42 | from .const import ( |
|
77 | 76 | ATTR_USERNAME, |
78 | 77 | ATTR_VERIFY_SSL, |
79 | 78 | CONF_CHAT_ID, |
80 | | - CONF_PROXY_PARAMS, |
81 | 79 | CONF_PROXY_URL, |
82 | 80 | DOMAIN, |
83 | 81 | EVENT_TELEGRAM_CALLBACK, |
@@ -877,52 +875,9 @@ def initialize_bot(hass: HomeAssistant, p_config: MappingProxyType[str, Any]) -> |
877 | 875 | """Initialize telegram bot with proxy support.""" |
878 | 876 | api_key: str = p_config[CONF_API_KEY] |
879 | 877 | proxy_url: str | None = p_config.get(CONF_PROXY_URL) |
880 | | - proxy_params: dict | None = p_config.get(CONF_PROXY_PARAMS) |
881 | 878 |
|
882 | 879 | if proxy_url is not None: |
883 | | - auth = None |
884 | | - if proxy_params is None: |
885 | | - # CONF_PROXY_PARAMS has been kept for backwards compatibility. |
886 | | - proxy_params = {} |
887 | | - elif "username" in proxy_params and "password" in proxy_params: |
888 | | - # Auth can actually be stuffed into the URL, but the docs have previously |
889 | | - # indicated to put them here. |
890 | | - auth = proxy_params.pop("username"), proxy_params.pop("password") |
891 | | - ir.create_issue( |
892 | | - hass, |
893 | | - DOMAIN, |
894 | | - "proxy_params_auth_deprecation", |
895 | | - breaks_in_ha_version="2024.10.0", |
896 | | - is_persistent=False, |
897 | | - is_fixable=False, |
898 | | - severity=ir.IssueSeverity.WARNING, |
899 | | - translation_placeholders={ |
900 | | - "proxy_params": CONF_PROXY_PARAMS, |
901 | | - "proxy_url": CONF_PROXY_URL, |
902 | | - "telegram_bot": "Telegram bot", |
903 | | - }, |
904 | | - translation_key="proxy_params_auth_deprecation", |
905 | | - learn_more_url="https://github.com/home-assistant/core/pull/112778", |
906 | | - ) |
907 | | - else: |
908 | | - ir.create_issue( |
909 | | - hass, |
910 | | - DOMAIN, |
911 | | - "proxy_params_deprecation", |
912 | | - breaks_in_ha_version="2024.10.0", |
913 | | - is_persistent=False, |
914 | | - is_fixable=False, |
915 | | - severity=ir.IssueSeverity.WARNING, |
916 | | - translation_placeholders={ |
917 | | - "proxy_params": CONF_PROXY_PARAMS, |
918 | | - "proxy_url": CONF_PROXY_URL, |
919 | | - "httpx": "httpx", |
920 | | - "telegram_bot": "Telegram bot", |
921 | | - }, |
922 | | - translation_key="proxy_params_deprecation", |
923 | | - learn_more_url="https://github.com/home-assistant/core/pull/112778", |
924 | | - ) |
925 | | - proxy = httpx.Proxy(proxy_url, auth=auth, **proxy_params) |
| 880 | + proxy = httpx.Proxy(proxy_url) |
926 | 881 | request = HTTPXRequest(connection_pool_size=8, proxy=proxy) |
927 | 882 | else: |
928 | 883 | request = HTTPXRequest(connection_pool_size=8) |
|
0 commit comments