mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00: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:
parent
5ec5df77cc
commit
4a2987e790
@ -134,9 +134,9 @@ class MobileAppNotificationService(BaseNotificationService):
|
|||||||
response = await self._session.post(push_url, json=data)
|
response = await self._session.post(push_url, json=data)
|
||||||
result = await response.json()
|
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)
|
log_rate_limits(self.hass, entry_data[ATTR_DEVICE_NAME], result)
|
||||||
return
|
continue
|
||||||
|
|
||||||
fallback_error = result.get("errorMessage", "Unknown error")
|
fallback_error = result.get("errorMessage", "Unknown error")
|
||||||
fallback_message = "Internal server error, please try again later: {}".format(
|
fallback_message = "Internal server error, please try again later: {}".format(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user