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

Device config: reduce log verbosity

Even in debug logs we do not need to know that mappings are being "considered",
only what the final result of the mapping is.

Maybe in the early days this was relevant, to debug the mapping logic,
but now it is just noise in the debug log that hides real information.

Inspired by issue #2722
Jason Rumney 1 год назад
Родитель
Сommit
4ea3d30713
1 измененных файлов с 0 добавлено и 3 удалено
  1. 0 3
      custom_components/tuya_local/helpers/device_config.py

+ 0 - 3
custom_components/tuya_local/helpers/device_config.py

@@ -590,7 +590,6 @@ class TuyaDpsConfig:
         mapping = self._find_map_for_dps(device.get_property(self.id), device)
         mapping = self._find_map_for_dps(device.get_property(self.id), device)
         r = self._config.get("range")
         r = self._config.get("range")
         if mapping:
         if mapping:
-            _LOGGER.debug("Considering mapping for range of %s", self.name)
             cond = self._active_condition(mapping, device)
             cond = self._active_condition(mapping, device)
             if cond:
             if cond:
                 r = cond.get("range", r)
                 r = cond.get("range", r)
@@ -628,13 +627,11 @@ class TuyaDpsConfig:
         scale = self.scale(device) if scaled else 1
         scale = self.scale(device) if scaled else 1
         mapping = self._find_map_for_dps(device.get_property(self.id), device)
         mapping = self._find_map_for_dps(device.get_property(self.id), device)
         if mapping:
         if mapping:
-            _LOGGER.debug("Considering mapping for step of %s", self.name)
             step = mapping.get("step", 1)
             step = mapping.get("step", 1)
 
 
             cond = self._active_condition(mapping, device)
             cond = self._active_condition(mapping, device)
             if cond:
             if cond:
                 constraint = mapping.get("constraint", self.name)
                 constraint = mapping.get("constraint", self.name)
-                _LOGGER.debug("Considering condition on %s", constraint)
                 step = cond.get("step", step)
                 step = cond.get("step", step)
         if step != 1 or scale != 1:
         if step != 1 or scale != 1:
             _LOGGER.debug(
             _LOGGER.debug(