Просмотр исходного кода

Merge branch 'main' of ssh://github.com/make-all/tuya-local

Jason Rumney 4 дней назад
Родитель
Сommit
04483f1a4b
1 измененных файлов с 7 добавлено и 7 удалено
  1. 7 7
      custom_components/tuya_local/config_flow.py

+ 7 - 7
custom_components/tuya_local/config_flow.py

@@ -426,26 +426,26 @@ class ConfigFlowHandler(ConfigFlow, domain=DOMAIN):
         best_matching_key = None
         has_product_id_match = False
 
-        for type in await self.device.async_possible_types():
-            q = type.match_quality(
+        for dev_type in await self.device.async_possible_types():
+            q = dev_type.match_quality(
                 self.device._get_cached_state(),
                 self.device._product_ids,
             )
             if q > 100:
                 has_product_id_match = True
-            for manufacturer, model in type.product_display_entries(
+            for manufacturer, model in dev_type.product_display_entries(
                 self.device._product_ids
             ):
-                key = f"{type.config_type}||{manufacturer or ''}||{model or ''}"
+                key = f"{dev_type.config_type}||{manufacturer or ''}||{model or ''}"
                 parts = [p for p in [manufacturer, model] if p]
                 if parts:
-                    label = f"{' '.join(parts)} ({type.config_type})"
+                    label = f"{' '.join(parts)} ({dev_type.config_type})"
                 else:
-                    label = f"{type.name} ({type.config_type})"
+                    label = f"{dev_type.name} ({dev_type.config_type})"
                 all_matches.append((SelectOptionDict(value=key, label=label), q))
                 if q > best_match:
                     best_match = q
-                    best_matching_type = type.config_type
+                    best_matching_type = dev_type.config_type
                     best_matching_key = key
 
         if has_product_id_match: