How to access the "available" property for an entity in a template

When the available property is false, the entity state is equal to “unavailable”. So we can test the availability in a template with something:

{%- if is_state("switch.some_sensor", "unavailable") %}
    ....
{%- endif %}

Is there other or better ways ?