From 4dfd44373abc389041e4960e8706f976b67d4b14 Mon Sep 17 00:00:00 2001 From: Necroneco Date: Wed, 29 May 2024 23:09:06 +0800 Subject: [PATCH] fix: TypeError: 'int' object is not subscriptable (#33) --- custom_components/midea_ac_lan/config_flow.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/midea_ac_lan/config_flow.py b/custom_components/midea_ac_lan/config_flow.py index fce418c0..665b769d 100644 --- a/custom_components/midea_ac_lan/config_flow.py +++ b/custom_components/midea_ac_lan/config_flow.py @@ -75,15 +75,15 @@ class ConfigFlow(config_entries.ConfigFlow): devices: dict = {} found_device: dict = {} supports: dict = {} - unsorted: dict = {} + unsorted: dict[int, str] = {} account: dict = {} cloud: MideaCloud | None = None session = None for device_type, device_info in MIDEA_DEVICES.items(): unsorted[device_type] = device_info["name"] - unsorted = dict(sorted(unsorted.items(), key=lambda x: x[1])) - for item in unsorted: + sorted_device_names = sorted(unsorted.items(), key=lambda x: x[1]) + for item in sorted_device_names: supports[item[0]] = item[1] def _save_device_config(self, data: dict):