Skip to content

Commit cee119e

Browse files
committed
Continue iteration on 3030 status code
This error is returned by Roborock's API when there is an account currently in deletion. This can happen e.g. if a user erronously creates their account in the wrong region and then deletes it so they can create a new one in the correct region.
1 parent 3468b05 commit cee119e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

roborock/web_api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ async def _get_iot_login_info(self) -> IotLoginInfo:
9595
raise RoborockMissingParameters(
9696
"You are missing parameters for this request, are you sure you entered your username?"
9797
)
98+
elif response_code == 3030:
99+
_LOGGER.warning("Found account in deletion in %s (code %s)", country, country_code)
100+
continue
98101
else:
99102
raise RoborockException(f"{response.get('msg')} - response code: {response_code}")
100103
country_code = response["data"]["countrycode"]

tests/test_web_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ async def test_url_cycling(mock_rest) -> None:
9292
"""Test that we cycle through the URLs correctly."""
9393
# Clear mock rest so that we can override the patches.
9494
mock_rest.clear()
95-
# 1. Mock US URL to return valid status but None for countrycode
9695

96+
# 1. Mock US URL to return the account in deletion code
9797
mock_rest.post(
9898
re.compile("https://usiot.roborock.com/api/v1/getUrlByEmail.*"),
9999
status=200,
100100
payload={
101-
"code": 200,
101+
"code": 3030,
102102
"data": {"url": "https://usiot.roborock.com", "country": None, "countrycode": None},
103-
"msg": "Success",
103+
"msg": "Account in deletion",
104104
},
105105
)
106106

0 commit comments

Comments
 (0)