1
mirror of https://github.com/home-assistant/core synced 2024-09-28 03:04:04 +02:00

Allow specific status codes while notifying mobile_app devices (#30496)

* Removed check and return with a notification status of 201

* Allow additional result codes

Allow 200, 201, and 202 as valid result codes
This commit is contained in:
rccoleman 2020-01-06 14:41:07 -08:00 committed by Paulus Schoutsen
parent 5ec5df77cc
commit 4a2987e790

View File

@ -134,9 +134,9 @@ class MobileAppNotificationService(BaseNotificationService):
response = await self._session.post(push_url, json=data)
result = await response.json()
if response.status == 201:
if response.status in [200, 201, 202]:
log_rate_limits(self.hass, entry_data[ATTR_DEVICE_NAME], result)
return
continue
fallback_error = result.get("errorMessage", "Unknown error")
fallback_message = "Internal server error, please try again later: {}".format(