Add config and diagnostic entities (#57528)
* Add config entity concept * Rename is_config_entity to entity_category * Add test * Add 'diagnostic' entity category
This commit is contained in:
parent
24509503bb
commit
4b3d423767
7 changed files with 69 additions and 14 deletions
|
@ -809,3 +809,23 @@ async def test_attribution_attribute(hass):
|
|||
|
||||
state = hass.states.get(mock_entity.entity_id)
|
||||
assert state.attributes.get(ATTR_ATTRIBUTION) == "Home Assistant"
|
||||
|
||||
|
||||
async def test_entity_category_property(hass):
|
||||
"""Test entity category property."""
|
||||
mock_entity1 = entity.Entity()
|
||||
mock_entity1.hass = hass
|
||||
mock_entity1.entity_description = entity.EntityDescription(
|
||||
key="abc", entity_category="ignore_me"
|
||||
)
|
||||
mock_entity1.entity_id = "hello.world"
|
||||
mock_entity1._attr_entity_category = "config"
|
||||
assert mock_entity1.entity_category == "config"
|
||||
|
||||
mock_entity2 = entity.Entity()
|
||||
mock_entity2.hass = hass
|
||||
mock_entity2.entity_description = entity.EntityDescription(
|
||||
key="abc", entity_category="config"
|
||||
)
|
||||
mock_entity2.entity_id = "hello.world"
|
||||
assert mock_entity2.entity_category == "config"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue