From eb1a48b26ced745175820c4d547f12ccbab2f13e Mon Sep 17 00:00:00 2001 From: Tom <56171752+Flying-Tom@users.noreply.github.com> Date: Wed, 22 May 2024 18:50:46 +0800 Subject: [PATCH] fix: TypeError when modelNumber is None (#16) * Update cloud.py * Update cloud.py --- custom_components/midea_ac_lan/midea/core/cloud.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/midea_ac_lan/midea/core/cloud.py b/custom_components/midea_ac_lan/midea/core/cloud.py index f4eb2eb0..2ced6fc3 100644 --- a/custom_components/midea_ac_lan/midea/core/cloud.py +++ b/custom_components/midea_ac_lan/midea/core/cloud.py @@ -273,7 +273,7 @@ async def list_appliances(self, home_id) -> dict | None: for appliance in room.get("applianceList"): try: model_number = int(appliance.get("modelNumber", 0)) - except ValueError: + except (ValueError, TypeError): model_number = 0 device_info = { "name": appliance.get("name"),