Skip to content

Commit

Permalink
fix: TypeError: 'int' object is not subscriptable (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
caibinqing authored May 29, 2024
1 parent c8f45f0 commit 4dfd443
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/midea_ac_lan/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 4dfd443

Please sign in to comment.