From 4f22d5c9ee3cd88dc4bf08fb0df05f9a6e798867 Mon Sep 17 00:00:00 2001 From: Alone Date: Fri, 1 Nov 2024 10:39:40 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=90=20fix=20for=20auth=20err=20(#1899)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom_components/xiaomi_miot/core/xiaomi_cloud.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/xiaomi_miot/core/xiaomi_cloud.py b/custom_components/xiaomi_miot/core/xiaomi_cloud.py index 51757c2d7..26a316dbd 100644 --- a/custom_components/xiaomi_miot/core/xiaomi_cloud.py +++ b/custom_components/xiaomi_miot/core/xiaomi_cloud.py @@ -167,7 +167,8 @@ async def async_check_auth(self, notify=False): rdt = await self.async_request_api(api, dat, method='POST') or {} nid = f'xiaomi-miot-auth-warning-{self.user_id}' eno = rdt.get('code', 0) - if eno != 3: + msg = rdt.get('message', '') + if not (eno == 3 or msg == 'auth err'): return True except requests.exceptions.ConnectionError: return None