浏览代码

docs(config_flow): don't log partial cloud spec.

Previously this log was added because it at least gives some info about the dps
even if the user does not have access to the developer portal.

However this information suffers the same pitfalls as Query Device Parameters
and other cloud data sources:
 - it is often partial, listing "standard" dps only
 - the cloud protocol often differs from the local protocol, especially in enum values, and
   the format of raw data and bitfields.

Since the inflow of requests and PRs is so high now, it is better to filter out the
low quality submissions by not providing this incomplete info in the first place.
Jason Rumney 1 月之前
父节点
当前提交
934171ac82
共有 1 个文件被更改,包括 20 次插入 和 16 次删除
  1. 20 16
      custom_components/tuya_local/config_flow.py

+ 20 - 16
custom_components/tuya_local/config_flow.py

@@ -519,22 +519,26 @@ class ConfigFlowHandler(ConfigFlow, domain=DOMAIN):
                     "Local product id differs from cloud: %s",
                     self.__discovered_device.get("local_product_id"),
                 )
-            try:
-                self.init_cloud()
-                model = await self.cloud.async_get_datamodel(
-                    self.__discovered_device.get("id"),
-                )
-                if model:
-                    _LOGGER.warning(
-                        "Partial cloud device spec:\n%s",
-                        log_json(model),
-                    )
-            except Exception as e:
-                _LOGGER.warning(
-                    "Unable to fetch data model from cloud: %s %s",
-                    type(e).__name__,
-                    e,
-                )
+            # Don't log the partial cloud spec. It confuses users into
+            # thinking they do not need to download the full Query Things Data Model
+            # result.
+            #
+            # try:
+            #     self.init_cloud()
+            #     model = await self.cloud.async_get_datamodel(
+            #         self.__discovered_device.get("id"),
+            #     )
+            #     if model:
+            #         _LOGGER.warning(
+            #             "Partial cloud device spec:\n%s",
+            #             log_json(model),
+            #         )
+            # except Exception as e:
+            #     _LOGGER.warning(
+            #         "Unable to fetch data model from cloud: %s %s",
+            #         type(e).__name__,
+            #         e,
+            #     )
         _LOGGER.warning(
             "Device matches %s with quality of %d%%. LOCAL DPS: %s",
             best_matching_type,