@property
def entity_category(self) -> (EntityCategory | None):
    'Return the category of the entity, if any.'
    if hasattr(self, '_attr_entity_category'):
        return self._attr_entity_category
    if hasattr(self, 'entity_description'):
        return self.entity_description.entity_category
    return None
Return the category of the entity, if any.
@property
def entity_category(self) -> (EntityCategory | None):
    
    if hasattr(self, '_attr_entity_category'):
        return self._attr_entity_category
    if hasattr(self, 'entity_description'):
        return self.entity_description.entity_category
    return None