File tree 1 file changed +4
-5
lines changed
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -559,19 +559,18 @@ def test_entity_names() -> None:
559
559
560
560
for _ , entity_classes in iter_all_rules ():
561
561
for entity_class in entity_classes :
562
- if hasattr (entity_class , "_attr_fallback_name" ):
563
- # The entity has a name
562
+ if entity_class ._attr_fallback_name is not None :
564
563
assert (
565
564
isinstance (entity_class ._attr_fallback_name , str )
566
565
and entity_class ._attr_fallback_name
567
566
)
568
- elif hasattr ( entity_class , " _attr_translation_key" ) :
567
+ elif entity_class . _attr_translation_key is not None :
569
568
assert (
570
569
isinstance (entity_class ._attr_translation_key , str )
571
570
and entity_class ._attr_translation_key
572
571
)
573
- elif hasattr ( entity_class , " _attr_device_class" ) :
574
- assert entity_class . _attr_device_class
572
+ elif entity_class . _attr_device_class is not None :
573
+ pass
575
574
else :
576
575
# The only exception (for now) is IASZone
577
576
assert entity_class is IASZone
You can’t perform that action at this time.
0 commit comments