Преглед изворни кода

Entity naming: _default_to_device_class_name is a function

This is not annotated as a property, despite not having any args, so
needs to be called, otherwise it is always truthy, as it is the function
object.

Issue #1856
Jason Rumney пре 1 година
родитељ
комит
3ad05af65c
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      custom_components/tuya_local/helpers/mixin.py

+ 1 - 1
custom_components/tuya_local/helpers/mixin.py

@@ -60,7 +60,7 @@ class TuyaLocalEntity:
         own_name = (
             self._config.name
             or self._config.translation_key
-            or (self._default_to_device_class_name and self._config.device_class)
+            or (self._default_to_device_class_name() and self._config.device_class)
         )
         return not own_name