From 401720085d02541ecd0c49233bd6058162f8a7f0 Mon Sep 17 00:00:00 2001 From: Jonathan McDowell Date: Tue, 5 Mar 2019 17:22:21 +0000 Subject: [PATCH] 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. --- homeassistant/components/notify/rest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/notify/rest.py b/homeassistant/components/notify/rest.py index dd35f986f78..710a1a597e9 100644 --- a/homeassistant/components/notify/rest.py +++ b/homeassistant/components/notify/rest.py @@ -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)