mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Allow 202 status code as a successful REST notify response (#21678)
The REST notification component only allows 200 + 201 as a successful response code to the submission. notify.me returns a 202 (Accepted) response, which works fine but gets logged as a warning in the log. Update the allowed statuses to treat the 202 as ok.
This commit is contained in:
parent
7d9c14541b
commit
401720085d
@ -112,7 +112,7 @@ class RestNotificationService(BaseNotificationService):
|
||||
response = requests.get(self._resource, headers=self._headers,
|
||||
params=data, timeout=10)
|
||||
|
||||
if response.status_code not in (200, 201):
|
||||
if response.status_code not in (200, 201, 202):
|
||||
_LOGGER.exception(
|
||||
"Error sending message. Response %d: %s:",
|
||||
response.status_code, response.reason)
|
||||
|
Loading…
x
Reference in New Issue
Block a user